6. Show how each of the following signed, decimal integers would be stored in 16-bit two's complement format. Give your answer in hexadecimal. a. 431693 € 41024 8. +32767 1 32767 b. -252 f. h -1024 -32768
The number system uses a base and digit or symbol to represent a number. If the base of a number system is 'n' then the digit will be '0' to 'n-1'.
Decimal Number System:
The base of the decimal number system is 10 and this number system uses the digits 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9.
Hexadecimal Number System:
The base of the hexadecimal number system is 16 and this number system uses the digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F.
For decimal to hexadecimal conversion, we need to divide the decimal number by base value(16) and write the remainder in the reverse order. When we divide a number by 16 then the remainder will be 0 to 15 only. The digit 0 to 9 are written as it is and the digit 10, 11, 12, 13, 14, and 15 are replaced with A, B, C, D, E, and F respectively.
a.
The given decimal number is = 31693
The equivalent hexadecimal number in 16 bits will be = 0x 7BCD
b.
The given decimal number is = -252
The equivalent hexadecimal number in 16 bits will be = 0x FF04
c.
The given decimal number is = 1024
The equivalent hexadecimal number in 16 bits will be = 0x 0400
d.
The given decimal number is = -1024
The equivalent hexadecimal number in 16 bits will be = 0x FC00
Step by step
Solved in 2 steps