Module 3 - Part 1
Module 3 - Part 1
Module 3 - Part 1
ON
EC 203
DIGITAL SYSTEM DESIGN
Adder/Substractor
But, An partial one bit binary addition can be performed by ignoring carry bit.
This partial one bit addition (See column 1, 2, 3 & 4 at LSB in example)
• Two inputs, two for augend and addend and
• Two outputs, for sum and carry,.
Adder, which performs partial one bit ‘partial’ binary addition is known as ‘Half Adder’
Design of Binary ADDER: Half Adder
An Half adder performs partial one bit binary addition for two input bit
It must have two inputs (augend and addend) and two outputs (sum and carry).
This circuit called ‘Half Adder’ as it can performs only partial addition
operation not complete one bit addition, as it ignores ‘input carry’.
The K map for S (SUM) and C (Carry) and resulting expression A B and A.B
Half Adder
If A and B are binary inputs to the half adder, then
• the logic function to calculate sum S is Ex -OR of A and B and
• logic function to calculate carry C is AND of A and B.
Combining these two, the logical circuit to implement the combinational circuit of
Half Adder is shown below.
Half Adder using NAND Gates
As we know that NAND and NOR are called universal gates as any logic system
can be implemented using these two
The half adder circuit can also be implemented using them.
We know the NAND only circuit of Ex-OR gate and AND gate. Same is used her.e
Figure shows the Half Adder circuit using NAND gates only.
Five NAND gates are required in order to design a half adder. The circuit to realize
half adder using NAND gates is shown below.
Half Adder using only NOR Gates
S = A’B’Cin+A’BC’in+AB’C’in+ABCin
Cout is simplified as
The signal from the input carry to the output carry propagates through an AND
gate and OR gate, which constitute two gate levels.
If there are four full adder stages, the output carry would have 2 x 4 = 8
The total propagation time in this 4-bit adder would be the propagation
time in one half adder (which is the first half adder) plus eight gate levels.
Assuming that all the different types
of gates have same propagation
delay, say T, the propagation delay
of adder can be generalized as (2n +
1) T, where n is the number of
stages. In this example, n = 4, so
the Total Delay is (2 x 4 + 1) T = 9T
Propagation Delay
Ripple Carry Adders
Total Delay is (2 x 4 + 1) T = 9T
Gate Delay in Ripple-Carry Adder
Ripple carry Adder are slow. There is a very long path from A0, B0, Cin to
Cout and S3
In a 32-bit ripple-carry adder, there are 32 full adders, so the critical path
(worst case) delay is 1 (from input to carry in first adder) + 31 * 2 (for
carry propagation in later adders) = 63 gate delays
For an n bit ripple adder, the longest path has 2n+1 gates
To Reduce Delay Ripple-Carry Adder
Carry-look-ahead adder
Since all other arithmetic operations are implemented by successive
additions, the time consumed during addition process is very critical.
For fast applications, a better design is required. The carry-look-ahead
adder solves this problem by calculating the carry signals in advance,
based on the input signals.
Method for Fast Carry Generation
Method to compute Fast Carry Generation
Method to compute Fast Carry Generation
Logic Circuit for Fast Carry Generation
Method to compute Fast Carry Generation
Logic Circuit for Carry-Look-Ahead Adder
Serial binary adder
The serial binary adder or bit-serial adder is a digital circuit that
performs binary addition bit by bit.
The serial full adder has three single-bit inputs for the numbers to be added
and the carry in. There are two single-bit outputs for the sum and carry out.
The carry-in signal is the previously calculated carry-out signal. The
addition is performed by adding each bit, lowest to highest, one per clock
cycle.
Serial binary addition is done by a flip-flop and a full adder.
The flip-flop takes the carry-out signal on each clock cycle and provides its
value as the carry-in signal on the next clock cycle.
After all of the bits of the input operands have arrived, all of the bits of the
sum have come out of the sum output.
Serial adder
Difference between serial and parallel adder
Serial adder:
1) Slower
2) It uses shift registers
3) It requires one full adder circuit.
4) It is sequential circuit.
5) Time required for addition depends on number of bits.
Parallel adder:
1) Faster
2) It uses registers with parallel load capacity
3) Number of full adder circuit is equal to no. of bits in binary
adder.
4)It is a combinational circuit
5)Time required does not depend on the number of bits
Half Subtractor
The half subtractor is a combinational circuit which is used to perform
subtraction of two bits.
It has two inputs, the minuend Ai and subtrahend Bi and two outputs the
Cout = A’i Bi
This is an important distinction to make since subtraction itself is not
commutative, but the difference bit D is calculated using an XOR gate which
is commutative.
Half Subtractor
Ai Bi D C1
0 0 0 0 A’B’ D =(Ai Bi)
0 1 1 1 A’B
1 0 1 0 A B’
1 1 0 0 A B
C1=(A’i Bi)
A D D =(Ai Bi)
B
C1
C1=(A’i Bi)
Full Subtractor
The full subtractor is a combinational circuit which is used to perform subtraction of
three input bits: the minuend Ai, subtrahend Bi, and borrow in Cin .
The full subtractor generates two output bits: the difference D and borrow out Cout.
Or in symbols: Ai – Bi – Cin
Like the half subtractor, the full subtractor generates a borrow out when it needs to
borrow from the next digit.
Since we are subtracting Bi and Cin by Ai, a borrow out needs to be generated
Ai Di
Bi
C i+1
half subtractor
half subtractor
Mode Controlled Full Adder/Subtractor
Controlled Full Adder/Subtractor
Ci
Ai Di
Bi
i+
C1
E
E = 0: Full adder
E = 1: Full subtractor
X-OR Gate as NOT Gate
N-Bit Adder/Subtractor
4-bit Subtractor: E = 0
A3 B3 A2 B2 A1 B1 A0 B0
C4 SD 3 SD 2 SD 1 SD 0
For
E = 0: 4-bit adder
E = 1: 4-bit subtractor
4-bit Subtractor: E = 1
A3 B3 A2 B2 A1 B1 A0 B0
C4 SD 3 SD 2 SD 1 SD 0
48
BCD (Decimal) adder
Decimal numbers should be represented in binary code number.
Suppose we apply two BCD numbers to a binary adder then:
The result will be in binary and ranges from 0 through 19.
Let Binary sum: K(carry) Z8 Z4 Z2 Z1
and BCD sum: C(carry) S8 S4 S2 S1
For numbers equal or less than 1001 binary and BCD are identical.
For numbers more than 1001, we should add 6(0110) to binary to
get BCD.
example: 10011(binary 19)
+110 (ADD 6 to correct)
------------------
11001(BCD) =19
.
49
BCD (Decimal) adder
Direct (Binary sum) (BCD converted sum)
K P 3 P2 P1 P0 C S 3 S2 S1 S0
• We can obtain the sums
0 0 0 0 0 0 0 0 0 0
in two stages. 0 0 0 0 1 0 0 0 0 1
0 0 0 1 0 0 0 0 1 0
0 0 0 1 1 0 0 0 1 1
• First, list all possible 0 0 1 0 0 0 0 1 0 0
outputs from the direct 0
0
0
0
1
1
0
1
1
0
0
0
0
0
1
1
0
1
1
0
sum of the decimal 0 0 1 1 1 0 0 1 1 1
0 1 0 0 0 0 1 0 0 0
digits, then ….. 0 1 0 0 1 0 1 0 0 1
0 1 0 1 0 1 0 0 0 0
• Beside each sum place 0 1 0 1 1 1 0 0 0 1
the expected values of 0 1 1 0 0 1 0 0 1 0
0 1 1 0 1 1 0 0 1 1
the sum bits and the 0 1 1 1 0 1 0 1 0 0
carry out bit. 0 1 1 1 1 1 0 1 0 1
1 0 0 0 0 1 0 1 1 0
1 0 0 0 1 1 0 1 1 1
1 0 0 1 0 1 1 0 0 0
1 0 0 1 1 1 1 0 0 1
BCD (Decimal) adder
K P 3 P2 P1 P0 C S 3 S2 S1 S0
• The first-stage sums
divide into two groups: 0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
1
0 0 0 1 0 0 0 0 1 0
0 0 0 1 1 0 0 0 1 1
– the first ten sums 0 0 1 0 0 0 0 1 0 0
produce the correct 0 0 1 0 1 0 0 1 0 1
final sum and carry 0 0 1 1 0 0 0 1 1 0
0 0 1 1 1 0 0 1 1 1
bit patterns 0 1 0 0 0 0 1 0 0 0
0 1 0 0 1 0 1 0 0 1
• 98 = 1001 1000
• 89= 1000 1001
•
• 1 0010 0001= 121
• 0110 0110
• 1 1000 0111
•
BCD (Decimal) adder
K P 3 P2 P1 P0 C S 3 S2 S1 S0
0 1 0 1 0 1 0 0 0 0
– the last ten sums 0 1 0 1 1 1 0 0 0 1
are all incorrect by 0 1 1 0 0 1 0 0 1 0
the same amount, 0 1 1 0 1 1 0 0 1 1
0 1 1 1 0 1 0 1 0 0
they should have 0 1 1 1 1 1 0 1 0 1
6 added to them to
1 0 0 0 0 1 0 1 1 0
produce the correct 1 0 0 0 1 1 0 1 1 1
final bit patterns. 1 0 0 1 0 1 1 0 0 0
1 0 0 1 1 1 1 0 0 1
BCD (Decimal) adder
K P 3 P2 P1 P0 C S 3 S2 S1 S0
0 1 0 1 0 1 0 0 0 0
– the last ten sums 0 1 0 1 1 1 0 0 0 1
are all incorrect by 0 1 1 0 0 +6= 1 0 0 1 0
the same amount, 0 1 1 0 1 1 0 0 1 1
0 1 1 1 0 1 0 1 0 0
they should have 0 1 1 1 1 1 0 1 0 1
6 added to them to
1 0 0 0 0 1 0 1 1 0
produce the correct 1 0 0 0 1 1 0 1 1 1
+6=
final bit patterns. 1 0 0 1 0 1 1 0 0 0
1 0 0 1 1 1 1 0 0 1
BCD (Decimal) adder
K P 3 P2 P1 P0 C S 3 S2 S1 S0
• The condition used to
0 0 0 0 0 0 0 0 0 0
identify and control the 0 0 0 0 1 0 0 0 0 1
correction process is 0 0 0 1 0 0 0 0 1 0
0 0 0 1 1 0 0 0 1 1
expressed in terms of 0 0 1 0 0 0 0 1 0 0
the carry-out bit, C: 0 0 1 0 1 0 0 1 0 1
0 0 1 1 0 0 0 1 1 0
0 0 1 1 1 0 0 1 1 1
C = K + P3 P2 + P3 P1 0 1 0 0 0 0 1 0 0 0
0 1 0 0 1 0 1 0 0 1
0 1 0 1 0 1 0 0 0 0
0 1 0 1 1 1 0 0 0 1
0 1 1 0 0 1 0 0 1 0
0 1 1 0 1 1 0 0 1 1
0 1 1 1 0 1 0 1 0 0
0 1 1 1 1 1 0 1 0 1
1 0 0 0 0 1 0 1 1 0
1 0 0 0 1 1 0 1 1 1
1 0 0 1 0 1 1 0 0 0
1 0 0 1 1 1 1 0 0 1
BCD (Decimal) adder
K P 3 P2 P1 P0 C S 3 S2 S1 S0
• The condition used to
0 0 0 0 0 0 0 0 0 0
identify and control the 0 0 0 0 1 0 0 0 0 1
correction process is 0 0 0 1 0 0 0 0 1 0
0 0 0 1 1 0 0 0 1 1
expressed in terms of 0 0 1 0 0 0 0 1 0 0
the carry-out bit, C: 0 0 1 0 1 0 0 1 0 1
0 0 1 1 0 0 0 1 1 0
0 0 1 1 1 0 0 1 1 1
C = K + P3 P2 + P3 P1 0 1 0 0 0 0 1 0 0 0
0 1 0 0 1 0 1 0 0 1
0 1 0 1 0 1 0 0 0 0
• Thus, if C = 0 then no 0 1 0 1 1 1 0 0 0 1
correction is applied. 0 1 1 0 0 1 0 0 1 0
0 1 1 0 1 1 0 0 1 1
0 1 1 1 0 1 0 1 0 0
0 1 1 1 1 1 0 1 0 1
1 0 0 0 0 1 0 1 1 0
1 0 0 0 1 1 0 1 1 1
1 0 0 1 0 1 1 0 0 0
1 0 0 1 1 1 1 0 0 1
BCD (Decimal) adder
K P 3 P2 P1 P0 C S 3 S2 S1 S0
• The condition used to
0 0 0 0 0 0 0 0 0 0
identify and control the 0 0 0 0 1 0 0 0 0 1
correction process is 0 0 0 1 0 0 0 0 1 0
0 0 0 1 1 0 0 0 1 1
expressed in terms of 0 0 1 0 0 0 0 1 0 0
the carry-out bit, C: 0 0 1 0 1 0 0 1 0 1
0 0 1 1 0 0 0 1 1 0
0 0 1 1 1 0 0 1 1 1
C = K + P3 P2 + P3 P1 0 1 0 0 0 0 1 0 0 0
0 1 0 0 1 0 1 0 0 1
0 1 0 1 0 1 0 0 0 0
• Thus, if C = 0 then no 0 1 0 1 1 1 0 0 0 1
correction is applied. 0 1 1 0 0
+6=
1 0 0 1 0
0 1 1 0 1 1 0 0 1 1
0 1 1 1 0 1 0 1 0 0
• If C = 1, then 6 is added 0 1 1 1 1 1 0 1 0 1
Decides to add 6?
Adds 6
58
BCD adder
Multiplexers
Multiplexer is a general circuit that produces a single output signal for n
number of input signals
– The output is equal to one of several input signals to the circuit
– The multiplexer selects which input signal is used as an output signal
based on the value represented by a few more input signals, called
select signals or select control lines
– The control lines S0, S1, and S2 determine which of eight other input
lines (D0 through D7) are routed to the output (F)
8:1 Multiplexers