[Cs35101] Signed Magnitude Integers
Dianne Foreback
dforebac at kent.edu
Thu Sep 8 12:42:11 EDT 2016
Hello Computer Architecture Class:
I've updated today's presentation "Representing Number". I updated Slide
12 putting in the step numbers as explained in class today. Also, I
inserted two new slides, slide 21 and 22. These give more detail on signed
magnitude integers to help with your homework.
Another example follows in this email that shows converting +7 and -7 to a
signed magnitude integer.
Example: Representing +7 as a signed-Magnitude Integer with 4 bits.
Step1: Convert 7 to a binary number resulting in 111. We can use only 3
bits since the 4th is a sign bit
Step 2: Attach a 0 as the leftmost bit implying this is a positive number
resulting in 0111. Notice, if using only 4 bits, 7 is the largest number
that can be represented for a signed magnitude number.
Example: Representing -7 as a signed-Magnitude Integer with 4 bits.
Step1: Convert 7 (yes, positive 7 or the absolute value of -7) to a binary
number (notice we are not considering the sign yet); this results in 111
just as the above example. We can use only 3 bits since the 4th is a sign
bit.
Step 2: Attach a 1 to the leftmost bit implying this is a negative number
resulting in 1111.
Notice, all but the left most bit are the same when representing 7 and -7.
You can think of the leftmost bit as a positive or negative sign. Again, 0
is a positive and 1 is a negative.
Best,
Dianne
_______________________________________________
Dr. Dianne Foreback, Assistant Professor
Department of Computer Science
Math and Computer Science Building (MSB) 266
P.O. Box 5190, Kent, Ohio 44242-0001, USA
Phone: 330.672.9064
Email: dforebac at kent.edu
_______________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://listmail.cs.kent.edu/pipermail/cs35101/attachments/20160908/927408d8/attachment.html
More information about the CS35101
mailing list