44 total
By the end of this subtopic, you should be able to:
Before diving into adders, it helps to understand two types of circuits:
Half adders and full adders are both combinational circuits.
A half adder is a simple circuit that adds two single binary digits (bits) together. It takes two inputs, usually called A and B, and gives two outputs:
Think of it like adding two digits by hand. If you add 1 + 1, you get 2. In binary, 2 is written as 10 — the 0 is the sum and the 1 is the carry.
The rules are simple:
The truth table for a half adder looks like this:
| A | B | Sum (S) | Carry (C) |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
If you look carefully at the Sum column, you will notice it matches the truth table for an XOR gate (output is 1 only when the inputs are different). The Carry column matches the truth table for an AND gate (output is 1 only when both inputs are 1).
So a half adder is built using:
Boolean expressions for the half adder:
The main limitation of a half adder is that it cannot accept a carry from a previous addition. When you add multi-bit numbers, each column (except the first) needs to include the carry from the column before it. A half adder cannot do this — that is where the full adder comes in.
A full adder solves the problem of the half adder by accepting three inputs:
It produces two outputs:
To work out the outputs, add all three inputs together. Since each input is 0 or 1, the total can be 0, 1, 2, or 3. Write that total as a two-bit binary number: the right bit is the Sum, and the left bit is the Carry out.
For example: A = 1, B = 1, Cin = 1 → 1 + 1 + 1 = 3 = 11 in binary → Sum = 1, Cout = 1
The full truth table for a full adder:
| A | B | Cin | Sum (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 |
A full adder can be built by combining two half adders and one OR gate:
By chaining full adders together (connecting the Cout of one to the Cin of the next), you can add binary numbers with any number of bits. This is exactly how computers add numbers in their arithmetic logic unit (ALU).
Note on gates with more than two inputs: Logic gates can have more than two inputs. For example, a three-input AND gate gives an output of 1 only when all three inputs are 1. When producing a truth table for such circuits, you simply evaluate each gate one step at a time, working from left (inputs) to right (outputs).
Sign in to view full notes