CSci HW 3.7

2
Meghan Barrett Professor Farian Computer Science 114 7 March 2014 Base Conversions and Pg 164 Qs 1, 3, 4, 6, 10 Convert 31 into base 2: 11111 Convert 16 into base 2: 10000 Convert 1000 into base 10: 8 Convert 1111 into base 10: 15 Question 1: what is the value of the 8-bit binary quantity 10101000 if it is interpreted a) as an unsigned integer, and b) as a signed integer represented in sign/magnitude notation? Answer (unsigned): 168 Answer (signed): - 40 Question 3: What do the signed integers -300 and +254 look like in binary using 10 bits and sign/magnitude integer representation. Answer (-300): 1100101100 Answer (+254): 0011111110 Question 4: What is the magnitude of the 8-bit binary quantity 1 0010111 when it is interpreted as a sign/magnitude integer? Answer: - 23 Question 6: Perform the following 5-bit binary addition showing the carry bit that propagated to each column. Assume the numbers are unsigned binary quantities. Carry: 1110 01110 + 01011 Answer: 11001 Question 10: Explain exactly what happens when you perform addition on the following to sign/magnitude integer values.

description

Stuff

Transcript of CSci HW 3.7

Meghan BarrettProfessor FarianComputer Science 1147 March 2014Base Conversions and Pg 164 Qs 1, 3, 4, 6, 10Convert 31 into base 2: 11111Convert 16 into base 2: 10000Convert 1000 into base 10: 8Convert 1111 into base 10: 15Question 1: what is the value of the 8-bit binary quantity 10101000 if it is interpreted a) as an unsigned integer, and b) as a signed integer represented in sign/magnitude notation?Answer (unsigned): 168Answer (signed): - 40Question 3: What do the signed integers -300 and +254 look like in binary using 10 bits and sign/magnitude integer representation.Answer (-300): 1100101100Answer (+254): 0011111110Question 4: What is the magnitude of the 8-bit binary quantity 1 0010111 when it is interpreted as a sign/magnitude integer?Answer: - 23Question 6: Perform the following 5-bit binary addition showing the carry bit that propagated to each column. Assume the numbers are unsigned binary quantities.

Carry: 1110 01110 + 01011 Answer: 11001Question 10: Explain exactly what happens when you perform addition on the following to sign/magnitude integer values. 00111 (+7) + 01110 (+14) If you add these two numbers ignoring the fact that they have signs you get 10101 (which is -5 in sign, magnitude and obviously wrong. If you add them after removing the sign indicator (leftmost 0) then you still get 10101 but this time it is equal to + 21 which is correct.