Tuesday, January 28, 2014

One’s complement representation


  • One’s complement representation

In one's complement, positive numbers are represented as usual in regular binary.
To negate a number, replace all zeros with ones, and ones with zeros - flip the bits.
12 would be 00001100, and -12 would be 11110011
As in signed magnitude, the leftmost bit indicates the sign (1 is negative, 0 is positive).
To compute the value of a negative number, flip the bits and translate as before.

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


  • 11012 = 1310 (a 4-bit unsigned number)
0 1101 = +1310 (a positive number in 5-bit one’s complement)
1 0010 = -1310 (a negative number in 5-bit one’s complement)

01002 = 410 (a 4-bit unsigned number)
0 0100 = +410 (a positive number in 5-bit one’s complement)
1 1011 = -410 (a negative number in 5-bit one’s complement)

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

No comments:

Post a Comment