All courses › Embedded Systems and Instrumentation › Number Systems

Number Systems

Computers compute internally with binary numbers (base 2), but hexadecimal numbers (base 16) are often used as a compact shorthand for binary, since two hex digits always make exactly one byte. A digit at position kk has weight bkb^k, where bb is the base.

value=∑kdk⋅bk\text{value}=\sum_k d_k\cdot b^kpositional system: each digit d_k is weighted by b^k

Symbols

bbbase (2, 16 or 10)
dkd_kdigit at position k

Example

0x1F\texttt{0x1F} in decimal:

1⋅16+15⋅1=311\cdot16+15\cdot1=31.

Two hex digits are always exactly one byte – handy for reading memory addresses and color codes.
Practise number systems and digital logic for free →

Two's Complement →

Part of Embedded Systems and Instrumentation: Number systems and digital logic.