* Exercise #1: 1. Convert hex 1B41 into binary: 1h = 0001b Bh = 1011b 4h = 0100b 1h = 0001b answer: 0001 1011 0100 0001 (the leading 0's aren't necessary, since this is math and not computer arithmetic - no data size was specified) 2. Convert hex 9A4 into decimal: 9 * 16^2 + 10 * 16 + 4 = 2468 3. Convert binary 1001110100111 into hex: add leading zeros: 0001 0011 1010 0111 0001b = 1h 0011b = 3h 1010b = Ah 0111b = 7h answer: 13A7 4. Convert binary 0110100 into decimal: 1*32 + 1*16 + 1*4 = 52d 5. Convert decimal 71 into binary: 71 = 64 + 4 + 2 + 1, therefore, the answer is: 1000111 (or easier: 71 = 64 + 7, which in binary is simply: 1000000 + 111) 6. Convert decimal 253 into hex: 253 = 256 - 3 256 = 2^8 = 16^2 = 1 * 16^2 + 0 * 16^1 + 0 * 16^0, meaning that in hex it's 100h Subtracting 3 we easily get the answer: FDh * Exercise #2: 1. cccc ccc 1110001 + 11010111 --------- 101001000 2. c ccc 52E12FFC + 9871AB25 --------- EB52DB21 * Exercise #3: 1. 127 is a positive number its binary representation is: 1111111 (128d - 1d) we add leading 0's to get the answer: 0000 0000 0111 1111 2. -65 is a negative number the binary value of 65 as a 16-bit value is: 0000 0000 0100 0001 (64d + 1d) take one's complement (flip): 1111 1111 1011 1110 add one to get the answer: 1111 1111 1011 1111 * Exercise #4: 1. -17 is a negative number the hex representation of 17 as a 32-bit value is: 00 00 00 11 (16d + 1d) take one's complement (flip): FF FF FF EE add one to get the answer: FF FF FF EF 2. 255 is a positive number 255 in hex is FF (the largest 1-byte, unsigned number) So the answer is simply: 00 00 00 FF * Exercise #5: 1. E6A is a negative number; let's find out its positive counterpart take one's complement (flip): 195 add one: 196 which in decimal is 1*16*16 + 9*16 + 6 = 406 answer: -406 2. 602 is a positive number the answer is simply its decimal value: 6*16^2 + 0*16^1 + 0*16^0 = 1538