Tuesday, January 28, 2014

signed magnitude


  • 3. Represent the decimal number 107 in binary using 8-bit signed magnitude, one's complement and two's complement form.

c) Signed magnitude  01101011

    One’s complement  01101011

    Two’s complement  01101011

2. Convert the fractional decimal number 190.03125 to binary with a maximum of six places to the right of the binary point.

a) 10111110.00001

1. What are the values of X, Y and Z.

d) X=120101, Y=4266, Z=832

4. If the maximum positive number that can be represented in two's complement form is y, how many bits are used in this representation?

e) 1 + log2(y+1)

5. Given a (very) tiny computer that has a word size of 6 bits, what are the smallest negative number and the largest positive number that this computer can represent in two’s complement form?

d) Smallest Negative: (100000)2, Largest Positive: (011111)2

6. A 10-bit floating point number has 1 bit for the sign of the number, 3 bits for the exponent and 6 bits for the mantissa (which is normalized). Numbers in the exponent are in two’s complement representation. No bias is used and there are no implied bits. Show the representation for the smallest positive number this machine can representation
e) 0100100000

7. Given that the ASCII code for the character "A" is 1000001, the ASCII code for "F" would be?

c) 1000110

Here is ascii table in hex values
http://core.ecu.edu/csci/wirthj/Basen/asciiCode-t.html

char  hex    decimal binary
A      41      65      1000001
B      42      66
C      43      67
D      44      68
E      45      69
F      46      70      1000110

8. A text file that is stored by using Unicode character coding system occupies 150 Kbytes.
How much space is required for another text file that contains exactly the same characters but uses ASCII character coding system?

a) 75 Kbytes


9. Given the 8-bit binary number: 1 0 0 1 1 1 0 1

What decimal number does this represent if the computer uses signed magnitude, one's complement and two's complement form.


a) -29(signed magnitude), -98(one's complement), -99(two's complement)




http://webcache.googleusercontent.com/search?q=cache:xLGumDrB-pIJ:www.fatih.edu.tr/~emanetn/courses/spring2010/ceng252/ceng252_2009_midterm1.doc+&cd=1&hl=tr&ct=clnk&gl=tr&client=firefox-a



  • Signed magnitude representation

Humans use a signed-magnitude system: we add + or - in front of a magnitude to indicate the signed
We could do this in binary as well, by adding an extra sign bit to the front of our numbers.


    A 0 sign bit represents a positive number.
    A 1 sign bit represents a negative number.


        1101base2 = 13base10 (a 4-bit unsigned number)

0 1101base2 = +13base10 (a positive number in 5-bit signed magnitude)

1 1101base2 = -1310base10 (a negative number in 5-bit signed magnitude)



http://webcache.googleusercontent.com/search?q=cache:OC8tJ0Dj968J:https://wiki.engr.illinois.edu/download/attachments/183861726/10-Subtractions-sol.ppt%3Fversion%3D1%26modificationDate%3D1317908161000+&cd=1&hl=tr&ct=clnk&gl=tr&client=firefox-a

  • Signed Magnitude:
In signed magnitude, the left-most bit is not actually part of the number, but is just the equivalent of a +/- sign.
"0" indicates that the number is positive, "1" indicates negative.
In 8 bits, 00001100 would be 12 (break this down into (1*2^3) + (1*2^2) ).
To indicate -12, we would simply put a "1" rather than a "0" as the first bit: 10001100.

http://www.math.grin.edu/~rebelsky/Courses/152/97F/Readings/student-binary#signed

No comments:

Post a Comment