DLD LAB EXP 05 (Design of A 1 Bit Comparator Block Using Basic Gates and Design of N Bit Comparator Using 1 Bit Comparator Block) - ACS
DLD LAB EXP 05 (Design of A 1 Bit Comparator Block Using Basic Gates and Design of N Bit Comparator Using 1 Bit Comparator Block) - ACS
Design of a 1 bit comparator block using basic gates and design of n bit comparator using 1 bit
comparator block.
Abstract:
A digital comparator or magnitude comparator is a hardware electronic device that takes two
numbers as input in binary form and determines whether one number is greater than, less than or
equal to the other number. Comparators are used in central processing units (CPUs) and
microcontrollers (MCUs). Examples of digital comparator include the CMOS 4063 and 4585 and
the TTL 7485 and. Comparators are one of the basic parts of digital electronics. First we studied
about the design of a comparator block and its condition for output. Then we implemented a 1 bit
and 2 bit comparator block using basic gates and comparator IC. The main objective of this
experiment is to learn the design and behavior of Comparator circuits.
Theory:
Magnitude Comparators are combinational logic circuits that take 2 sets of data as its inputs and
tests whether the value represented by one binary word is greater than, less than, or equal to the
value represented by another binary word.
Depending on the input combination for a 1-bit magnitude comparator, following behavior table
can be developed using the logic expressions
For A=B,
If (A2=B2) & (A1=B1) & (A0=B0), then (A=B);
For A>B,
If (A2>B2) then (A>B) or
If (A2=B2) & (A1>B1) then (A>B) or
If (A2=B2) & (A1=B1) & (A0>B0), then (A>B);
For A<B,
If (A2<B2) then (A<B) or
If (A2=B2) & (A1<B1) then (A<B) or
If (A2=B2) & (A1=B1) & (A0<B0), then (A<B)
Apparatus:
A3 B3 A2 B2 A1 B1 A0 B0 A= A>B A<B
B
1 0 1 1 0 1 0 0 0 1 0
1 1 0 1 1 0 1 1 0 0 1
1 0 0 1 1 1 0 0 0 1 0
1 1 0 0 1 1 0 0 1 0 0
Discussion:
Comparator is one of the basic parts of digital electronics. Designing a comparator is very easy
and important. By analyzing theoretical and practical data it can be said that both the data is
same. . The advantage of these comparator circuits are low power consumption, a high degree of
regularity and simplicity. By using 1 bit comparator block one can design n number of bit
comparator. Finally, the experiment was successful by designing and implementing the
magnitude comparator block circuits.
Question answer:
1. 5 bit comparator block using 1 bit block
U1:A U2:A
1 2 1
0 3
2
7404
7408 U3:A
2
1
3
U2:B 7402
U1:B 4
6
3 4 5
1
7408 U6:C
7404
9
8
10
U1:C U2:C
7408
5 6 9
0 8
10
7404 U3:B
7408 5
4
6
7402
U2:D U11:A
A<B
U1:D 12 1
11 3
13 12 13 2
1
7408 7408 U9:D
7404 U6:D 12
12 11
11 13 1
13
7432
U1:E U4:A
7408
U10:D
11 10 1 12
0 3 11
2 13
7404 U3:C
7408 8
10
7408 A=B
9
U10:C
7402 9 0
U4:B U10:B 8
U1:F 4 4 10 U9:C
6 6 9
9 8 5 5 7408 8
1 10
7408 7408
7404 U8:A 7432
1
3 U11:D
U10:A 2 12
U5:A U4:C
1 11
3 7408 13
1 2 9 2
0 8 7408
10 7408
7404 U3:D
7408 11 U9:B
13 4
12 6
5 U11:C
U4:D U8:D
A>B
7402 9
U5:B 12 12 7432 8
U12:C
11 11 10
3 4 13 13 9 U12:D
1 U8:C 7408 8 12
7408 9 7408 10 11
7404
8 13 0
10 7432
7432
7408
U8:B
U5:C U9:A 4
U6:A 1 6
5 6 1 3 5
0 3 2
2 7408 U12:B
7404
7432 4 U13:A
7408 U7:A 6 1
2 5 3
1 2
3 7432
7408
7402 U12:A
U6:B 1
U5:D 4 3
6 2
13 12 5
1 U11:B 7432
7408 4
7404
6
5
7408
U5:A
U1:A U2:A
1
3
1 2 1 2 1
0 3
2 74HC32
74HC04 U3:A
74HC08 2
1
3 U4:B
4
74HC02 6
U2:B 5
U1:B 4
6 74HC08
3 4 5 U4:A
1 1
74HC08 3
74HC04
2 0
74HC08
U1:C U2:C
5 6 9
0 8
10
74HC04
74HC08 U3:B U4:C
5 9
4 8
6 10
74HC02 74HC08
U2:D
U1:D 12
11
13 12 13 U5:B
1 4
74HC08 6
74HC04
5 0
74HC32