Introduction to Information Technology · Unit 2
Number Systems and Data Representation
Exam-focused notes for Number Systems and Data Representation (Introduction to Information Technology, BIT101): what the TU syllabus asks and how it has actually been tested, with 9 solved past questions from this unit.
Number Systems and Data Representation in short
Computers store everything as binary digits. This unit explains how numbers are written in different bases, how to convert between them, and how negative numbers are stored.
What this unit covers
- Face value and position value concepts
- Binary number system and encoding
- Octal and hexadecimal number systems
- Base conversion between decimal, binary, octal, hexadecimal
- Binary arithmetic and operations
- Two's complement method for signed numbers
- Reasons for using hexadecimal and octal in computers
Two's complement method for signed numbers
2081 · 5 marks
Add number +7 and -17 using 2's complement method. [5]
Reasons for using hexadecimal and octal in computers
2080 · 10 marks
Explain the reason of using hexadecimal and octal number system in computer? Add decimal number 23 and 12 using binary addition and verify the result with the help of decimal system.[10]
Binary number system and encoding
2080 · 5 marks
What is Binary Encoding? Why computers use Binary Encoding? [5]
Show solved answerHide answer
Binary Encoding
Definition
Binary Encoding is a method of representing data, numbers, characters, and instructions using only two symbols: 0 and 1 (bits). Every piece of information stored or processed in a computer is ultimately converted into a sequence of these two binary digits.
For example:
- The decimal number 9 is represented as 1001 in binary
- The character 'A' is represented as 01000001 in ASCII binary encoding
Why Computers Use Binary Encoding
Computers use binary encoding for the following fundamental reasons:
1. Physical Feasibility (Two Stable States)
Electronic components such as transistors, capacitors, and logic gates naturally operate in two stable states:
- ON (High Voltage) → represented as 1
- OFF (Low Voltage) → represented as 0
It is much easier and more reliable to build circuits that distinguish between two states than ten (as in decimal).
2. Reliability and Noise Immunity
Binary signals are highly resistant to electrical noise. Even if a signal degrades slightly, it is easy to determine whether it is a 0 or a 1. This makes data transmission and storage more accurate.
3. Boolean Algebra and Logic Operations
Binary encoding directly maps to Boolean algebra (AND, OR, NOT operations), which forms the mathematical foundation of digital circuit design. All computations can be reduced to simple logical operations on 0s and 1s.
4. Simplicity of Arithmetic
Binary arithmetic (addition, subtraction, multiplication, division) is extremely simple with only two digits. This simplifies the design of the Arithmetic Logic Unit (ALU) inside the CPU.
5. Data Storage
Storage devices such as hard disks, SSDs, RAM, and CDs store data as binary:
- Magnetic domains (North/South)
- Electrical charges (charged/uncharged)
- Optical pits and lands (reflective/non-reflective)
All of these naturally represent two states, making binary encoding ideal.
6. Universality
Binary encoding can represent any type of data -- numbers, text, images, audio, video, and program instructions -- by using appropriate encoding schemes (ASCII, Unicode, IEEE 754, etc.).
Summary Table
| Reason | Explanation |
|---|---|
| Physical feasibility | Transistors have two stable states (ON/OFF) |
| Reliability | Easy to distinguish 0 from 1 despite noise |
| Boolean logic | Directly supports AND, OR, NOT operations |
| Simple arithmetic | Only 4 basic addition rules needed |
| Storage compatibility | All storage media naturally support two states |
| Universality | Can encode any type of data |
Conclusion: Binary encoding is the foundation of all modern computing because it perfectly matches the physical nature of electronic components, ensures reliability, and simplifies both circuit design and mathematical operations.
Binary arithmetic and operations
2079 · 5 marks
Subtract 10010 from 10101. Verify answer with the help of decimal substraction. [5]
Base conversion between decimal, binary, octal, hexadecimal
2078 · 5 marks
Convert 3748.658 decimal to Binay, Octal and Hexadecimal. [5]
2081.2 · 5 marks
Convert $(366)_8$ to hexadecimal. Subtract $(1001111)_2$ from $(1110111)_2$. [2+3]
Show solved answerHide answer
Answer
Given Data
- Octal number to convert: $(366)_8$
- Binary subtraction: $(1110111)_2 - (1001111)_2$
(a) Convert $(366)_8$ to Hexadecimal
Method: Octal → Binary → Hexadecimal
Step 1: Each octal digit to 3-bit binary
| Octal | Binary |
|---|---|
| 3 | 011 |
| 6 | 110 |
| 6 | 110 |
$$(366)_8 = (011,110,110)_2 = (011110110)_2$$
Step 2: Group into 4 bits from the right
The nine bit string is padded on the left to a whole number of four bit groups before grouping, so the leading group is $0000$ and not $0001$:
$$011110110 \rightarrow 0000\ 1111\ 0110$$
Step 3: Convert each group to hex
| Binary | Hex |
|---|---|
| 0000 | 0 |
| 1111 | F |
| 0110 | 6 |
$$\boxed{(366)8 = (F6){16}}$$
Verify: $(366)8 = 3\cdot64 + 6\cdot8 + 6 = 192 + 48 + 6 = 246$ and $(F6){16} = 15\cdot16 + 6 = 240 + 6 = 246$, so the two agree. ✓
(b) Subtract $(1001111)_2$ from $(1110111)_2$
Compute $(1110111)_2 - (1001111)_2$.
Method: 2's Complement Subtraction
Step 1: 2's complement of $(1001111)_2$
- 1's complement: $0110000$
- Add 1: $0110000 + 1 = 0110001$
Step 2: Add minuend and 2's complement
$$ \begin{array}{r} 1110111 \ +\ 0110001 \ \hline 10101000 \end{array} $$
Step 3: Discard the carry (leftmost 1)
$$\text{Result} = (0101000)_2$$
Verification (decimal):
- $(1110111)_2 = 64+32+16+4+2+1 = 119$
- $(1001111)_2 = 64+8+4+2+1 = 79$
- $119 - 79 = 40$
- $(0101000)_2 = 32 + 8 = 40$ ✓
$$\boxed{(1110111)_2 - (1001111)_2 = (0101000)_2 = 40}$$
Summary
- $(366)8 = (F6){16}$
- $(1110111)_2 - (1001111)_2 = (0101000)_2$
Face value and position value concepts
0 · 5 marks
Explain the significance of the face value and position value of a number with an example. Convert the decimal number 47 into binary, octal and hexadecimal. [5]
Make Unit 2 stick
Practice BIT101 with flashcards & quizzes