Adding numbers one bit at a time.
A computer adds with a chain of tiny circuits, one per bit. Build them from gates, then use four of them in one chip.
Binary addition
Adding two bits has four cases: 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1 and 1 + 1 = 10, which is 0 with a carry of 1 into the next column. Every column after the first must also add the carry that came in.
| Carry in | 0 | 0 | 0 | 0 |
|---|---|---|---|---|
| A | ||||
| B | ||||
| S = A + B | 1 | 1 | 1 | 1 |
9 + 6 = 15. Carry out 0.
Half adder
It adds two bits but has no input for a carry from a lower column, so it only works for the first column. That is why it is called a half adder.
Full adder
Two half adders in a row: the first adds A and B, the second adds that sum to Cin. A carry comes from either half adder, so an OR gate joins the two carries.
Four bits in a row
Each Cout feeds the next Cin. The first Cin is 0 (wired to GND).
The carry ripples from bit 0 to bit 3; the last Cout is the fifth bit of the sum.
10010 in binary: the 74283 shows 0010 on the sum LEDs and 1 on Cout.
The 74283
Hold the chip with its notch on the left. Pin 1 is at the bottom left, the pins count up to the right, then continue along the top from right to left. Most 14 pin chips have VCC on pin 14 and GND on pin 7, but not all: check every new chip.
The 74283 has VCC on pin 16 and GND on pin 8. Its pins are not in order: A0 is pin 5, A1 pin 3, A2 pin 14 and A3 pin 12. Wire from the pin diagram, not by guessing.
Check yourself
Q1What do S and Cout of a half adder give for A = 1, B = 1?
S = 0 and Cout = 1 (1 + 1 = 10).
Q2Why does a full adder need an OR gate?
A carry can come from the first half adder or from the second; the OR passes either.
Q3Which pin of the 74283 is Cin and where does it go in Task 3?
Pin 7, wired to GND so the first carry is 0.
Q4What do the LEDs show for 9 + 8?
Cout = 1 and S3 S2 S1 S0 = 0001: 10001 = 17.