Unsigned Binary Integers in Hardware
You'll learn: How computers physically represent and interpret bit patterns as non-negative whole numbers.
At the lowest level, computers only understand two states: on and off, which we represent as 1 and 0. But how does a sequence of bits like 10110101 turn into an actual number we can work with? The answer is positional notation — the same system we use for decimal numbers, just in base-2 instead of base-10.
The Core Idea
Think of how we read decimal numbers: in 347, the 7 means 7 ones, the 4 means 4 tens, and the 3 means 3 hundreds. Each position has a value that's a power of 10.
Binary works identically, except each position represents a power of 2:
Binary: 1 0 1 1 0 1 0 1
Power: 2⁷ 2⁶ 2⁵ 2⁴ 2³ 2² 2¹ 2⁰
Value: 128 0 32 16 0 4 0 1
Add up the positions with 1 bits: 128 + 32 + 16 + 4 + 1 = 181
How Hardware Uses This
When you store an unsigned (non-negative) integer in hardware, the computer:
- Allocates a fixed number of bits (e.g., 8, 16, 32, or 64 bits)
- Interprets the rightmost bit as 2⁰, the next as 2¹, and so on
- Has no bit reserved for a negative sign — every bit contributes to magnitude
An 8-bit unsigned integer can represent values from 00000000 (0) to 11111111 (255), giving you 2⁸ = 256 possible values.
Hardware circuits (like adders and comparators) are designed to operate directly on these bit patterns using the positional interpretation.
Key Takeaway: Computers store unsigned integers as fixed-length bit sequences and interpret them using base-2 positional notation, where each bit position represents a power of 2, allowing simple electrical signals to encode numeric values.