2,740 views
1 votes
1 votes
If the word size is 16 bit, then ~0xc5 will be:

(a) 0x3a

(b) 0xff3a

(c) 0x5c

(d) None of the above

1 Answer

Best answer
4 votes
4 votes
0x stands for hexadecimal notation . We know that a hexidecimal digit has 4 binary digit as its equivalent.But word size given = 16 bits and no of digits given is 2 only.So we have to precede this by 2 0's in hexadecimal so that we get 16 bit word.

Hence 0x C5 = 0x 00C5

Now not operation is performed on this hence we invert all the bits in the binary representation of the above number.

Binary representation of the given number is : 0000 0000 1100 0101

So the complement (not operator result) will be : 1111 1111 0011 1010

This can be written in hexadecimal as : 0x FF3A

 

Hence B) is the correct option.
selected by

No related questions found