0
459views
Design 2 bit comparator
1 Answer
written 3.6 years ago by |
A1 | A0 | B1 | B0 | A>B | A=B | A |
---|---|---|---|---|---|---|
0 | 0 | 0 | 0 | 0 | 1 | 0 |
0 | 0 | 0 | 1 | 0 | 0 | 1 |
0 | 0 | 1 | 0 | 0 | 0 | 1 |
0 | 0 | 1 | 1 | 1 | 0 | 0 |
0 | 1 | 0 | 0 | 0 | 1 | 0 |
0 | 1 | 0 | 1 | 0 | 0 | 1 |
0 | 1 | 1 | 0 | 0 | 0 | 1 |
0 | 1 | 1 | 1 | 1 | 0 | 0 |
1 | 0 | 0 | 0 | 1 | 0 | 0 |
1 | 0 | 0 | 1 | 0 | 1 | 0 |
1 | 0 | 1 | 0 | 0 | 0 | 1 |
1 | 0 | 1 | 1 | 1 | 0 | 0 |
1 | 1 | 0 | 0 | 1 | 0 | 0 |
1 | 1 | 0 | 1 | 1 | 0 | 0 |
1 | 1 | 1 | 0 | 1 | 0 | 0 |
1 | 1 | 1 | 1 | 0 | 1 | 0 |
for A=B
$=\bar{A_1}\bar{A_0}\bar{B_1}\bar{B_0}+\bar{A_1}A_0\bar{B_1}B_0+A_1A_0B_1B_0+A_1\bar{A_0}B_1\bar{B_0}$
$=\bar{A_1}\bar{B_1}(A_0 \odot B_0) + A_1B_1(A_0 \odot B_0)$
$=(A_0 \odot B_0) . (A_1 \odot B_1)$
for A>B
$A_1\bar{B_1}+A_0\bar{B_1}\bar{B_0}+A_1A_0\bar{B_0}$
for A < B
$\bar{A_1}B_1+B_1B_0\bar{A_0}+\bar{A_1}\bar{A_0}B_0$