In this part we’ll cover different kind of (binary) adders that digital circuits use. They’re an essential part for all the arithmetic operations which are needed.
Full Adder
The (1-bit) full adder is the simplest adder unit we can create.
It takes two input bits and , with (carry in) - it outputs two bit signals, and
If we use a truth table and find a boolean function for it, we find that:
Which we can simply this to:
For :
Which simplifies to:
Ripple Carry Adder
So the full adder is the building block for adding two bit inputs. But that isn’t of much use, we usually use bigger numbers. So chaining full adders to each other becomes, for example, a 4-bit adder. For adding 4 bit numbers.
This is called a Ripple Carry Adder
For each Full Adder (FA) cell we have:
Subtraction
Subtraction, mathematically is just:
But how do we transform an integer represented in binary as negative?
- Complement/Negate B
- Add 1
Or we can write it as:
One problem that occurs with the ripple adder is that, it’s an inherently slow design. needs to wait for .
Which makes the time:
Carry Select Adder
While the Ripple Carry Adder is simple, it’s quite slow. A faster type of adder is the carry select adder. It consits of ripple adders and a multiplexer (MUX). You can prove with some examples and some math that:
The time it takes for a carry select adder is
Carry Look-ahead Adders
In general, for addition, best we can achieve is , but we need to think in terms of trees.
We introduce two new signals. Carry ‘propagate’ and carry ‘generate’.
We propagate if, one of the 2 inputs is ‘1’. Then propagate the carry you received from the previous stage. If both inputs are 1, then no matter what carry-in you received, generate a carry (out).
With this we can define:
Summary
This was quite a short part, but adders are quite a simple, yet powerful concept.