Base-2 (Binary) Number System

The fundamental language of computers - understanding binary as the foundation of all digital systems and cybersecurity applications.

Learning Objectives

  • Understand binary as the fundamental computer number system
  • Learn binary place values and conversion methods
  • Explore binary arithmetic and bitwise operations
  • Apply binary concepts to cybersecurity scenarios

Binary Fundamentals

What is Binary?

Binary uses only two digits: 0 and 1

These represent electronic switch states:

0 OFF
1 ON

Binary Units

1
Bit
Smallest unit
8
Byte
8 bits = 256 values

Binary Place Values

Each position represents a power of 2:

1
2⁷ = 128
1
2⁶ = 64
0
2⁵ = 32
1
2⁴ = 16
0
2³ = 8
1
2² = 4
1
2¹ = 2
0
2⁰ = 1

11010110₂ = 128 + 64 + 16 + 4 + 2 = 214₁₀

Conversion Methods

Binary to Decimal

Method 1: Place Value Addition

Example: Convert 1011₂ to decimal

1011₂ = (1×2³) + (0×2²) + (1×2¹) + (1×2⁰)
= (1×8) + (0×4) + (1×2) + (1×1)
= 8 + 0 + 2 + 1 = 11₁₀

Method 2: Doubling Method

Example: Convert 1011₂ to decimal

Start with leftmost bit: 1
Double and add next: (1×2) + 0 = 2
Double and add next: (2×2) + 1 = 5
Double and add next: (5×2) + 1 = 11

Decimal to Binary

Division by 2 Method

Example: Convert 13₁₀ to binary

13 ÷ 2 = 6 remainder 1
6 ÷ 2 = 3 remainder 0
3 ÷ 2 = 1 remainder 1
1 ÷ 2 = 0 remainder 1
Read remainders upward: 1101₂

Binary Arithmetic

Addition Rules

0 + 0 = 0
0 + 1 = 1
1 + 0 = 1
1 + 1 = 10 (carry 1)

Bitwise Operations

AND Operation (&)

1010 & 1100 = 1000
Only 1 when both bits are 1

OR Operation (|)

1010 | 1100 = 1110
1 when either bit is 1

Cybersecurity Applications

IP Address Representation

IPv4 addresses are 32-bit binary numbers divided into 4 octets:

192.168.1.1
11000000.10101000.00000001.00000001

File Permissions

Unix file permissions use 3-bit binary groups:

7 111 rwx (read, write, execute)
4 100 r-- (read only)

Network Subnetting

Subnet masks use binary to define network boundaries:

255.255.255.0 = 11111111.11111111.11111111.00000000
24-bit network, 8-bit host portion