Range of Decimals Representable by an -bit Ones’ Complement Representation
In an -bit One’s complement system, one bit is used as the sign bit (most significant bit). The remaining value field encodes the magnitude via complements. A key property is that ones’ complement has two zeros: and . 2
To derive the range, note that the largest positive value occurs when the sign bit is and all remaining bits are , which yields:
Similarly, the smallest (most negative) value occurs when the sign bit is and all remaining bits are (which represents the complement corresponding to ):
Therefore, the representable decimal integer range for -bit ones’ complement is:
with total bit patterns corresponding to representable values, including both and . 2
A compact visualization of boundaries is:
Footnotes
-
Ones' complement - Wikipedia - Defines ones’ complement, including range behavior and dual zeros. ↩ ↩2
-
Signed number representations - Wikipedia - Covers representable ranges and properties of ones’ complement. ↩ ↩2
type="tip" title="Pro Tip" content="When asked for an -bit ones’ complement range, remember: it is symmetric and excludes an extreme negative magnitude. The max magnitude is and there are two zeros."
Derive the Range for $n$-bit Ones’ Complement
- 1Step 1
In ones’ complement, the most significant bit is the sign bit. Positive numbers have sign bit 0; negative numbers have sign bit 1.
Footnotes
-
Ones' complement - Wikipedia - Defines ones’ complement, including range behavior and dual zeros. ↩
-
- 2Step 2
For a positive value, set the sign bit to 0 and all remaining bits to 1. That integer equals . 2
Footnotes
-
Ones' complement - Wikipedia - Defines ones’ complement, including range behavior and dual zeros. ↩
-
Signed number representations - Wikipedia - Covers representable ranges and properties of ones’ complement. ↩
-
- 3Step 3
Negatives are represented by bitwise complement of the positive magnitude. The most negative value corresponds to the complement of , giving . 2
Footnotes
-
Ones' complement - Wikipedia - Defines ones’ complement, including range behavior and dual zeros. ↩
-
Signed number representations - Wikipedia - Covers representable ranges and properties of ones’ complement. ↩
-
- 4Step 4
Combine both bounds: . Include the fact that both and exist among representable values. 2
Footnotes
-
Ones' complement - Wikipedia - Defines ones’ complement, including range behavior and dual zeros. ↩
-
Signed number representations - Wikipedia - Covers representable ranges and properties of ones’ complement. ↩
-
Ones’ Complement Range Boundaries (as functions of )
For bits, max magnitude is ; range is symmetric.
Example instantiations
For intuition, plug in small :
Key terms
- Ones’ complement
- Sign bit
- Two’s zero property
- Representable range
Footnotes
-
Ones' complement - Wikipedia - Defines ones’ complement, including range behavior and dual zeros. ↩ ↩2
-
Signed number representations - Wikipedia - Covers representable ranges and properties of ones’ complement. ↩ ↩2
Common Nuances (FAQ)
Mental Model for the Range Question
Choose interpretation
Step 1Treat the encoding as signed ones’ complement with sign bit and bitwise complement rule."
Compute maximum positive
Step 2Set sign bit 0 and remaining bits to 1 → ."
Compute minimum negative
Step 3Complement the positive magnitude → minimum ."
State interval
Step 4Report (noting two zeros)."
Ones’ Complement and Signed Integer Ranges
Knowledge Check
An -bit ones’ complement representation can represent integers in which interval?