In: Computer Science
if hexadecimal number FA16 represent a signed number in signed magnitude, what the decimal representation of that number? include the sign for that number with no spaces between the number and sign. for example -3 or +3
-122 Explanation: ------------- Let's first convert FA to binary Hexadecimal Binary 0 0000 1 0001 2 0010 3 0011 4 0100 5 0101 6 0110 7 0111 8 1000 9 1001 A 1010 B 1011 C 1100 D 1101 E 1110 F 1111 Use this table to convert from hexadecimal to binary Converting FA to binary F => 1111 A => 1010 So, in binary FA is 11111010 Now, let's convert 11111010 to one's complement decimal Left most bit is 1. so, it's negative. Now, let's convert rest of the bits 1111010 to decimal Converting 1111010 to decimal 1111010 => 1x2^6+1x2^5+1x2^4+1x2^3+0x2^2+1x2^1+0x2^0 => 1x64+1x32+1x16+1x8+0x4+1x2+0x1 => 64+32+16+8+0+2+0 => 122 so, 11111010 from sign-magnitude to decimal is -122