What is Data Representation?
Computers cannot understand human languages directly. They only understand electrical signals with two states:
| State | Binary Value |
|---|---|
| OFF | 0 |
| ON | 1 |
Everything inside a computer is represented using combinations of 0 and 1:
- 🔤 Letters & Text
- 🔢 Numbers
- 🖼️ Images & Videos
- 🎵 Music & Audio
- 📄 Documents
🔄 How a Letter Appears on Screen (Example: "A")
- User presses A on keyboard
- Keyboard sends electronic signal
- Signal enters system unit
- Signal temporarily stores in RAM
- CPU processes the signal
- Display adapter sends data to monitor
- Letter A appears on screen ✨
Electronic circuits easily identify only two conditions:
• High Voltage = 1
• Low Voltage = 0
→ Binary is the most reliable system for computers!
Definition
A Number System is a method of representing numbers using symbols.
Key Components:
- Unit: A single object (e.g., one mango, one book)
- Number: A symbol representing quantity (e.g., 1, 25, 100)
- Base (Radix): Number of symbols available in the system
📊 Main Number Systems in Computing
| System | Base | Symbols Used | Badge |
|---|---|---|---|
| Binary | 2 | 0, 1 | Base-2 |
| Octal | 8 | 0–7 | Base-8 |
| Decimal | 10 | 0–9 | Base-10 |
| Hexadecimal | 16 | 0–9, A–F | Base-16 |
Binary Digits (Bits)
Only two values: 0 and 1
| Binary | Circuit State |
|---|---|
| 0 | OFF |
| 1 | ON |
🎨 Binary in Colour: RGB Model
Computers create colours using three channels:
- 🔴 Red
- 🟢 Green
- 🔵 Blue
Each channel ranges from 0 to 255 (8 bits = 2⁸ = 256 values)
R = 135, G = 31, B = 120
Written as:
(135, 31, 120)Why 255? → 11111111₂ = 255₁₀ (max value for 8 bits)
💡 Real-World Use: Hex Colour Codes
| Hex Code | Colour | RGB Equivalent |
|---|---|---|
#FF0000 | 🔴 Red | (255,0,0) |
#00FF00 | 🟢 Green | (0,255,0) |
#0000FF | 🔵 Blue | (0,0,255) |
#871F78 | 🟣 Dark Purple | (135,31,120) |
Decimal Basics
- Base: 10
- Digits: 0,1,2,3,4,5,6,7,8,9
📐 Positional Value Concept
Weighting Factors Table
| Position | Value | Name |
|---|---|---|
| 10⁰ | 1 | Ones |
| 10¹ | 10 | Tens |
| 10² | 100 | Hundreds |
| 10³ | 1000 | Thousands |
Example with Decimals
= 300 + 0 + 2 + 0.7 + 0.05
= 302.75
Binary Basics
- Base: 2
- Digits: 0, 1
- Bit: Smallest unit = 1 Binary Digit
Binary Weighting Factors
| Position | 2ⁿ | Value |
|---|---|---|
| 2⁰ | 1 | 1 |
| 2¹ | 2 | 2 |
| 2² | 4 | 4 |
| 2³ | 8 | 8 |
| 2⁴ | 16 | 16 |
| 2⁵ | 32 | 32 |
| 2⁶ | 64 | 64 |
| 2⁷ | 128 | 128 |
✅ Conversion Example
= 128 + 64 + 32 + 0 + 8 + 4 + 0 + 1
= 237₁₀
🔷 Octal Number System (Base-8)
- Digits: 0,1,2,3,4,5,6,7
- Weighting: 8⁰=1, 8¹=8, 8²=64, 8³=512
🔶 Hexadecimal Number System (Base-16)
- Digits: 0–9 and A–F
- Hex → Decimal: A=10, B=11, C=12, D=13, E=14, F=15
| Position | 16ⁿ | Value |
|---|---|---|
| 16⁰ | 1 | 1 |
| 16¹ | 16 | 16 |
| 16² | 256 | 256 |
| 16³ | 4096 | 4096 |
✨ Why Hexadecimal Matters
Binary numbers get very long! Hex provides a compact shorthand:
🛠️ Real Uses of Hex
- 📍 Memory addresses:
0x7A4F - 🎨 Web colour codes:
#FF5733 - 🐛 Error/debug codes in programming
- 🌐 URL encoding & web design
📌 Decimal Numbers
| Term | Definition | Example: 329 |
|---|---|---|
| MSD Most Significant Digit |
First non-zero digit from the left | 3 |
| LSD Least Significant Digit |
Last non-zero digit from the right | 9 |
More Examples
| Number | MSD | LSD |
|---|---|---|
| 1237 | 1 | 7 |
| 58.32 | 5 | 2 |
| 0.0975 | 9 | 5 |
💻 Binary Numbers: MSB & LSB
• MSB (Most Significant Bit) = Leftmost 1 →
1• LSB (Least Significant Bit) = Rightmost bit →
1
💡 MSB has the highest weight; LSB has the lowest weight in binary calculations.
🔁 Decimal → Binary (Divide by 2)
12 ÷ 2 = 6 → remainder 0
6 ÷ 2 = 3 → remainder 0
3 ÷ 2 = 1 → remainder 1
1 ÷ 2 = 0 → remainder 1
Read remainders bottom → top:
1100₂ ✅
🔁 Decimal → Octal (Divide by 8)
158÷8=19 r6 | 19÷8=2 r3 | 2÷8=0 r2
Answer:
236₈
🔁 Decimal → Hex (Divide by 16)
47÷16=2 r15 → 15 = F
Answer:
2F₁₆
⚡ Shortcut: Binary → Octal (Group by 3)
| Binary | Octal |
|---|---|
| 000 | 0 |
| 001 | 1 |
| 010 | 2 |
| 011 | 3 |
| 100 | 4 |
| 101 | 5 |
| 110 | 6 |
| 111 | 7 |
001 011 101 → 1 3 5 → 135₈
⚡ Shortcut: Binary → Hex (Group by 4)
| Binary | Hex | Binary | Hex |
|---|---|---|---|
| 0000 | 0 | 1000 | 8 |
| 0001 | 1 | 1001 | 9 |
| 0010 | 2 | 1010 | A |
| 0011 | 3 | 1011 | B |
| 0100 | 4 | 1100 | C |
| 0101 | 5 | 1101 | D |
| 0110 | 6 | 1110 | E |
| 0111 | 7 | 1111 | F |
0001 0110 → 1 6 → 16₁₆
📦 Data Storage Hierarchy (Exam Critical!)
| Unit | Equivalent | Real-World Example |
|---|---|---|
| 1 Bit | 0 or 1 | Single switch state |
| 1 Nibble | 4 Bits | Half a byte |
| 1 Byte | 8 Bits | One character (e.g., 'A') |
| 1 KB | 1024 Bytes | Short text paragraph |
| 1 MB | 1024 KB | 1 MP3 song (~3-5 MB) |
| 1 GB | 1024 MB | ~250 photos or 1 HD movie |
| 1 TB | 1024 GB | ~250,000 photos |
| 1 PB | 1024 TB | Large data centre storage |
🔤 Character Coding Systems
📜 ASCII (American Standard Code for Information Interchange)
- Represents English letters, numbers, basic symbols
- 7-bit or 8-bit encoding
- Examples:
A=65,B=66,a=97
🌍 Unicode (Universal Character Encoding)
- Supports all world languages: Sinhala, Tamil, Arabic, Chinese, Emoji 😊
- Backward compatible with ASCII
- Modern standard for web & software
🔑 Key Facts to Memorize
🎯 Top 10 Exam Questions
- Why do computers use binary?
- Convert 25₁₀ to binary
- What is the hex equivalent of decimal 15?
- How many bits in a byte?
- Explain RGB colour model
- Convert 10110111₂ to hex
- What does Unicode support that ASCII doesn't?
- Find MSB & LSB of 1100101₂
- Why is hexadecimal useful?
- Calculate storage: How many KB in 2 MB?
🔘 Part A: Multiple Choice (MCQ)
Computers use electronic circuits with two states: ON(1) and OFF(0).
Binary uses only two digits: 0 and 1.
Octal digits: 0,1,2,3,4,5,6,7 only.
Decimal 10=A, 11=B, 12=C, 13=D, 14=E, 15=F
Bit = Binary Digit (0 or 1)
🕳️ Part B: Fill in the Blanks
| Question | Answer |
|---|---|
| Base of decimal system | 10 |
| Smallest data unit | Bit |
| A nibble contains ___ bits | 4 |
| 1 Byte = ___ bits | 8 |
| Hexadecimal base | 16 |
| Binary digits | 0 and 1 |
| Hex after E | F |
| MSD is on the ___ side | Left |
| LSD is on the ___ side | Right |
| RGB = Red, Green, ___ | Blue |
✍️ Part C: Short Answer Samples
🔁 Part E: Conversion Practice (Answers Only)
| Question | Answer |
|---|---|
| 25₁₀ → Binary | 11001₂ |
| 50₁₀ → Binary | 110010₂ |
| 158₁₀ → Octal | 236₈ |
| 47₁₀ → Hex | 2F₁₆ |
| 1011₂ → Decimal | 11₁₀ |
| 11111111₂ → Decimal | 255₁₀ |
| 236₈ → Decimal | 158₁₀ |
| 2F₁₆ → Decimal | 47₁₀ |
| 1011101₂ → Octal | 135₈ |
| 10110111₂ → Hex | B7₁₆ |
No comments:
Post a Comment