Carry Look Ahead Adder, ALU, Encoders and Decoders
JasonPulikkottil
62 views
23 slides
Jul 25, 2024
Slide 1 of 23
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
About This Presentation
Ripple-carry adders are slow due to the cumulative
propagation time of carry in different stages
Delay proportional to the number of bits.
• ALU stands for: Arithmetic Logic Unit
• An arithmetic logic unit (ALU) is a digital circuit
used to perform arithmetic and logic operations.
• It repres...
Ripple-carry adders are slow due to the cumulative
propagation time of carry in different stages
Delay proportional to the number of bits.
• ALU stands for: Arithmetic Logic Unit
• An arithmetic logic unit (ALU) is a digital circuit
used to perform arithmetic and logic operations.
• It represents the fundamental building block of the
central processing unit (CPU) of a computer
• Examples of arithmetic operations are addition,
subtraction, multiplication, and division etc.
• Examples of logic operations are comparisons of
values such as NOT, AND, and OR etc.
Size: 1.2 MB
Language: en
Added: Jul 25, 2024
Slides: 23 pages
Slide Content
N Bit Adders
A 16-bit ripple-carry adder
Cout of one adder is connected to Cin of the next stage.
These are called ripple-carry adders
Ripple-carry adders are slow due to the cumulative
propagation time of carry in different stages
Delay proportional to the number of bits
S
i = A
i
⊕ B
i
⊕C
i-1= P
i
⊕ C
i-1 [P
i
= A
i
⊕ B
i ]
C
i
= A
iB
i + (A
i
⊕ B
i )C
i-1 = G
i
+ P
iC
i-1 [G
i
= A
iB
i ]
Time delay = 3τ = (2n +1)
Carry look ahead adder
–Eliminate the delay of ripple-carry adders
–Carry-in’s are generated independently
carry signal will be generated in two cases:
1. if both bits A
i
and B
i are 1
2. if either A
i or B
i is 1 and the carry-in C
i
is 1
The Propagate P and generate G in a full-adder, is
given as:
•P
i
= A
i
⊕ B
i Carry propagate
•G
i
= A
iB
i Carry generate
Carry look ahead adder
• The new expressions for the output sum and the carryout
are given by:
•S
i = A
i
⊕ B
i
⊕C
i-1= P
i
⊕ C
i-1 [P
i
= A
i
⊕ B
i ]
•C
i
= A
iB
i + (A
i
⊕ B
i )C
i-1 = G
i
+ P
iC
i-1 [G
i
= A
iB
i ]
Let's apply these equations for a 4-bit adder
•C
0
= G
0 + P
0C
-1
•C
1
= G
1
+ P
1C
0
= G
1
+ P
1(G
0
+ P
0C
-1) = G
1
+ P
1G
0
+ P
1P
0C
-1
•C
2
= G
2
+ P
2C
1
= G
2
+ P
2G
1
+ P
2 P
1G
0
+ P
2P
1P
0C
-1
•C
3
= G
3
+ P
3C
2
= G
3
+ P
3G
2
+P
3P
2G
1
+P
3P
2 P
1G
0
+
P
3P
2P
1P
0C
-1
These expressions show that C
1, C
2 and C
3 do not depend on
its previous carry-in
Carry look ahead adder
•In general, the i
th.
carry output is expressed in the
form C
i
= F
i
(Pi’s, Gi’s , C
-1)
•In other words, each carry signal is expressed as a
direct SOP function of C
-1
( carry input of first
stage)rather than its preceding carry signal.
•Since the Boolean expression for each output
carry is expressed in SOP form, it can be
implemented in two-level circuits.
•The 4-bit carry look-ahead (CLA) adder consists of
3 levels of logic:
Carry look ahead adder
•First level: Generates all the P & G signals. Four sets of P & G logic
(each consists of an XOR gate and an AND gate).
P
i
= A
i
⊕ B
i G
i
= A
iB
i
Output signals of this level (P’s & G’s) will be valid after 1τ
•Second level: The Carry Look-Ahead (CLA) logic block generates
the carry signals (C
0,C
1, C
2 and C
3) which consists of four 2-level
implementation logic circuits
C
i
= A
iB
i + (A
i
⊕ B
i )C
i-1 = G
i
+ P
iC
i-1
Output signals of this level (C
0,C
1, C
2 and C
3) will be valid after 3τ
•Third level: Four XOR gates generate the sum signals (S
i)
S
i = P
i ⊕ C
i
•Output signals of this level (S
0, S
1, S
2 and S
3) will be valid after 4τ
Carry look ahead adder
•Thus, the 4 Sum signals (S
0, S
1, S
2 & S
3) will all be
valid after a total delay of 4τ compared to a delay
of (2n+1)τ for Ripple Carry adders
•For a 4-bit adder (n = 4), the Ripple Carry adder
delay is 9τ
•The disadvantage of the CLA adders is that the
carry expressions (and hence logic) become quite
complex for more than 4 bits
•Thus, CLA adders are usually implemented as 4-
bit modules that are used to build larger size
adders
ALU
•ALU stands for: Arithmetic Logic Unit
•An arithmetic logic unit (ALU) is a digital circuit
used to perform arithmetic and logic operations.
•It represents the fundamental building block of the
central processing unit (CPU) of a computer
•Examples of arithmetic operations are addition,
subtraction, multiplication, and division etc.
• Examples of logic operations are comparisons of
values such as NOT, AND, and OR etc.
In figure-1, the 1x2 selector on the left is as a mode selector to
select one of the two units i.e. either the arithmetic unit or the
logical unit.
The function select lines are then used to select one of the many
functions of arithmetic or the logical type
Block Diagram of ALU
Typical Schematic Symbol of an ALU
A and B: the inputs to the ALU
R: Output or Result
F: Code or Instruction from the
Control Unit
D: Output status; it indicates cases
such as:
•carry-in
•carry-out,
•division-by-zero
•And . . .
1-Bit ALU
This is an one-bit ALU which can do Logical AND and Logical OR
operation.
Result = a AND b when operation = 0
Result = a OR b when operation = 1
The operation line is the input of a MUX.
Adding one more operation- one full adder to the
previous ALU
1-Bit ALU
Simple block diagram
Encoder/Decoder
ENCODER- a digital circuit that produces a binary output code
depending on which of its inputs are activated.
DECODER- a digital circuit that converts an input binary code
into a single numeric output. A
0
A
1
A
2
A
3
A
4
A
5
A
6
A
7
ENCODER
O
0
O
1
O
2 A
0
A
1
A
2
O
0
O
1
O
2
O
3
O
4
O
5
O
6
O
7
DECODER
Only one input activated at a time
Binary coded output
Binary coded input
Only one output activated at a time
Encoder
•The process of converting from familiar symbols or
numbers to a coded format is called encoding.
•ENCODER- a digital circuit that produces a binary
output code depending on which of its input is
activated
The figure below shows the truth table of an Octal-to-binary encoder.
Table 3: Truth Table of octal to binary encoder
Octal to binary encoder
•Octal-to-Binary take 8 inputs and provides 3 outputs
• At any one time, only one input line has a value of 1
Truth Table of octal to binary encoder is given below
Y0 = I1 + I3 + I5 + I7
Fig 4: Logic Diagram of octal to binary encoder
Y0 = I1 + I3 + I5 + I7
Y1= I2 + I3 + I6 + I7
Y2 = I4 + I5 + I6 +I7
Logic Diagram of octal to binary encoder
Octal to binary encoder
Decoder
A decoder is a logic circuit that accepts a set of inputs
that represents a binary number and activates only
the output that corresponds to the input number
Decoders (2 to 4 line)
2-to-4-Line Decoder -Active low output
3-line-to-8-line (1-of-8) Decoder/
Binary to octal decoder
23
BCD -to- Decimal decoders
•The BCD- to-decimal decoder converts each BCD code into
one of Ten decimal digit indications.
• It is frequently referred as a 4-line -to- 10 line decoder
•The method of implementation is that only ten decoding
gates are required because the BCD code represents only the
ten decimal digits 0 through 9.
•Each of these decoding functions is implemented with NAND
gates to provide active -LOW outputs. If an active HIGH
output is required, AND gates are used for decoding