954,506 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Binary Numbers

I have a homework assignment dealing with binary numbers and integer representation:

one of the questions is that I have to represent 127 and -81 in signed magnitude.

any help on understanding the process of this would be helpful thanks.

Foxtildawn
Newbie Poster
15 posts since Jan 2005
Reputation Points: 10
Solved Threads: 0
 

Sign-magnitude is probably the simplest of the binary representations. To get the negative binary representation of a negative number, just take the positive number and set the sign bit.

81 is 01010001, so -81 is 11010001. 127 is the largest possible value in a signed 8-bit type, so try the first seven bits 1 and the last bit (the sign bit) 0: 01111111. -127 would simply be the same thing with the sign bit set: 11111111.

Siersan
Light Poster
45 posts since Jan 2005
Reputation Points: 12
Solved Threads: 2
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You