2,947 views
1 votes
1 votes

2 Answers

Best answer
6 votes
6 votes
We have 4 bits for A and B.

Total number of combinations = $2^4 \times 2^4 = 256$.

No. of ways in which both the 4 bits are same $= 2^4 = 16$ since, for each combination of A, we have one corresponding combination of B possible.

Now, the answer is simple - $\frac{256-16}{2} = 120$, and here we just have to use the rule of symmetry - $A$ and $B$ are similar and so no. of combinations for $A >B$ should be same as that for $B > A$.
selected by
3 votes
3 votes

we have two 4 bit numbers, then for comparing we have to calculate all 8 bits from both numbers.

There fore total Combinatnions of i/p will become = 22*4  = 256.

It is known that, there are 2 combinations for which the bits are equal,

then remaining combinations are equally divided in which A > B and A < B.

Therefore remaining combinations are 256 - 16 = 240.

Since there are equal number of combinations for A > B and A < B,

then number of combinations for which A > B = 240 / 2 = 120.

Hence A is correct.

In General,

If there are two n bit numbers, then 

there are 2n combinations for which numbers are equal, and 

A > B ,combinations will be = 22n - 2n  /  2

Please correct me if i am Wrong.

Answer:

Related questions

0 votes
0 votes
0 answers
1
atul_21 asked Jun 20, 2017
259 views
#
3 votes
3 votes
1 answer
3
Shubhanshu asked Aug 5, 2017
1,020 views
Draw the diagram which shows the mechanism of fetching the data in 2-way set associative mapping using multiplexer, comparator, and encoder?
2 votes
2 votes
1 answer
4
bahirNaik asked Jan 11, 2016
3,935 views