13 / 36 · अवधारणा
Half adders and full adders
Compute sum and carry separately, then chain them.
पाठ पढ़ना मुफ़्त है। प्रगति सेव करने के लिए नामांकन करें।
अनुवाद अभी उपलब्ध नहीं है। मूल पाठ दिखाया गया है। (English)
Learning goals
- Distinguish sum width from carry.
- Explain how full adders can be chained.
1+1 produces a two-bit result.
A half adder computes sum=a^b and carry=a&b. Adding 1 and 1 gives binary 10, so sum=0 and carry=1.
A full adder also adds cin from the previous position. Its sum is a^b^cin and cout=(a&b)|(a&cin)|(b&cin). Carry is 1 when at least two inputs are 1.
assign sum = a ^ b ^ cin;
assign cout = (a & b) | (a & cin) | (b & cin);Pass carry to the next bit.
In a chain, cout from bit 0 becomes cin for bit 1. Keeping the final carry when adding two N-bit inputs requires an N+1-bit result.
Make width explicit with assign total = {1'b0, a} + {1'b0, b};. A ripple-carry implementation has propagation delay; the arithmetic expression alone does not verify its speed.
इनपुट बदलें
खुद आज़माएँ
Find sum and cout for a=1, b=0, cin=1.
व्याख्या पढ़ें
The total is 2, or binary 10: sum=0 and cout=1.