4-bit incrementer: add 1 with half adders, live
A 4-bit incrementer adds 1 to a 4-bit number: S = A + 1, with a carry out when A is 1111. It needs no B input, so instead of full adders it is a chain of four half adders, the first adding the constant 1 to A0 and each passing its carry to the next.
Adding 1 is the most common arithmetic in a computer: the program counter does it after every instruction, and every synchronous counter computes it as its next state. Because the second operand is the constant 0001, each column adds only two bits, Ai and the carry from below, which is exactly a half adder. The pattern is easy to read off: the incrementer flips every bit up to and including the lowest 0, so 0111 becomes 1000. The half adders here are the verified half adder, saved as a part. All 16 inputs are checked before the page is built; the live circuit starts at 0000, so S shows 0001.
Open this circuit in the lab →
What you need
- 4× half adder: one per bit: Si = Ai XOR Ci, Ci+1 = Ai AND Ci
- 1× constant 1: the B input of the first half adder
Step by step
- Place inputs
A3toA0and probesS3toS0andCout. - Feed A0 and a constant 1 into the first half adder; its sum is
S0(NOT A0). - Feed each next bit Ai and the carry from the half adder below into the next half adder; its sum is
Si. - The last half adder's carry is
Cout, which is 1 only for 1111 + 1. - Count A from 0000 to 1111: S is always one more, wrapping to 0000 with Cout = 1.
4-bit incrementer truth table
| A3 A2 A1 A0 | S3 S2 S1 S0 | Cout | Decimal |
|---|---|---|---|
| 0000 | 0001 | 0 | 0 + 1 = 1 |
| 0001 | 0010 | 0 | 1 + 1 = 2 |
| 0010 | 0011 | 0 | 2 + 1 = 3 |
| 0011 | 0100 | 0 | 3 + 1 = 4 |
| 0100 | 0101 | 0 | 4 + 1 = 5 |
| 0101 | 0110 | 0 | 5 + 1 = 6 |
| 0110 | 0111 | 0 | 6 + 1 = 7 |
| 0111 | 1000 | 0 | 7 + 1 = 8 |
| 1000 | 1001 | 0 | 8 + 1 = 9 |
| 1001 | 1010 | 0 | 9 + 1 = 10 |
| 1010 | 1011 | 0 | 10 + 1 = 11 |
| 1011 | 1100 | 0 | 11 + 1 = 12 |
| 1100 | 1101 | 0 | 12 + 1 = 13 |
| 1101 | 1110 | 0 | 13 + 1 = 14 |
| 1110 | 1111 | 0 | 14 + 1 = 15 |
| 1111 | 0000 | 1 | 15 + 1 = 16 |
All 16 rows, with all five outputs each, are checked on the live circuit. A 4-bit decrementer is the same idea with a borrow chain: A - 1 flips every bit up to and including the lowest 1.
You can also read the full theory in the lesson on the half adder. Prefer to build it yourself from scratch? Open the digiwleea lab and place the gates on the canvas, or start from the logic gate simulator.
More builds: Arithmetic
All 246 build guides, by topic
Each of these is one step from a transistor to a working CPU. Build every gate from CMOS transistors and work all the way up in the free digiwleea lab, with the free theory reference alongside.
Open the 4-bit incrementer in the lab →Frequently asked
What is a 4-bit incrementer?
A combinational circuit that outputs its 4-bit input plus 1, with a carry out when the input is 1111. It is used in program counters and counters.
Why does an incrementer use half adders instead of full adders?
Each bit only adds two things: its own input bit and the carry from the bit below. Adding a constant 1 needs no second operand, so a half adder per bit is enough, with the constant 1 as the first half adder's other input.
How many gates does a 4-bit incrementer need?
Four half adders, each one XOR and one AND, so eight gates. The first half adder adds a constant 1, so it reduces to S0 = NOT A0 and carry = A0, which a simplified design can use to save two gates.
What is the difference between an incrementer and a counter?
An incrementer is combinational: it computes A + 1 and forgets. A counter adds a register that stores the value and loads A + 1 on every clock edge.