Lesson 3: Conversion Between Decimal and Binary Systems

Learning Outcomes

By the end of this lesson, learners will be able to:

  • Understand the binary number system
  • Convert decimal numbers to binary
  • Convert binary numbers to decimal
  • Perform binary arithmetic

1. Introduction to Binary Numbers

The binary number system is a base-2 numbering system used by computers.

Unlike the decimal system (base 10), binary uses only two digits:

 
0
1
 

Computers use binary because electronic circuits have two states:

State Binary Value
Off 0
On 1

Every piece of data processed by a computer is represented using binary numbers.

2. Binary Place Values

Each digit in a binary number represents a power of 2.

Power of 2 Value
2^0 1
2^1 2
2^2 4
2^3 8
2^4 16
2^5 32

Example binary number:

 
1011
 

Represents:

 
(1 × 2^3) + (0 × 2^2) + (1 × 2^1) + (1 × 2^0)
 

3. Converting Binary to Decimal

Example:

 
10101
 

Step-by-step conversion:

 
(1 × 2^4) + (0 × 2^3) + (1 × 2^2) + (0 × 2^1) + (1 × 2^0)
 
 
16 + 0 + 4 + 0 + 1
 
 
21
 

So:

 
10101 (binary) = 21 (decimal)
 

4. Converting Decimal to Binary

Example: Convert 19 to binary.

Divide repeatedly by 2.

Division Remainder
19 ÷ 2 = 9 1
9 ÷ 2 = 4 1
4 ÷ 2 = 2 0
2 ÷ 2 = 1 0
1 ÷ 2 = 0 1

Read remainders from bottom to top.

 
10011
 

So:

 
19 (decimal) = 10011 (binary)
 

5. Binary Addition

Binary addition follows these rules:

Addition Result
0 + 0 0
0 + 1 1
1 + 0 1
1 + 1 10

Example:

 
1011
+0101
 

Step-by-step result:

 
10000
 

6. Binary Arithmetic in Computing

Binary arithmetic is used in:

  • computer processors
  • digital circuits
  • memory storage
  • programming
  • encryption systems

Every operation performed by a computer is based on binary calculations.

7. Example in Programming

Binary logic is used in programming languages.

Example condition:

 
if (binaryValue == 1)
 

Binary operations are also used in:

  • bitwise operations
  • network protocols
  • file encoding

Real-World Example

A pixel in an image is stored as binary data.

Example RGB pixel values:

Color Binary
Red 11111111
Green 00000000
Blue 00000000

This represents a pure red pixel.

Lesson Summary

In this lesson we learned:

  • Binary numbers use base 2
  • Computers process information using 0 and 1
  • Binary numbers can be converted to decimal
  • Decimal numbers can be converted to binary
  • Binary arithmetic follows simple rules