SourceRTL Design Directory

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:

ABCSUM (S)Carry (Co)
00000
00110
01010
01101
10010
10101
11001
11111

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);