Professional Documents
Culture Documents
Digital Logic & Processors
Digital Logic & Processors
Session 4
Design concepts of ALU – Logic Unit
Bit-wise operations
1 0 1 1 1 0 1 1 1 0 1 1
AND 1 1 1 0 OR 1 1 1 0 XOR 1 1 1 0
1 0 1 0 1 1 1 1 0 1 0 1
07/21/2021 3
Logic unit of ALU
A logic unit supports different logical
functions on two multi-bit inputs X and Y,
producing an output G.
S1 S0 Output M
0 0 G i = X iY i U
X
0 1 Gi = Xi + Yi
1 0 Gi = Xi Yi
1 1 G i = X i’
This abbreviated table shows four
possible functions and assigns a
selection code S to each.
Again, we need one multiplexer for each
bit of X and Y.
07/21/2021 4
ALU Design
07/21/2021 5
Design of Magnitude comparator
Data comparison is needed in
digital systems while
performing arithmetic or logical
operations.
This comparison determines
whether one number is greater
than, equal, or less than the
other number.
A magnitude digital comparator
is a combinational circuit that
compares two digital or binary
numbers (consider A and B)
and determines their relative
magnitudes in order to find out
whether one number is equal,
less than or greater than the
other digital number.
07/21/2021 Source: 6
1-Bit Comparator
A comparator used to compare two bits, i.e., two numbers each of
single bit is called a single bit comparator. It consists of two inputs for
allowing two single bit numbers and three outputs to generate less
than, equal and greater than comparison outputs.
Truth Table
Input Output
Y Y Y
A B (A=B) (A>B) (A<B)
0 0 1 0 0
0 1 0 0 1
1 0 0 1 0
1 1 1 0 0
07/21/2021 7
1-Bit Comparator Logic Diagram
A B AB
A B AB AB ( AB AB )
A B AB
Logic Diagram
8
2-Bit Comparator
TRUTH TABLE
BLOCK DIAGRAM
07/21/2021 9