6 Give the 16bit 2s complement form of the following 8bit 2s
6. Give the 16-bit 2\'s complement form of the following 8-bit 2\'s complement numbers:
(a) OX94
(b) OXFF
(c) OX23
(d) OXBC
7. Which of the following 16-bit 2\'s complement numbers can be shortened to 8 bits and maintain their values?
(a) OX00BA
(b) OXFF94
(c) OX0024
(d) OXFF3C
8. A positive binary number is even precisely when its last digit is 0. When is a negative 2\'s complement number even?
9. Assuming a given length of 8 bits, what are the decimal values of the following signed binary numbers after being arithmetically shifted to the left by 2 bits?
(a) 11110011
(b) 01110010
(c) 00101011
(d) 11011001
State whether there is an overflow.
10. Assuming a given length of 8 bits, what are the decimal values of the following signed binary numbers after being arithmetically shifted to the right by 1 bit?
(a) 11110010
(b) 01110010
(c) 00101010
(d) 11011000
Solution
6)
16 bit 2\'s complement form of the following 8 bit 2\'s complement numbers:
(a)0x94 = 10010100
--> 2\'s complement
01101100 -----> extending to 16 bit number
---> 0000000001101100
---> 2\'s complement
----> 1111111110010100 ---->0xFF94
(b)0xFF = 11111111
--> 2\'s complement
00000001 -----> extending to 16 bit number
---> 0000000000000001
---> 2\'s complement
----> 1111111111111111 ---->0xFFFF
(c)0x23 = 0010 0011
--> 2\'s complement
1101 1101-----> extending to 16 bit number
---> 1111111111011101
---> 2\'s complement
----> 0000000000100011 ---->0x0023
(d)0xBC = 1011 1100
--> 2\'s complement
0100 0100 -----> extending to 16 bit number
---> 0000000001000100
---> 2\'s complement
----> 1111111110111100 ---->0xFFBC
-------------------------------------------------------------------------------------
7)
Trick to find whether shortening will effect or not :
16 bit MSB should be same as 8 Bit MSB
Higher 8 bits of the 16 bit number should 00 or FF
(a) 0x00BA -
higher 8 bits are 00 (second condtion is true )
MSB of 16 Bit is 0 and MSB of 8 bit is 1 (1st condition is false)
. So, it will be effected.
(a) 0xFF94 -
higher 8 bits are FF (second condtion is true )
MSB of 16 Bit is 1 and MSB of 8 bit is 1 (1st condition is true)
. So, it will be NOT EFFECTED
(c) 0x0024 -
higher 8 bits are 00 (second condtion is true )
MSB of 16 Bit is 0 and MSB of 8 bit is 0 (1st condition is True)
. So, it will be NOT EFFECTED
(d) 0xFF3C -
higher 8 bits are FF (second condtion is true )
MSB of 16 Bit is 1 and MSB of 8 bit is 0 (1st condition is false)
. So, it will be effected.

