Professional Documents
Culture Documents
Unit-3
Combinational Logic
Definition
The comparator is comparison of A<B (Less than)
A
two numbers i.e. an operation Comparator A=B (Equal)
B
that determines whether one
A>B (Greater than)
number is greater than, less than,
or equal to the other number. Block Diagram of A Normalized Comparator
Single bit Comparator
Truth Table for single bit comparator
A<B
A
A B A>B A=B A<B
A=B
0 0 0 1 0
B
A>B 0 1 0 0 1
Logic Diagram
1 0 1 0 0
1 1 0 1 0
Definition
A Magnitude Comparator is a combinational circuit that compares
two numbers A and B and determines their relative magnitudes. The
outcome of the comparison is specified by three binary variables that
indicate whether A < B, A = B, or A > B.
Two-Bit Magnitude Comparator
A1 A0 B1 B0 A>B A=B A<B
0 0 0 0 0 1 0
Two-Bit Magnitude Comparator 0 0 0 1 0 0 1
0 0 1 0 0 0 1
0 0 1 1 0 0 1
0 1 0 0 1 0 0
A - A0 A1
B – B0 B1 0 1 0 1 0 1 0
0 1 1 0 0 0 1
0 1 1 1 0 0 1
A>B =Σm(4, 8, 9, 12, 13, 14)
1 0 0 0 1 0 0
A=B =Σm(0, 5, 10, 15) 1 0 0 1 1 0 0
B1’B0’ B1’B0 B1B0 B1B0’ B1’B0’ B1’B0 B1B0 B1B0’ B1’B0’ B1’B0 B1B0 B1B0’
A>B
A=B
A<B
Solution
B3 B2 B1 B0 1 0 0 0
Word -B M.S.B. L.S.B. M.S.B. L.S.B.
M.S.B.? L.S.B.?
Four-bit magnitude comparator
A3 A2 A1 A0 B3 B2 B1 B0 A>B A=B A<B
0 1 1 1 1 0 o 0 0 0 1
Answer is
First check A3 = B3
A3=0 and B3 = 1, so that A3<B3.
So no necessity to Check (a2,b2), (a1,b1), (a0,b0)
A<B
8 4 2 1 8 4 2 1
1 0 0 0 0 1 1 1
Four-bit magnitude comparator
A3 A2 A1 A0 B3 B2 B1 B0 A>B A=B A<B
1 1 0 1 1 0 o 0 1 0 0
Answer is
First check A3 B3, if it equal then
check A2, B2.
Here A2 =1 and B2=0.
so that A2>B2 A>B
No necessity to check remaining bits
Four-bit magnitude comparator
A3 A2 A1 A0 B3 B2 B1 B0 A>B A=B A<B
0 1 1 1 0 1 1 1 0 1 0
Answer is
First check A3 = B3
then Check A2=B2
then check A1=B1
then check A0=B0
A=B
Four-bit
Magnitude
Comparator