Tables CSCI 201L Jeffrey Miller, Ph.D. HTTP :// WWW - SCF. USC. EDU /~ CSCI 201 USC CSCI 201L.
CSci HW 3.7
-
Upload
meghan-barrett -
Category
Documents
-
view
7 -
download
0
description
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.