3.3.1 · D3Combinational Circuits

Worked examples — Half adder and full adder

2,796 words13 min readBack to topic

Before we touch numbers, one reminder of the tools, spelled out so nobody is lost:

Recall the equations we are testing (from the parent), now with read as :

The schematics below show both cells at gate level. Keep them beside you as we work — every example below points back to a specific gate in these pictures, so you can see which wire fired.

Figure — Half adder and full adder

The half-adder schematic (above) has exactly two gates: the XOR on top drives the Sum wire, the AND below drives the Carry wire. Examples 2 and 3 are literally "which of these two gates lights up?"

Figure — Half adder and full adder

The full-adder schematic (above) is two half adders plus one OR on the carries. In Examples 4 and 5, watch the amber OR output: it fires whenever either half-adder carry ( from HA1 or from HA2) is 1 — that is the majority rule made physical.


The scenario matrix

Every input situation a single adder cell (or a chain of them) can face falls into one of these classes. Each worked example below is tagged with the cell it covers.

Cell Case class What makes it special Covered by
Z All inputs zero (degenerate) Nothing to add — outputs must stay 0 Ex 1
H1 Half adder, exactly one input high The "carry must NOT fire" case Ex 2
H2 Both HA inputs high The classic carry Ex 3
F1 Full adder, exactly one input high Only the incoming carry (or one bit) is 1 → , no carry-out Ex 6 (col 2)
F-even Full adder, even count of 1s with a carry Two 1s → yet carry-out still fires (majority) Ex 4
F-max Full adder, all three high (limit) Largest single-cell output = Ex 5
Ripple Multi-column chain, carry propagates far of one feeds of next Ex 6
Overflow Chain result outgrows its bit-width The leftmost carry escapes Ex 7
Word Real-world word problem Translate a story into adder cells Ex 8
Twist Exam trap / subtraction reuse Adder doing subtraction via two's complement Ex 9

Worked examples

Now we chain cells. The picture below shows three full adders wired in a row — study which wire carries what before the next examples.

Figure — Half adder and full adder

Recall Rebuild the matrix (say the "why" out loud each time)

Cover the answers and re-derive for: all-zeros, one-high, both-high, all-three-high. Then chain . All-zeros — why? ::: Count of 1s is 0 (even) so XOR gives ; no AND-product fires so . Answer . Both-high half adder — why? ::: Equal bits don't differ so XOR gives ; both high so AND fires . Answer . Full adder with even count (two 1s) — why? ::: Two is even so XOR gives ; but two 1s meet the majority so . Answer . All-three-high full adder — why? ::: Three is odd so XOR gives ; at least two 1s so majority gives . Answer . — why? ::: Carry born in col 0, ripples through col 1 (majority), dies in col 2 (only one 1). Answer . via two's complement — why? ::: Add to two's complement of ; ordinary adder rules; drop the escaping carry (result non-negative). Answer .

Connections

Concept Map

Sum XOR fires

Carry AND fires

Sum 0 but carry 1

Sum 1 and carry 1

Cout feeds Cin

top carry escapes

twos complement

Scenario matrix

All zeros

One bit high

Both high

Even count with carry

All three high

Ripple chain

Overflow

Subtraction reuse

Sum = odd count

Carry = majority

Carry propagates

Overflow flag

Drop final carry