NUMBER SYSTEM

IN COMPUTER SCIENCE

PREPARED BY Ashad Javed
SUBJECT Computer Science
0101 1010
0xFF · 0b1010 · 0o17 · 42
02

What is a Number System?

A number system is a mathematical notation for representing numbers using a consistent set of digits or symbols.

  • Defines how numbers are stored and processed
  • Each system has a base (radix)
  • Computers use binary at hardware level
  • Humans use decimal in daily life
CPU
1
0
1
1
Binary
Base 2
Octal
Base 8
Decimal
Base 10
Hexadecimal
Base 16
03

Binary Number System

Base-2 System

Uses only 0 and 1

  • Each digit is called a BIT (Binary Digit)
  • 8 bits = 1 Byte
  • Represents OFF (0) and ON (1)
  • Foundation of all digital computing
Example: (1010)2 = 10 in Decimal
1
0
1
1
0
1
0
1
1 Byte = 8 Bits
04

Binary Conversion

Decimal 13 → Binary
Number÷ 2QuotientRemainder
13÷ 261
6÷ 230
3÷ 211
1÷ 201
↑ Read remainders bottom to top
Result: (13)10 = (1101)2
Place Value Verification
8
1
8×1=8
4
1
4×1=4
2
0
2×0=0
2⁰
1
1
1×1=1
8 + 4 + 0 + 1 = 13
05

Octal Number System

🔢

Base-8 System

Uses digits 0 – 7

  • Prefix: 0 (e.g., 017)
  • Each octal digit = 3 binary bits
  • Used in Unix file permissions
  • Compact representation of binary
Example: (17)8 = 15 in Decimal
OCT
0
1
2
3
4
5
6
7
Unix Permissions
7 111 rwx
5 101 r-x
4 100 r--
06

Decimal Number System

🌍

Base-10 System

Uses digits 0 – 9

  • Most natural for humans
  • Based on 10 fingers (deci = ten)
  • Each position is a power of 10
  • Standard in everyday mathematics
Example: 425 = 4×10² + 2×10¹ + 5×10⁰
000
Counting in Decimal
10²
Hundreds
4
10¹
Tens
2
10⁰
Units
5
07

Hexadecimal Number System

💻

Base-16 System

Uses 0–9 and A–F

  • Prefix: 0x (e.g., 0xFF)
  • Each hex digit = 4 binary bits
  • Used in memory addresses, colors
  • Compact binary representation
Example: (1F)16 = 31 in Decimal
DecHexBinary
10A1010
11B1011
12C1100
13D1101
14E1110
15F1111
#FF3CAC
#CCFF00
#00BFFF
08

Conversion Table

Decimal Binary Octal Hexadecimal
0000000
1000111
2001022
3001133
4010044
5010155
6011066
7011177
81000108
91001119
10101012A
11101113B
15111117F
16100002010
09

Real-World Applications

🖥️
Binary
  • CPU logic gates
  • RAM storage
  • Digital circuits
🔐
Octal
  • Unix permissions
  • File systems
  • Legacy systems
🧮
Decimal
  • User interfaces
  • Financial data
  • Human I/O
🎨
Hexadecimal
  • Memory addresses
  • HTML/CSS colors
  • MAC addresses
Memory Address Example: 0x7FFF5FBFF8A0
10

Summary & Thank You

BINARY
Base 2
Digits: 0, 1
Hardware level
OCTAL
Base 8
Digits: 0–7
File permissions
DECIMAL
Base 10
Digits: 0–9
Human use
HEX
Base 16
Digits: 0–9, A–F
Memory & colors
THANK YOU
Prepared by Ashad Javed
01000001 01110011 01101000 01100001 01100100