2-bit parallel-prefix adder: build and simulate it online
The black cell (G, P) ∘ (G′, P′) = (G + P·G′, P·P′) combines carries in a tree.
Build the 2-bit parallel-prefix adder in the free online simulator — it checks your circuit automatically.
What you need
- 4 logic switches labelled A1, A0, B1, B0
- 3 probes labelled S1, S0, Cout
- 2 XOR gates
- 2 AND gates
- 2 OR gates
Step by step
- Inputs and outputs. From the Logic section of the library, drop digital inputs (0/1 boxes) or logic switches for the inputs, and digital outputs or probes for the outputs; give each its label in the inspector (the checker finds them by label). Cin is a Logic 0. Switches A1, A0, B1, B0; Probes S1, S0, Cout
- P and G for each bit. The same first row as the lookahead adder. 2 XOR (P), 2 AND (G)
- The black cell. G(1:0) = G1 + P1·G0 — one AND and one OR — then the carries from the prefixes. AND + OR for G(1:0); C1 = G0 + P0·Cin
- Sums and proof. S0 = P0 ⊕ Cin, S1 = P1 ⊕ C1, Cout = G(1:0) + P1·P0·Cin. Check all 16 additions
Truth table
| A1 | A0 | B1 | B0 | Cout | S1 | S0 |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 1 | 0 | 0 | 1 |
| 0 | 0 | 1 | 0 | 0 | 1 | 0 |
| 0 | 0 | 1 | 1 | 0 | 1 | 1 |
| 0 | 1 | 0 | 0 | 0 | 0 | 1 |
| 0 | 1 | 0 | 1 | 0 | 1 | 0 |
| 0 | 1 | 1 | 0 | 0 | 1 | 1 |
| 0 | 1 | 1 | 1 | 1 | 0 | 0 |
| 1 | 0 | 0 | 0 | 0 | 1 | 0 |
| 1 | 0 | 0 | 1 | 0 | 1 | 1 |
| 1 | 0 | 1 | 0 | 1 | 0 | 0 |
| 1 | 0 | 1 | 1 | 1 | 0 | 1 |
| 1 | 1 | 0 | 0 | 0 | 1 | 1 |
| 1 | 1 | 0 | 1 | 1 | 0 | 0 |
| 1 | 1 | 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 | 1 | 1 | 0 |
Frequently asked questions
How do you build a 2-bit parallel-prefix adder?
The black cell (G, P) ∘ (G′, P′) = (G + P·G′, P·P′) combines carries in a tree. In short: inputs and outputs, then p and g for each bit, then the black cell, then sums and proof.
What is the truth table of a 2-bit parallel-prefix adder?
It has 4 inputs (A1, A0, B1, B0) and 3 outputs (Cout, S1, S0), so 16 rows. The full table is on this page; the Embedded Lab checks all of them against your circuit.
What parts do you need for a 2-bit parallel-prefix adder?
2 XOR gates; 2 AND gates; 2 OR gates — plus logic switches for the inputs and probes for the outputs.
Can I simulate a 2-bit parallel-prefix adder online for free?
Yes. Open it in the BitForBytes Embedded Lab, a free browser-based circuit and logic simulator: drag in the gates, wire them, and press "Check my circuit" — every input combination is simulated and marked for you. No download or sign-up needed.
Part of DSD 12 · Parallel-prefix adder in the free BitForBytes digital system design course.