Introduction to Information Technology · Unit 5 · 6 hrs
Data Representation
Exam-focused notes for Data Representation (Introduction to Information Technology, CSC114): what the TU syllabus asks and how it has actually been tested, with 8 solved past questions from this unit.
Data Representation in short
Inside a computer, every kind of data, numbers, text, images and instructions alike, is ultimately stored and processed as patterns of binary digits. This chapter builds up that representation: the number systems computing relies on, how to convert between them, how binary arithmetic and signed numbers work, how characters are coded, and the logic gates that carry out these operations in hardware.
What this unit covers
- Introduction
- Number System
- Conversion from Decimal to Binary, Octal, Hexadecimal
- Conversion of Binary, Octal, Hexadecimal to Decimal
- Conversion of Binary to Octal, Hexadecimal
- Conversion of Octal, Hexadecimal to Binary
- Binary Arithmetic
- Signed and Unsigned Numbers
- Binary Data Representation
- Binary Coding Schemes
- Logic Gates
Conversion from Decimal to Binary, Octal, Hexadecimal
2081 · 5 marks
What is Unicode? Convert 0.865 from Base 10 to Base 16. [5]
Show solved answerHide answer
Unicode and Base 10 to Base 16 Conversion
Part 1: What is Unicode? [2 marks]
Unicode is a universal character encoding standard that assigns a unique number, called a code point, to every character, symbol, and script used in the writing systems of the world.
Key points:
- Developed to overcome the limits of older schemes like ASCII (only 128 characters) and Extended ASCII (256 characters).
- Can represent over 1 million (1,114,112) possible code points, covering nearly all languages (Latin, Devanagari, Chinese, Arabic, etc.), symbols, and emojis.
- Each character has a code point written as
U+XXXX, e.g.U+0041= 'A'. - Encoding forms include UTF-8, UTF-16, and UTF-32.
- Guarantees consistent text representation across platforms, devices, and applications.
Part 2: Convert $0.865_{10}$ to Base 16 [3 marks]
Method: Repeatedly multiply the fraction by 16; the integer part of each product forms the hex digits (top to bottom).
| Step | Multiplication | Product | Integer part (hex digit) | New fraction |
|---|---|---|---|---|
| 1 | $0.865 \times 16$ | $13.840$ | $13 = D$ | $0.840$ |
| 2 | $0.840 \times 16$ | $13.440$ | $13 = D$ | $0.440$ |
| 3 | $0.440 \times 16$ | $7.040$ | $7$ | $0.040$ |
| 4 | $0.040 \times 16$ | $0.640$ | $0$ | $0.640$ |
| 5 | $0.640 \times 16$ | $10.240$ | $10 = A$ | $0.240$ |
Verification of each product:
- $0.865 \times 16 = 13.84$ → digit D, remainder $0.84$
- $0.84 \times 16 = 13.44$ → digit D, remainder $0.44$
- $0.44 \times 16 = 7.04$ → digit 7, remainder $0.04$
- $0.04 \times 16 = 0.64$ → digit 0, remainder $0.64$
- $0.64 \times 16 = 10.24$ → digit A, remainder $0.24$
Reading digits top to bottom:
$$0.865_{10} \approx 0.\text{DD70A}_{16}$$
Answer:
$$\boxed{0.865_{10} \approx 0.DD70A_{16}}$$
(The conversion is non-terminating; five hex digits give a close approximation.)
2080 · 5 marks
What is ASCII? Convert 0.2345 from Base 10 to Base 2. [5]
Show solved answerHide answer
ASCII and Base 10 to Base 2 Conversion
Given data
- Number to convert: $0.2345$ (Base 10)
- Target base: Base 2
- Concept asked: ASCII
Part 1: What is ASCII? (2 marks)
ASCII stands for American Standard Code for Information Interchange.
- It is a character encoding standard that assigns a unique numeric code to each character so that text can be represented, stored, and processed in computers.
- Standard ASCII uses 7 bits, giving $2^7 = 128$ possible codes (0 to 127).
- It encodes:
- Uppercase letters A-Z (65-90)
- Lowercase letters a-z (97-122)
- Digits 0-9 (48-57)
- Special/punctuation characters
- Control characters (e.g., newline, tab, carriage return)
- Example:
'A' = 65,'a' = 97,'0' = 48. - Extended ASCII uses 8 bits to represent 256 characters.
Part 2: Convert 0.2345 to Base 2 (3 marks)
Method: Repeatedly multiply the fractional part by 2; the integer part of each product gives the next binary bit (read top to bottom).
| Step | Fraction | ×2 | Product | Bit |
|---|---|---|---|---|
| 1 | 0.2345 | ×2 | 0.4690 | 0 |
| 2 | 0.4690 | ×2 | 0.9380 | 0 |
| 3 | 0.9380 | ×2 | 1.8760 | 1 |
| 4 | 0.8760 | ×2 | 1.7520 | 1 |
| 5 | 0.7520 | ×2 | 1.5040 | 1 |
| 6 | 0.5040 | ×2 | 1.0080 | 1 |
| 7 | 0.0080 | ×2 | 0.0160 | 0 |
| 8 | 0.0160 | ×2 | 0.0320 | 0 |
Reading the integer bits from top to bottom:
$$(0.2345)_{10} \approx (0.00111100)_2$$
Verification: $$0\cdot2^{-1}+0\cdot2^{-2}+1\cdot2^{-3}+1\cdot2^{-4}+1\cdot2^{-5}+1\cdot2^{-6}$$ $$= 0.125 + 0.0625 + 0.03125 + 0.015625 = 0.234375 \approx 0.2345 \checkmark$$
Note: This is a non-terminating binary fraction, so the answer is an approximation to 8 binary places.
$$\boxed{(0.2345)_{10} \approx (0.00111100)_2}$$
2079 · 5 marks
Define decimal to binary conversion. Convert decimal 12.15 to binary. [5]
2074 · 5 marks
Convert $(10.4)_{10}$ to binary. Add $(10111)_2$ with $(01111)_2$. [5]
Binary Arithmetic
2078 · 5 marks
How binary addition is done? Show binary addition of (11001) with (11011). [5]
Conversion of Binary, Octal, Hexadecimal to Decimal
Signed and Unsigned Numbers
2075 · 10 marks
Discuss the concept behind the fixed point number representation. What can be the fixed point representation of a signed number 8? Convert (14.14) decimal into binary and octal.[10]
0 · 10 marks
Discuss the concept behind the fixed point number representation. What can be the fixed point representation of a signed number 8? Convert (14.14) decimal into binary and octal.[10]
Make Unit 5 stick
Practice CSC114 with flashcards & quizzes