Unit 3: Data Representation - AL ICT
This unit covers how information is converted into binary for computer processing. Here are the core components included in the syllabus:
1. Number Systems and Conversions
- Systems: Decimal (Base 10), Binary (Base 2), Octal (Base 8), and Hexadecimal (Base 16).
- Conversions: Moving between any of these bases (e.g., Binary to Hexadecimal).
2. Integer Representation
- Unsigned Integers: Positive whole numbers.
- Signed Integers: Techniques for negative numbers:
- Sign-and-Magnitude: MSB acts as the sign bit.
- 1’s Complement: Inverting all bits.
- 2’s Complement: The standard for subtraction and negative values.
3. Floating Point Representation (IEEE 754)
How real numbers (fractions) are stored using Sign bit, Exponent, and Mantissa in Single (32-bit) and Double (64-bit) precision.
4. Character Encoding
- BCD & ASCII: Standard codes for digits and English characters.
- EBCDIC: Legacy IBM mainframe encoding.
- Unicode: Modern global standard (UTF-8, UTF-16) for all languages.
5. Binary Arithmetic & Logic
- Addition and subtraction using 2’s complement.
- Bitwise operations: AND, OR, NOT, XOR.
6. Multimedia Representation
- Images: Pixels, resolution, and color depth.
- Audio/Video: Sampling rates and bit rates.
IEEE 754 Standard of Floating Point Arithmetic
Sri Lanka GCE A/L ICT - Data Representation
1. Introduction
In the GCE A/L ICT syllabus, representing real numbers (numbers with decimal points) is a crucial topic. Computers cannot store numbers like 10.5 or -3.14 directly in integer format. Instead, they use the IEEE 754 Standard.
For the A/L examination, you are primarily required to understand the Single Precision (32-bit) format.
2. Structure of Single Precision (32-bit)
A 32-bit floating-point number is divided into three parts:
| Part | Size (Bits) | Position | Function |
|---|---|---|---|
| Sign Bit (S) | 1 bit | Bit 31 (Leftmost) | 0 = Positive (+), 1 = Negative (-) |
| Exponent (E) | 8 bits | Bits 30 - 23 | Stores the power of 2 (with a Bias) |
| Mantissa (M) | 23 bits | Bits 22 - 0 | Stores the fractional part of the number |
Value = (-1)S × (1.M) × 2(E - 127)
Key Concept: The Bias
Since the exponent can be negative (e.g., $2^{-3}$), computers use a Bias of 127 to store it as a positive integer.
- Stored Exponent = Real Exponent + 127
- Real Exponent = Stored Exponent - 127
3. Normalization
Before converting a binary number to IEEE 754, it must be Normalized. This means shifting the binary point so that there is only one '1' to the left of the binary point.
Format: $1.xxxxx \times 2^y$
Note: In IEEE 754, the leading '1' is implied (hidden) and is not stored in the Mantissa bits to save space.
4. Step-by-Step Conversion Guide
Method A: Decimal to IEEE 754 (Single Precision)
- Determine the Sign: If positive, S=0. If negative, S=1.
- Convert to Binary: Convert the absolute value of the decimal number to binary (integer part and fractional part).
- Normalize: Shift the binary point to get the form $1.xxxxx \times 2^E$.
- Calculate Exponent: Add 127 to the real exponent ($E_{stored} = E + 127$). Convert this result to 8-bit binary.
- Determine Mantissa: Take the bits after the binary point from the normalized form. Pad with zeros to make it 23 bits.
- Combine: Arrange as [Sign] [Exponent] [Mantissa].
Method B: IEEE 754 to Decimal
- Identify Parts: Split the 32 bits into Sign (1), Exponent (8), and Mantissa (23).
- Check Sign: Is it positive or negative?
- Calculate Real Exponent: Convert Exponent bits to decimal, then subtract 127.
- Reconstruct Mantissa: Add the implied '1.' before the Mantissa bits ($1.M$).
- Calculate Value: Apply the formula: $(-1)^S \times 1.M \times 2^{RealExp}$.
5. Worked Example
Question: Convert -10.25 to IEEE 754 Single Precision.
Solution:
- Sign: Negative, so S = 1.
- Binary Conversion:
- Integer 10 = $1010_2$
- Fraction 0.25 = $0.01_2$ ($0.25 \times 2 = 0.5 \to 0$, $0.5 \times 2 = 1.0 \to 1$)
- Combined: $1010.01_2$
- Normalization: Shift point 3 places to the left.
$1.01001 \times 2^3$
Real Exponent = 3. - Exponent Calculation:
$3 + 127 = 130$
Binary of 130 = 10000010 - Mantissa: Take bits after the point ($01001$) and pad to 23 bits.
01001000000000000000000 - Final Result:
1 | 10000010 | 01001000000000000000000
Hex: C1240000
6. Practice Questions (A/L Style)
Question 1
Convert the decimal number 6.75 into its IEEE 754 Single Precision binary representation.
Question 2
The following 32-bit binary sequence represents a number in IEEE 754 Single Precision format. Find its decimal value.
0 10000001 01000000000000000000000
Question 3 (MCQ Style)
In the IEEE 754 Single Precision standard, what is the binary value stored in the exponent field if the actual exponent is -2?
A) 00000010
B) 11111101
C) 01111101
D) 10000001
IEEE 754 Decimal to Floating Point Conversion
Sri Lanka G.C.E A/L ICT – Unit 3 (Data Representation)
IEEE 754 is the standard used by computers to store floating point numbers (decimal numbers).
IEEE 754 Single Precision (32-bit)
| Part | Bits | Description |
|---|---|---|
| Sign | 1 bit | Positive or Negative number |
| Exponent | 8 bits | Power of 2 |
| Mantissa (Fraction) | 23 bits | Significant digits |
Sign | Exponent (8 bits) | Mantissa (23 bits)
Step-by-Step Conversion Method
Step 1 – Determine the Sign Bit
- Positive number → 0
- Negative number → 1
Example: +25.5
Sign = 0
Step 2 – Convert Decimal to Binary
Integer Part
25 ÷ 2 25 = 11001
Fraction Part
0.5 × 2 = 1.0
Binary Result:
25.5 = 11001.1
Step 3 – Normalize the Binary Number
11001.1 = 1.10011 × 2⁴
Step 4 – Calculate the Exponent
IEEE 754 uses a Bias value of 127
Exponent = Actual Exponent + Bias Exponent = 4 + 127 = 131
Convert 131 to binary:
131 = 10000011
Step 5 – Find the Mantissa
Take the digits after the decimal point:
1.10011
Mantissa:
10011000000000000000000
Final IEEE 754 Representation
| Part | Value |
|---|---|
| Sign | 0 |
| Exponent | 10000011 |
| Mantissa | 10011000000000000000000 |
Final 32-bit IEEE 754: 0 10000011 10011000000000000000000
Example 2 – Convert 10.25 to IEEE 754
Step 1 – Sign
Positive → 0
Step 2 – Decimal to Binary
10 = 1010
0.25 × 2 = 0.5 0.5 × 2 = 1.0
10.25 = 1010.01
Step 3 – Normalize
1010.01 = 1.01001 × 2³
Step 4 – Exponent
3 + 127 = 130 130 = 10000010
Step 5 – Mantissa
01001000000000000000000
Final Result
0 10000010 01001000000000000000000
Quick Exam Trick
- Find Sign
- Convert Decimal to Binary
- Normalize (1.x × 2ⁿ)
- Add Bias (127)
- Find Mantissa (23 bits)
7. Answers & Explanations
Answer to Question 1
Step 1: Sign
Positive, so S = 0.
Step 2: Binary
6 = $110_2$
0.75 = $0.11_2$ ($0.75 \times 2 = 1.5 \to 1$, $0.5 \times 2 = 1.0 \to 1$)
Result: $110.11_2$
Step 3: Normalize
$1.1011 \times 2^2$
Real Exponent = 2.
Step 4: Exponent Field
$2 + 127 = 129$
Binary of 129 = 10000001
Step 5: Mantissa
Bits after point: $1011$
Pad to 23 bits: 10110000000000000000000
Final Answer:
0 10000001 10110000000000000000000
Answer to Question 2
Step 1: Split
Sign: 0 (+)
Exponent: 10000001
Mantissa: 010000...
Step 2: Exponent
Binary $10000001 = 129$ (Decimal)
Real Exponent = $129 - 127 = 2$
Step 3: Mantissa Value
Implied 1 + Fraction = $1.01_2$
Step 4: Calculate
$+1.01_2 \times 2^2$
Shift binary point 2 places right: $101_2$
$101_2 = 5_{10}$
Final Answer: 5.0
Answer to Question 3
Real Exponent = -2.
Stored Exponent = Real Exponent + Bias
Stored Exponent = $-2 + 127 = 125$.
Convert 125 to binary:
125 = 64 + 32 + 16 + 8 + 4 + 1 = 01111101
Correct Option: C) 01111101
🚀 Master GCE O/L A/L ICT | Your IT Degree with Expert Guidance!
Online Individual & Group Classes in English | Sinhala | Tamil
Struggling with assignments, projects, or exams? Get personalized support tailored for BIT (University of Moratuwa), UCSC, and other IT degree students in Sri Lanka.
✨ What You'll Get
- ✅ Live Online Classes (Individual or Group)
- ✅ Sample Projects & Assignments (PHP, MySQL, Java, Python, Web Dev)
- ✅ Past Exam Papers + Model Answers
- ✅ Easy-to-Follow Tutorials & Study Notes
- ✅ Final Year Project Guidance – From Idea to Implementation
- ✅ Doubt-Clearing Sessions & Exam Prep Strategies
🌍 Taught in Your Preferred Language
English | Sinhala | Tamil
📞 Get Started Today!
Call / WhatsApp: +94 72 962 2034
Email: itclasssl@gmail.com
Quick response guaranteed! Share your syllabus or project topic, and we'll craft a learning plan just for you.