AlgoPlus//structures / number-representation
Read the theory

Number Representation

How signed integers and real numbers are encoded as bits.

Encoding
Two's
Value
Encoding
Legend
Sign
Exponent
Value / mantissa
AI Tutor Workspace
In a nutshell
A computer stores every number as a fixed string of bits, so it needs agreed rules for what those bits mean. For whole numbers the standard is two's complement: it gives the leftmost bit a negative value, which lets one circuit add both positive and negative numbers, and you negate a number by flipping every bit and adding 1. For numbers with a fractional part, IEEE 754 splits the bits into a sign, an exponent, and a mantissa — essentially scientific notation in binary.
Ready
Press play to begin the cinematic walkthrough.
Two’s complement gives the top bit a negative weight so one adder handles signed and unsigned numbers; negate by inverting and adding 1. IEEE 754 stores a real as sign · biased exponent · mantissa with an implicit leading 1.
Key terms
Go deeper in the lesson
Read the full theory, intuition & complexity for Number Representation.