Binary, Decimal, and Hexadecimal Number Systems
← All articles

Binary, Decimal, and Hexadecimal Number Systems

5 min

Why digital circuits use binary

A wire in a digital circuit only has two reliable states: roughly 0V (logic 0) or roughly 5V/3.3V (logic 1). Binary — base 2 — is simply the number system built entirely from those two digits, which makes it the only number system that maps directly onto physical hardware without any extra encoding.

Converting binary to decimal

Every positional number system works the same way: each digit is multiplied by the base raised to its position, counting from 0 on the right. For binary, the base is 2, so the binary number 1011 converts to decimal as:

  • 1011₂ = 1·2³ + 0·2² + 1·2¹ + 1·2⁰ = 8 + 0 + 2 + 1 = 11₁₀

Converting decimal to binary

The reverse conversion repeatedly divides by 2 and records the remainders, reading them bottom-to-top:

  • 11 ÷ 2 = 5 remainder 1
  • 5 ÷ 2 = 2 remainder 1
  • 2 ÷ 2 = 1 remainder 0
  • 1 ÷ 2 = 0 remainder 1
  • Reading the remainders bottom-to-top gives 1011 — the same value as above.

Hexadecimal as a shorthand

Binary numbers get long fast — a single byte is 8 digits. Hexadecimal (base 16) groups every 4 binary digits into one symbol (0-9, then A-F for 10-15), so a byte fits in just 2 hex digits. 1011 0110₂ becomes B6₁₆ — far easier for a human to read, write, and remember, while remaining trivial to convert back to binary 4 bits at a time.

Where it matters in circuit design

Boolflow's Binary→Gray and 4-bit arithmetic blocks (adder, comparator, ALU) all operate on binary buses internally. Understanding binary-decimal conversion is what lets you predict the output of a truth table or verify a Verilog testbench by hand before trusting the simulator.

See binary values in a live circuit