Logic Circuits That Add and Remember
Half adders and full adders perform binary addition with carries. A static flip-flop stores one bit while powered, using internal feedback to retain its state between updates.
What a learner can do afterwards
- Give the sum and carry a full adder produces for each combination of its three inputs
- Chain full adders to add two unsigned four-bit numbers and identify a final carry beyond the four-bit result
- Explain what a static flip-flop holds and how internal feedback retains its state between updates
1 · Read
The Boolean operations you studied can build a half adder. For input bits A and B, carry = A AND B; sum = (A OR B) AND NOT (A AND B). Each operation can be a gate. The half adder adds two bits, giving a sum for this column and a carry for the next column left. Totals 0, 1 and 2 are binary 00, 01 and 10: the right bit is sum and the left bit is carry.
A full adder has three inputs: the two bits in its column and a carry in from the column on its right. The carry in counts as one more bit in this column. Its outputs are the sum bit and carry out. Unlike a full adder, a half adder has no carry-in input.
Add all three full-adder inputs before choosing its outputs. Write the total in binary: its right bit is the sum and its left bit is carry out. For inputs 1, 0 and carry in 1, the total is 2: sum 0 and carry out 1. The table below lists inputs A, B, carry in, followed by sum and carry out.
For unsigned four-bit addition, start at the rightmost column with carry in 0. Add that column's two bits and carry in. Write its sum bit and pass its carry out left. Repeat for all four columns. For 0011 + 0010, the column totals from right to left are 1, 2, 1 and 0. The result is 0101 with final carry 0.
Unsigned four-bit values range from 0 to 15. A final carry of 1 means the exact sum needs a fifth bit. For 1100 + 0101, the exact result is 10001, but the four sum bits are 0001. Keeping only those four bits discards the carry. This is unsigned overflow; signed arithmetic uses a different overflow test.
In a ripple-carry adder, connect each column's carry out to the next column's carry in on the left. Set the rightmost carry in to 0 for ordinary addition. Forcing every carry in to 0 loses carries needed by later columns. Leaving an input electrically unconnected is different: its value may be unpredictable.
A static flip-flop stores one bit while powered. Internal feedback maintains its state between updates. It is not a wire from the external output to the external data input. A D flip-flop copies its data input at the active clock edge, then holds that bit until another update. If its data input changes between edges, its stored output stays the same.
Add each column and pass its carry left. A final carry flags unsigned overflow. A powered static flip-flop holds one bit between updates.
Lesson, questions and flashcards written for this dataset.
Additional readings and flashcards written for this dataset. Linked videos from Khan Academy, including partner content with Code.org.
2 · Watch
به انگلیسیTake it off screen
Where it sits
Optional connections
8 questions wait behind this lesson, each with its answer explained. Every answer feeds the sky: stars light as they are learned, and dim when it is time to come back.