in Digital Logic
1,315 views
2 votes
2 votes

The total number of comparisons performed in a 8-bit magnitude comparator consist of inputs A[A4, A3, A2, A1] and B[B4, B3, B2, B1] then condition for A>B is :

A 255 x 26

B 255 x 27

C 255 x 28​​​​​

D 255 x 29

in Digital Logic
1.3k views

1 Answer

2 votes
2 votes


for A > B 


=  (2 (^ (2^n) )  – 2^n )/2    (n = number of bits )
=  (2 (^ (2^8) )  – 2^8 )/2 
=  (2 (^ (16) )  – 2^8 )/2 

= ((2^8) * (2^8) – 1)  )/2 
= 128(255)
= 255 x 2^7

4 Comments

Can you explain more ?
0
0
Like what exactly question wants to ask . And what is formula you have used.
0
0

Say you have 1 bit comparator and making comparation between A and B 
 

A B A>B A<B A=B
0 0 0 0 1
0 1 0 1 0
1 0 1 0 0
1 1 0 0 1


Now see.. 

with 1 bit we get 4 encodings...2^2n

for A = B we get 2 encodings… which is 2^n

A > B and A< B will always have an equal number of encodings..observe the table above.

therefore just divide everything by 2.

All encodings after removing A = B ….

now encodings for A<B or A>B will be  → (2^2n  –  2^n)/ 2 

put 8 in place of n… (2^2*8  – 2^8) / 2

2^8(2^8 - 1)  / 2

2^7(255) – > 255 x 2^7 

 

1
1
edited by
Thank you so much bro.

But here it is given 8 bit but in question it have 4 bits in A and 4 bits in B . It means it is 4 bit comparator ???
0
0

Related questions