Signed Binary Number Conversions
- In any system, all signed
binary numbers must have a fixed number of bits. it is
assumed that you are working in an "N" bit system.
- The highest positive number
you can represent is + (2N/2)-1
- The lowest negative number
you can represent is - (2N/2)
Offset Binary
For any specific system, Offset = (2N)/2
All positive numbers begin with one; all negative numbers begin with
zero
- Decimal to Offset Binary
- Add the offset to the
decimal number
- Convert the resulting
positive number to Binary
- Offset Binary to Decimal
- Convert the binary number
to decimal
- Subtract the offset, the
resulting number will be either positive or negative.
Twos Compliment Signed Binary
Notation:
Sometimes contracted and simply called "2's Compliment" or "2's
Compliment Form."
All positive numbers begin with zero; all negative numbers begin with
one.
- Decimal to Twos Compliment
Signed Binary Notation
- For positive numbers:
Convert the positive number into N-bit binary (add leading zeros as
needed to use N-bits)
- For negative numbers:
- Convert
the magnitude of the negative number into N-bit binary (add leading
zeros as needed to fill N-bits)
- Take the 2's compliment
of that binary number
- Twos Compliment Signed
Binary Notation to Decimal
- For numbers starting with
zero:
Convert the binary number to decimal. It is positive.
- For numbers starting with
one:
- Take the 2's compliment
of the binary number
- Convert this resulting
number
to its decimal magnitude. It is negative so put a minus sign in front
of
it.
- Alternate Method
- From Decimal into 2'sCSBN
: convert the same as offset binary and then invert the
MSB.
- From 2'sCSBN into decimal:
Invert the MSB then convert the resulting number the same as
offset binary.
to
top of page ... To
Prof. Wade's general information page: www.donwade.us
corrections, comments, etc. are most welcome: <waded@ncc.edu>
rev.
3/2/05