CS/COE 447 Quiz 4 February 12, 2007 ==================================== Q1: Represent -10 (decimal) as 8-bit sign magnitude, 1's complement, and 2's complement numbers: +10 decimal = 00001010 Sign Magnitude: 10001010 1's complement: 00001010 +10 11110101 -10, 1's complement 2's complement: 11110101 + 1 ----------- 11110110 For a check, take the 2's complement of the answer: flip: 00001001 + 1 -------- 00001010 -- this is +10, so our answer above is correct. Q2: Assuming 8-bit numbers in 2's complement, perform the following calculation. Clearly label your answer and show your work. -10 + 3 11110110 00000011 ---------- 11111001 Take 2's complement to check: 00000110 flip + 1 ---------- 00000111 = 7, so above answer is correct. Q3: Assuming 8-bit numbers in 2's complement, perform the following calculation. Clearly label your answer and show your work. -10 + -3 00000011 = 3 11111100 flip + 1 -------- 11111101 = -3 11110110 +11111101 ----------- 11110011 Take 2's complement to check: 11110011 00001100 flip + 1 --------- 00001101 = 13, so above answer is correct.