Logic design of iterative binary comparator

advertisement
Logic design of iterative binary comparator
Figure 1.1 shows the block diagram of the iterative comparator. It consists of two main blocks. They
are:
1) Data compare and compress block – Function Table 1
2) Data decode block – Function table is in Table 2
A0
B0
A1
B1
A2
B2
A3
B3
Ain
A>B
Compare
Compare
Compare
Compare
Bin
Decode
A=B
A<B
Figure 1.1 : Block diagram of iterative binary comparator
The data compare and compress block
The truth table of the data compress block is given in Table Error! No text of specified style in
document.-1
Table Error! No text of specified style in document.-1 : Truth table of data compare
and compress block
Binary Number 1
Ai
Bi
0
0
0
1
1
0
1
1
0
0
0
1
1
0
1
1
0
0
0
1
1
0
1
1
0
0
0
1
1
0
1
1
Binary Number 2
(Ain)i
(Bin)i
0
0
0
0
0
0
0
0
0
1
0
1
0
1
0
1
1
0
1
0
1
0
1
0
1
1
1
1
1
1
1
1
A=B
A<B
A>B
X
Y
1
0
0
0
0
1
0
0
0
0
1
0
0
0
0
1
0
0
0
0
1
0
0
0
1
1
0
0
1
1
1
0
0
1
1
1
0
0
1
1
0
0
0
1
0
0
0
0
0
1
1
1
0
0
1
1
0
0
0
1
0
0
0
0
0
0
0
0
1
0
0
0
1
1
0
0
1
1
1
0
Outputs X and Y can be computed and as:
X = Sum of Min Terms (4, 8, 9, 12, 13, 14)
The simplified Boolean expression obtained from the K-map is given by:
X = (A0 and not(B0)) or (A1 and not(B0) and not(B1)) or (A0 and A1 not(B0))
Y = Sum of Min Terms (1, 2, 3, 6, 7, 11)
The simplified Boolean expression obtained from the K-map is given by:
Y = (not(A0) and B0) or (not(A0) and not(A1) and B1) or (not(A1) and B0 and B1)
Table 2 : Function table of data compress block
A
0
0
1
1
B
0
1
0
1
X
0
0
1
0 (d)
Y
0
1
0
0 (d)
Function
A=B
A<B
A>B
Don’t care
The block has two inputs and two outputs.
The logic function implemented by the block is:
1. When the two inputs are equal (i.e. either both are ‘0’, “AB = 00”, or both are ‘1’, “AB=11”) then
the output is “XY = 00”
2. When A is greater than B (i.e. “AB = 10”) then the output is “XY = 01”
3. When A is less than B (i.e. “AB = 01”) then the output is “XY = 10”
The data decode block
The block has two inputs and three outputs.
The logic function implemented by the block is:
1. When the two inputs are “00” then the output is “100” expanded code for X = Y
2. When the two inputs are “01” then the output is “001” expanded code for X > Y
3. When the two inputs are “10” then the output is “001” expanded code for X < Y
Table Error! No text of specified style in document.-2 : Function table of data decode
block
X
0
0
1
1
Y
0
1
0
1
F(X = Y)
1
0
0
d
F(X > Y)
0
0
1
D
F(X < Y)
0
1
0
D
Function
X=Y
X<Y
X>Y
X=Y, Don’t care
Note: d = don’t care condition. If needed can be used for logic minimization.
The compressed X and Y outputs are also used for cascading several compare blocks to form a higher
bit comparator. Data compression reduces inter connect from stage to stage. It also reduces the number
of flip flops required in case pipelining is done to speed up the design. Both the critical path length
and the delay of the comparator are proportional to the number of comparator bits.
Download