Skip to content

Adders

Addition is one of the most fundamental operations in computers. Integer arithmetic, address calculation, and even multiplication/division ultimately rely on adders. In CPU datapaths, adders are core components inside the ALU.

A half adder adds two 1-bit numbers without a carry-in.

  • Sum: S=ABS = A \oplus B
  • Carry: C=ABC = A \cdot B

Truth table:

ABSC
0000
0110
1010
1101

Table 2.5: Half-adder truth table.

Symbol:

Half adder symbol

Figure 2.4: Half-adder symbol.

A half adder cannot directly build multi-bit addition because it lacks a carry-in input, so we need a full adder.

A full adder adds A and B with a carry-in CinC_{in}:

  • Sum: S=ABCinS = A \oplus B \oplus C_{in}
  • Carry-out:

Cout=AB+ACin+BCinC_{out} = A\cdot B + A\cdot C_{in} + B\cdot C_{in}

Symbols / construction idea:

Full adder symbol

Figure 2.5: Full-adder symbol.

Full adder from half adders

Figure 2.6: Constructing a full adder from two half adders and an OR gate.

Chaining nn full adders forms an nn-bit adder. The carry-out of each bit feeds the next bit’s carry-in. With Cin=0C_{in}=0 at the least significant bit, this is a ripple-carry adder.

4-bit ripple-carry adder

Figure 2.7: 4-bit ripple-carry adder.

Ripple-carry adders are simple and great for teaching, but carry propagation makes delay grow roughly linearly with bit width, so modern CPUs use faster adder designs.

  • Build a 1-bit half adder using gates.
  • Build a 1-bit full adder in a modular (hierarchical) way.
  • Build a 4-bit ripple-carry adder from full adders and observe carry propagation.
  • Simulator: Logisim Evolution
  1. Place input pins A and B.
  2. Place output pins S and C.
  3. Build S=ABS = A\oplus B with one XOR gate.
  4. Build C=ABC = A\cdot B with one AND gate.

1-bit half adder circuit

Figure 2.8: Gate-level 1-bit half-adder circuit.

Test (A,B) = 00, 01, 10, 11 and confirm (S,C) matches the truth table.

  1. Rename the current circuit to HalfAdder.

Rename circuit

Figure 2.9: Renaming a circuit in Logisim Evolution.

  1. Create a new circuit named FullAdder and set it as the main circuit.
  2. Place inputs A, B, and CinC_{in}; place outputs S and CoutC_{out}.
  3. Place two HalfAdder subcircuits.
    • First HalfAdder: inputs A, B; outputs S1S_1, C1C_1
    • Second HalfAdder: inputs S1S_1, CinC_{in}; outputs S, C2C_2
  4. Use an OR gate to compute Cout=C1+C2C_{out} = C_1 + C_2.

1-bit full adder circuit

Figure 2.10: 1-bit full-adder circuit (hierarchical design using HalfAdder subcircuits).

Test all combinations (A,B,CinC_{in}) from 000 to 111.

  1. Create a new main circuit named RippleAdder4.
  2. Place 4-bit inputs A[3:0], B[3:0] and 1-bit input CinC_{in}.
  3. Place 4-bit output S[3:0] and 1-bit output CoutC_{out}.
  4. Use splitters to break out bits A0…A3, B0…B3, S0…S3.
  5. Place four FullAdder blocks and chain their carries.

4-bit ripple-carry adder circuit

Figure 2.11: 4-bit ripple-carry adder circuit (FullAdder chained with carry propagation).

Functional checks (example test vectors):

  • No carry chain: A=0010, B=0001 → S=0011, Cout=0C_{out}=0
  • Multi-bit carry: A=1111, B=0001 → S=0000, Cout=1C_{out}=1
  • Random vectors: verify against hand calculation

Observe carry propagation using an input that causes a continuous carry chain.

  • Half adder: circuit screenshot + truth table test screenshot.
  • Full adder: circuit screenshot + test screenshots for 000…111.
  • RippleAdder4: circuit screenshot + screenshots for at least 3 test cases + a screenshot showing carry propagation.
  • Package RippleAdder4 and extend it to an 8-bit adder; discuss delay impact of longer carry chains.
  • How would you generate an overflow signal?