Skip to content
Home » Understanding Number Systems: Binary, Hexadecimal, and Denary

Understanding Number Systems: Binary, Hexadecimal, and Denary

  • by

Table of Contents

  1. Introduction to Number Systems
  2. Binary (Base-2)
  3. Denary/Decimal (Base-10)
  4. Hexadecimal (Base-16)
  5. Conversions Between Number Systems
  6. Why Do Programmers Use Hexadecimal?
  7. Summary & Key Takeaways

1. Introduction to Number Systems

Numbers can be represented in different bases (or radix). The most common ones in computing are:

SystemBaseDigits UsedExample
Binary20, 11010
Denary100-942
Hexadecimal160-9, A-F2F
  • Binary: Used by computers (everything is 0s and 1s).
  • Denary: Humans use this daily (standard counting).
  • Hexadecimal: A compact way to represent binary for programmers.

2. Binary (Base-2)

  • Only two digits0 and 1.
  • Each digit is called a bit (8 bits = 1 byte).
  • Used in computers because transistors (hardware) operate in two states: ON (1) and OFF (0).

Binary to Denary Conversion

Each binary digit represents a power of 2, starting from the right (LSB → MSB).

Example: 1011 in binary → Denary?

Bit Position3210
Binary Digit1011
Calculation1×2³0×2²1×2¹1×2⁰
Value8021

Total = 8 + 0 + 2 + 1 = 11 (Denary)


3. Denary/Decimal (Base-10)

  • Uses digits 0-9.
  • How humans naturally count.

Denary to Binary Conversion

Divide the number by 2 repeatedly and note remainders.

Example: Convert 13 to binary.

DivisionQuotientRemainder
13 ÷ 261 (LSB)
6 ÷ 230
3 ÷ 211
1 ÷ 201 (MSB)

Read remainders from bottom-up → 1101 (Binary)


4. Hexadecimal (Base-16)

  • Uses digits 0-9 and letters A-F (where A=10B=11, …, F=15).
  • Shorter representation of binary (1 hex digit = 4 binary digits).

Hexadecimal to Denary Conversion

Each hex digit represents a power of 16.

Example: 2F in hex → Denary?

DigitPositionCalculationValue
212 × 16¹32
F (15)015 × 16⁰15

Total = 32 + 15 = 47 (Denary)

Binary to Hexadecimal

Group binary digits into 4-bit nibbles and convert each to hex.

Example: 11010110 → Hex?

  1. Split into nibbles: 1101 0110
  2. Convert each:
    • 1101 = 13 → D
    • 0110 = 6 → 6

Result: D6 (Hex)


5. Conversions Between Number Systems

Quick Conversion Table

DenaryBinary (8-bit)Hexadecimal
0000000000
5000001015
1000001010A
1500001111F
25511111111FF

6. Why Do Programmers Use Hexadecimal?

1. Compact Representation

  • Writing long binary strings is tedious.
  • Example:
    • Binary: 1101001110101101
    • Hex: D3AD (Much shorter!)

2. Easier to Read & Debug

  • Memory addresses, color codes (#FF5733), and binary data are often represented in hex.

3. Direct Mapping to Binary

  • Each hex digit = 4 binary digits (nibble).
  • Makes binary manipulation easier.

4. Historical Use in Computing

  • Early computers used hex for simplicity in low-level programming.

7. Summary & Key Takeaways

✔ Binary (Base-2) → Computers understand it.
✔ Denary (Base-10) → Humans use it daily.
✔ Hexadecimal (Base-16) → Shorthand for binary, used in programming.

Conversion Methods

From → ToMethod
Binary → DenarySum of powers of 2.
Denary → BinaryDivide by 2, track remainders.
Binary → HexGroup into 4-bit nibbles.
Hex → DenarySum of powers of 16.

Why Hex?

  • Shorter than binary.
  • Easier to read & debug.
  • Directly maps to binary (1 hex digit = 4 bits).

Final Thought

Hexadecimal is like a “compressed binary”—it makes life easier for programmers while keeping close ties to how computers work.

🚀 Now you can convert and understand these number systems like a pro!

(Need a cheat sheet? Here’s a quick reference table below!)

Quick Reference Table

SystemBaseDigitsExample
Binary20,11010
Denary100-942
Hex160-9, A-F2F

Leave a Reply

Your email address will not be published. Required fields are marked *