3.3.1 · D4Combinational Circuits

Exercises — Half adder and full adder

2,814 words13 min readBack to topic

Level 1 — Recognition

Exercise 1.1

For a half adder, fill in for inputs .

Recall Solution

A half adder computes and .

  • (the bits differ, so XOR is ).
  • (not both , so AND is ).

Answer: . This is decimal , and in binary is just — no carry needed. ✓

Exercise 1.2

Which gate produces the carry of a half adder, and which produces the sum?

Recall Solution
  • Carry comes from an AND gate: . Carry only when both bits are .
  • Sum comes from an XOR gate: . Sum is when the bits differ.

Mnemonic: See it (Sum = XOR) here, Cart it (Carry = AND) next door.

Exercise 1.3

A full adder has how many inputs and how many outputs? Name them.

Recall Solution
  • Three inputs: , , and (the carry from the previous column).
  • Two outputs: (Sum) and (Carry-out).

It is "full" precisely because it accepts the third input — a plain half adder cannot.


Level 2 — Application

Exercise 2.1

Compute the full-adder outputs for .

Recall Solution

Full adder: , .

  • . Count the ones among : two ones → even.
  • .

Answer: . Check: , and the two-bit answer . ✓

Exercise 2.2

Compute the full-adder outputs for .

Recall Solution
  • : ones = two ones → even → .
  • .

Answer: . Check: . ✓

Exercise 2.3

Add the 3-bit numbers and using a chain of full adders (a Ripple-carry adder). Show every column's .

Recall Solution

Line them up, rightmost column (bit 0) first. Start with .

Look at the ripple diagram — the red carry wire threads from one cell to the next.

Figure — Half adder and full adder
  • Column 0: → sum , carry .
  • Column 1: → sum , carry .
  • Column 2: → sum , carry .
  • Final carry out .

Reading top carry then the sum bits: result . Check: , , . ✓

Exercise 2.4

Using the equivalent carry form , verify for .

Recall Solution
  • . The first term already fires.
  • , so .
  • (OR).

Answer: . Compare with the standard form: . ✓ Both agree.


Level 3 — Analysis

Exercise 3.1

The carry-out is the majority function of . Explain why encodes "at least two inputs are 1," and confirm it against the parent's truth table.

Recall Solution

Each product term is a pair of inputs both being :

  • means and are (that's already two ones).
  • means and are both .
  • means and are both .

The three terms cover every possible pair. If any pair is both-, at least two inputs are , and OR-ing the terms fires. If fewer than two inputs are , no pair is both-, so .

Truth-table rows with are exactly — precisely the rows with two or three ones. ✓

Exercise 3.2

Show algebraically that and are the same function.

Recall Solution

Expand XOR: . Then So the second form is .

Now start from the first form and split its terms on whether the other variable is or : Add them and absorb repeats (): The term is already covered by (since contains ). What's left uncovered is — exactly the second form's extra terms.

Both reduce to . Identical.

Exercise 3.3

A student wires a full adder from two half adders and combines the two half-adder carries with an XOR gate instead of OR. For which input row does this give the wrong ?

Recall Solution

The two half-adder carries are and . The correct final carry is (OR).

XOR and OR differ only when both inputs are : XOR gives , OR gives . So we need and simultaneously.

  • requires .
  • But then , forcing .

So and can never both be — they are mutually exclusive. Therefore XOR and OR give the same result on every row!

Answer: There is no row where it goes wrong. The XOR "bug" is harmless here — a neat consequence of the two carries being disjoint. ✓


Level 4 — Synthesis

Exercise 4.1

Design a 3-bit adder for and by chaining three full adders. Give each column's and the final result.

Recall Solution

Rightmost column is bit 0. Start .

  • Col 0: → sum , carry .
  • Col 1: → sum , carry .
  • Col 2: → sum , carry .
  • Final carry .

Result . Check: , , . ✓

Exercise 4.2

Build a half subtractor: it takes bits (minuend) and (subtrahend) and outputs Difference and Borrow (a when you must borrow). Derive its equations from a truth table.

Recall Solution

Compute for all four rows. A borrow happens when , i.e. .

0 0 0 0 0
0 1 (borrow) 1 1
1 0 1 0 1
1 1 0 0 0
  • Difference when the bits differ (same XOR as the half adder's Sum!).
  • Borrow only at row .

Equations: , . Note how close this is to the half adder — only the carry/borrow logic changed from to . See Two's complement subtraction for how real hardware subtracts using adders.

Exercise 4.3

Using Truth tables and minterms, write the sum-of-minterms (canonical) expression for the full-adder , then confirm it simplifies to .

Recall Solution

on rows . Each row is a minterm (product where a variable is complemented): Group the first two and last two: Let . Then . ✓ Because XOR is associative, this is .


Level 5 — Mastery

Exercise 5.1

A Ripple-carry adder made of full adders has each carry pass through gate delays before the next stage can settle. If one full adder's carry path costs gate delays, and the final sum bit needs the carry to arrive first, roughly how many gate delays does an -bit ripple adder take for its most-significant bit to settle? Explain why the Carry-lookahead adder exists.

Recall Solution

The carry into stage must ripple through all earlier stages. For bits, the carry into the last stage has passed through prior carry paths, then that last stage produces its sum: Taking delays per stage across all stages, the worst-case carry chain is about gate delays.

Why it matters: the delay grows linearly with the number of bits — a -bit ripple adder is slow. The Carry-lookahead adder computes all carries in parallel from the inputs (using "generate" and "propagate" signals), turning linear delay into roughly logarithmic delay. ✓

Exercise 5.2

Subtract using an adder and two's complement (4-bit). Show the steps, using full adders with into the least-significant stage.

Recall Solution

Two's complement subtraction: . The "" is fed in as at bit 0. See Two's complement subtraction.

  • .
  • . Invert every bit: .
  • Add with :
  • Col 0: , carry .
  • Col 1: , carry .
  • Col 2: , carry .
  • Col 3: , carry (final carry-out , discarded in 4-bit).

Result . Check: . ✓ The discarded carry-out signals a non-negative result.

Exercise 5.3

Prove that the full-adder Sum output equals iff the number of s among the three inputs is odd — for all eight input rows.

Recall Solution

XOR has a key property: it flips its running result each time a fresh arrives. Start at :

  • ones → result stays (even) → .
  • one → one flip → (odd).
  • ones → two flips → back to (even) → .
  • ones → three flips → (odd).

Check all rows against the parent truth table: exactly on = rows with or ones (odd), and on = rows with or ones (even). ✓ This "parity" behaviour is precisely why the Sum is XOR and never OR.


Connections

  • Half adder and full adder — the parent note these exercises drill
  • XOR gate — the parity gate behind every Sum output
  • AND gate and OR gate — the carry logic
  • Ripple-carry adder — chained full adders (Ex 2.3, 4.1)
  • Carry-lookahead adder — the speedup motivated in Ex 5.1
  • Truth tables and minterms — the derivation method (Ex 4.3)
  • Two's complement subtraction — adders reused to subtract (Ex 4.2, 5.2)
  • Combinational circuits — the parent family