arithmetic comparator

Digital 2014. 10. 9. 20:00

Comparator

Comparator compares binary numbers.

Logic comparing 2 bits: a and b

clip_image002

Magnitude Comparator

Comparator compares binary numbers

4-bit Magnitude Comparator:

Inputs: A3A2A1A0 & B3B2B1B0

Outputs: Y A>B, Y A<B, Y A=B

For each bit, let:

Si = AiBi + Ai’Bi’ = (AiBi’ + Ai’Bi)’

Si is true when Ai = Bi

For A = B, we must have:

A3=B3 and A2=B2 and A1=B1 and A0=B0

Hence, Y A=B = S3•S2•S1•S0 136

Logic For A > B

For A > B, there are 4 cases:

1. A3B3 is 10 and A2A1A& B2B1B0 can be anything:

A=1xxx, B=0xxx

2. A3=Band A2B2 is 10 and A1A0 & B1B0 can be

anything: A=11xx, B=10xx or A=01xx, B=00xx

3. A3=B3 and A2=B2 and A1B1=10 and A0B0 is xx: e.g.

A=011x, B=010x

4. A3=B3 and A2=B2 and A1=B1 and A0B0 is 10: e.g.

A=1011, B=1010

A>B=A3B3’+S3A2B2’+S3S2A1B1’+S3S2S1A0B0

Logic For A < B

For A < B, there are also 4 cases:

1) A3Bis 01 and A2A1A0 & B2B1Bcan be anything:

1. A=0xxx, B=1xxx

2) A3=Band A2B2 is 01 and A1A0 & B1B0 can be

1. anything: A=10xx, B=11xx or A=00xx, B=01xx

3) A3=B3 and A2=B2 and A1B1=01 and A0B0 is xx: e.g.

1. A=110x, B=111x

4) A3=B3 and A2=B2 and A1=B1 and A0B0 is 01: e.g.

1. A=1000, B=1001

A<B=A’B3+S3A’B2+S3S2A’ B1+S3S2S1A’ B0

4-bit Comparator Logic Circuit

clip_image004

MSI: 7485 4-bit Magnitude Comparator

clip_image006

Comparison of 4-bit Numbers

clip_image008

Comparison of 8 - bit Numbers

clip_image010

'Digital' 카테고리의 다른 글

d  (0) 2014.12.04
Memory Device를 Control 한다는 것  (0) 2014.10.19
Fan-out이란?  (1) 2014.10.12
Posted by bogus919
,