Two's-complement signed integers
A signed interpretation assigns a negative weight to the highest bit.
Key knowledge
An n-bit two's-complement integer assigns weight −2^(n−1) to its highest bit and ordinary positive binary weights to the others. Its range is −2^(n−1) through 2^(n−1)−1; the same bits interpreted as unsigned can have a different value.
Values and equations
S=−b_(n−1)·2^(n−1)+Σ(i=0 to n−2)b_i·2^i
- S
- Represented signed integer
- n
- Bit width, integer at least 2
- b_i
- Bit at significance index i
Conditions and scope
- Use a fixed integer width n≥2 and bits b_i∈{0,1}.
- This defines representation; overflow behavior depends on the machine operation and programming-language rules.
A finite-width representation does not determine overflow behavior; arithmetic behavior depends on the machine operation and programming-language rules.
Sources · 3
References
Sources retain their recorded scope. A source link alone does not establish verification of every statement.
Evidence and review
Checked the stated two's-complement signed integers and restrictions against the listed primary sections; exact inspected boundaries are in the author receipt.
2026-10-10 · Independent Physics and Measurement reference editor (AI editorial bounded review). Exact bounded introductory reference claims and this practical concept inventory are approved after closure. Existing university/research proof and source scopes remain separate; no universal knowledge-completeness or experimental-validation assertion.
Foundational review
2026-10-10 · Fresh primary-source inspection of the complete compact record, including every statement, equation, quantity and material condition, followed by independent AI editorial review. This check does not certify all linked lessons or every passage of every cited publication.
Sources from other places
Scope or convention differs
Fixed-width two’s-complement representation, illustrated for eight and thirty-two bits.
The examples agree; the repository general negative-high-bit formula is a broader explicit definition.
UNSW Sydney, School of Computer Science and Engineering
- COMP1521 · Integers (23T2) AustraliaEnglish
Representing negative integers, slides 11–13; Printing 32-bit integer endpoints, slides 14–15
- COMP1521 · Integers (23T2)
Entry details
Permanent link to this entry ↗- Record identity
- foundation-info-signed-integers
- Revision
- foundations-audit.1
- Structured reference record
- Foundational reference additions