Half Adder, Full Adder and the 74283 4-Bit Adder
Learn how half and full adders add binary numbers, how to build a ripple carry adder, how the 74283 works with its carry in and out, with worked sums.
Adding two bits
Binary addition follows the same rules as decimal addition, but with only two digits. 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10, which is a sum of 0 and a carry of 1. A circuit that adds two bits and gives a sum and a carry is called a half adder.
Sum = A ⊕ B Carry = A · B
The sum is an XOR gate, because it is 1 only when the bits differ. The carry is an AND gate, because it is 1 only when both bits are 1. A half adder is therefore two gates.
The full adder
A half adder cannot be chained, because it has no input for a carry from the previous column. A full adder adds three bits: A, B and a carry in, Cin. It gives a sum S and a carry out, Cout.
S = A ⊕ B ⊕ Cin Cout = A · B + Cin · (A ⊕ B)
| A | B | Cin | S | Cout |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 0 | 1 | 0 |
| 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 0 |
| 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 1 | 1 |
S is 1 when an odd number of inputs are 1. Cout is 1 when at least two inputs are 1, so it is the majority function. A full adder is two half adders and an OR gate: the first half adder adds A and B, the second adds its sum to Cin, and the OR joins the two carries.
A 4 bit ripple carry adder
To add two 4 bit numbers, connect four full adders in a row. The carry out of each stage goes to the carry in of the next stage, from the least significant bit to the most significant bit. The first carry in is 0 for plain addition.
The carry has to travel through every stage, one after the other, so the final sum bit is correct only after all the carries have settled. This is called ripple carry. If each stage takes 20 ns, the four stage adder needs about 80 ns.
The 74283
The 74283 is a 4 bit binary adder in one 16 pin package. It has inputs A1 to A4 and B1 to B4, a carry in C0, four sum outputs Σ1 to Σ4 and a carry out C4. Pin 16 is the 5 V supply and pin 8 is ground. Bit 1 is the least significant bit.
Inside, it does not ripple. It uses carry look ahead logic. For each bit it computes a generate term G = A · B and a propagate term P = A ⊕ B, and finds every carry directly from them. For example C1 = G0 + P0 · C0. All carries appear in about two gate delays, so the chip is much faster than four separate full adders.
Worked sums
| Decimal | A | B | C0 | C4 and sum |
|---|---|---|---|---|
| 7 + 5 | 0111 | 0101 | 0 | 0 1100 (12) |
| 9 + 8 | 1001 | 1000 | 0 | 1 0001 (17, carry set) |
| 15 + 15 + 1 | 1111 | 1111 | 1 | 1 1111 (31) |
The second sum needs five bits, so the fifth bit appears as the carry out C4. To add numbers longer than 4 bits, connect C4 of one chip to C0 of the next.
Overflow and BCD
If the numbers are signed in two's complement, a result outside the range of −8 to +7 is an overflow. It shows when the carry into the top bit differs from the carry out of it. 0111 + 0101 = 1100 is 12 as an unsigned number but −4 as a signed one, so a signed overflow has occurred.
With binary coded decimal digits, the sum of two digits can reach 18. If the binary sum is above 9 or a carry occurs, adding 6 (0110) with a second adder corrects it. 9 + 8 = 10001 gives 0001 with a carry. Adding 0110 gives 0111, which with the carry reads 17 in BCD.
Try it in the virtual lab
SinBench has free 3D benches and interactive demos for this topic. Open one to try the ideas above with real instruments, no sign up needed.
Questions and answers
What is the difference between a half adder and a full adder?
A half adder adds two bits. A full adder adds two bits and a carry from the previous column, so full adders can be chained to add longer numbers.
What does the 74283 do?
It adds two 4 bit binary numbers and a carry in, and gives a 4 bit sum and a carry out. It uses carry look ahead, so it is fast.
What is ripple carry?
It is a way of adding in which the carry travels from one full adder to the next. Each stage must wait for the one before it, so the delay grows with the number of bits.
How do you add two 8 bit numbers with 74283 chips?
Use two chips. Connect the carry out C4 of the lower chip to the carry in C0 of the upper chip, and set the first C0 to 0.
Related topics
Binary Subtraction with Two's Complement and the 74283
Learn to subtract binary numbers with two's complement, build an adder subtractor from a 74283 and XOR gates, and read the carry and the sign of the result.
Digital Logic DesignLogic Gates and Truth Tables: AND, OR, NOT, NAND, NOR, XOR
Learn the seven basic logic gates with truth tables, symbols and expressions, the common TTL chips that hold them and how to read a gate level circuit.
Digital Logic DesignTTL Chips on a Breadboard: Power, Pin Numbers and Wiring Rules
A practical guide to wiring TTL chips on a breadboard: supply voltage, pin numbering, unused inputs, logic levels, LED resistors and common mistakes.