Template: 1-Bit Full Adder Component
Single full adder component with carry input and output. Foundation for multi-bit arithmetic circuits.
Was du lernst
- Add three bits (A, B, Cin) and produce sum + carry-out.
- Read the full-adder truth table: 8 rows, sum = parity, carry-out = majority.
- Recognise sum as XOR of all three inputs (parity function).
- Recognise carry-out as the 3-input majority function.
- Identify the full-adder as the universal cell for multi-bit arithmetic.
So funktioniert es
A full adder adds three single bits — A, B, and a carry-in (Cin) — and produces a 2-bit result: a sum bit (S) and a carry-out bit (Cout). The carry-in lets full-adders chain together to form multi-bit adders, where each higher bit feeds the next via the carry chain.
- Sum: S = A ⊕ B ⊕ Cin (high if an odd number of inputs are 1) - Carry-out: Cout = (A · B) + (Cin · (A ⊕ B)) (high if at least two of the three inputs are 1)
The carry-out logic is the majority function: out of three inputs, the carry is 1 whenever at least two of them are 1. This makes intuitive sense — adding three bits gives a value 0, 1, 2, or 3, and the high bit (carry-out) is 1 only for results ≥ 2.
With three binary inputs there are 2³ = 8 possible input combinations. The truth table has 8 rows; sum follows the parity pattern; carry-out follows the majority pattern.
A full adder is the workhorse of binary arithmetic. Every wide adder, subtractor, multiplier, and divisor inside a CPU is built from chained full-adders.
Wahrheitstabelle
Three inputs, two outputs. Sum is parity (XOR); Carry-out is majority (≥ 2 of 3 high).
| Eingänge | Ausgang | ||||
|---|---|---|---|---|---|
| A | B | Cin | Sum | Cout | |
| 0 | 0 | 0 | 0 | 0 | 0 + 0 + 0 = 0 |
| 0 | 0 | 1 | 1 | 0 | 0 + 0 + 1 = 1 |
| 0 | 1 | 0 | 1 | 0 | 0 + 1 + 0 = 1 |
| 0 | 1 | 1 | 0 | 1 | 0 + 1 + 1 = 2 (binary 10) |
| 1 | 0 | 0 | 1 | 0 | 1 + 0 + 0 = 1 |
| 1 | 0 | 1 | 0 | 1 | 1 + 0 + 1 = 2 |
| 1 | 1 | 0 | 0 | 1 | 1 + 1 + 0 = 2 |
| 1 | 1 | 1 | 1 | 1 | 1 + 1 + 1 = 3 (binary 11) |
Boolescher Ausdruck
Sum bit — XOR of all three inputs (the parity function for 3 bits).
Carry-out — fires if both A and B are 1, OR if Cin is 1 and at least one of A/B is 1.
Equivalent: the 3-input majority function. Carry happens when any pair of inputs is 1.
Schritt für Schritt ausprobieren
Stelle die Eingänge in der Einbettung oben ein, lies was passieren sollte und überprüfe es.
- 1A = 0 B = 0 Cin = 0Erwartet:
S=0, Cout=0Was du siehst: All zero — no addition. Default state. - 2A = 1 B = 0 Cin = 0Erwartet:
S=1, Cout=0Was du siehst: Single bit set — sum is 1, no overflow. - 3A = 1 B = 1 Cin = 0Erwartet:
S=0, Cout=1Was du siehst: Two bits set — sum=2 (binary 10). Cout fires; sum bit is 0. - 4A = 1 B = 1 Cin = 1Erwartet:
S=1, Cout=1Was du siehst: All three bits set — sum=3 (binary 11). Both output bits high.
Verwendete Komponenten
Praxisanwendungen
CPU integer ALU. A 64-bit integer adder is 64 full-adders chained (with optional carry-lookahead acceleration). Every add, increment, decrement, and pointer arithmetic operation flows through this hardware.
Multipliers. Wallace-tree and Dadda-tree multipliers use arrays of full-adders to compress partial products into a final sum.
Floating-point arithmetic. The mantissa add/subtract path is a chain of full-adders after exponent alignment.
DSP MAC units. Multiply-accumulate (MAC) operations in DSP processors use a full-adder chain to accumulate products.
Counters. Incrementing a counter by 1 is essentially a full-adder chain with B fixed to 0...01 and Cin = 0.