Full Adder
A full adder is a basic building block of a digital circuit. Full adder requires three inputs a, b, and c(carry-in) to result in two outputs s(sum) and co(carry-out).
Full adder truth table:
A | B | C | SUM (S) | Carry (Co) |
---|---|---|---|---|
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 |
Boolean equation for sum and carry is :
- Sum = A xor B xor C
- Carry = (A and B) or (B and C) or (C and A)
Verilog Code: Full Adder
assign s = a ^ b ^ c;
assign co = (a & b) | (b & c) | (c & a);