n-bit adder can be built as a cascade of full adders
While fully implementing the truth table as SOP would be faster with propagation delay, it would be to expensive to build because of the number of gates (because it would grow exponentially)
Full Adder
The 1-bit adder is called a full adder
Logic functions
si=xi⊕yi⊕ci−1
ci=xiyi+xici−1+yici−1
Implementation
Ripple Carry Adder
Cascade of n full bit adders
Cost
Hardware: 5n gates (very cheap)
Delay: 2ntpd (very slow)
Has the highest delay
Sequential Adder (Bit-Serial)
Single full adder is used
Addition is done stepwise
The carry is saved in a flip flop
Parallel to serial converter is needed at the inputs
Serial to parallel converter at the output
Cost
Hardware: constant
Delay: ntclk
Carry-Lookahead Adder
Allows us to speed up the slow carry signal
Introduces two help functions
gi: generate carry
if gi=1 then a a carry will be generated in position i regardless of ci−1
gi=xi⋅yi
pi: propagate carry
if pi=1 then ci will be propagated. otherwise, the carry will be absorbed
pi=xi+yi
Equations
si=gi⊕pi⊕ci−1
ci=gi+pici−1
Cost
Hardware: 2n2+29n
This grows polynomially which is acceptable (compared to the exponential brute force option)
Delay: 4tpd
Comparison
Ripple Carry
Carry Lookahead
2-Level Logic
Hardware (in num gates)
5n
2n2+29n
O(2n+1)
Delay (in tpd)
2n
4
2
Combinational Adder
Adder for large bit width
Carry lookahead adders are expensive for large n
Instead you can connect multiple smaller carry lookahead adders together
Ex: 12 bit adder as 3 4-bit carry lookahead adders
Subtractors
Built the same way as adders
1-bit full subtractor exists but often two’s complement addition is just used instead
XOR allows for the second operand to be optionally negated (need to negate when subtracting)
c−1 is set to 1 when subtracting to convert the 1’s complement calculated by the XOR into a 2’s complement