Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Sign bit
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Sign bit weight in Two's complement == {| class="wikitable" style="margin-left: auto; margin-right: auto; border: none;" |+ !Bits !Value using Two's complement |- | {{Mono|'''0'''000}} | 0 |- | {{Mono|'''0'''001}} | 1 |- | {{Mono|'''0'''111}} | 7 |- | {{Mono|'''1'''000}} | β8 |- | {{Mono|'''1'''001}} | β7 |- | {{Mono|'''1'''111}} | β1 |} [[Two's complement]] is by far the most common format for signed integers. In Two's complement, the sign bit has the weight {{Math|-2<sup>w-1</sup>}} where w is equal to the bits position in the number.<ref name=":0" /> With an 8-bit integer, the sign bit would have the value of {{Math|-2<sup>'''8'''-1</sup>}}, or -128. Due to this value being larger than all the other bits combined, having this bit set would ultimately make the number negative, thus changing the sign.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)