Digital Logic · Unit 1
Number Systems and Conversions
Exam-focused notes for Number Systems and Conversions (Digital Logic, BIT103): what the TU syllabus asks and how it has actually been tested, with 13 solved past questions from this unit.
Number Systems and Conversions in short
Digital computers store and process everything as binary numbers. This chapter shows how to convert between number systems and how to do arithmetic, including subtraction with complements, which is how real hardware subtracts.
What this unit covers
- Binary decimal octal hexadecimal conversions
- Fractional number conversions
- Complements of decimal numbers
- Binary arithmetic operations
- Binary subtraction using complements
Binary decimal octal hexadecimal conversions
2081 · 5 marks
Convert (257)₈ into hexadecimal and decimal number system. [5]
Show solved answerHide answer
Convert (257)₈ to Decimal and Hexadecimal
Given Data
- Number: $(257)_8$ (octal, base 8)
- Required: convert to hexadecimal (base 16) and decimal (base 10)
Part 1: Octal to Decimal
Multiply each digit by its positional weight (power of 8):
$$ (257)_8 = 2 \times 8^2 + 5 \times 8^1 + 7 \times 8^0 $$
$$ = 2 \times 64 + 5 \times 8 + 7 \times 1 $$
$$ = 128 + 40 + 7 = 175 $$
$$ \boxed{(257)8 = (175){10}} $$
Part 2: Octal to Hexadecimal (via Binary)
Step 1: Convert each octal digit to 3-bit binary
| Octal Digit | 3-bit Binary |
|---|---|
| 2 | 010 |
| 5 | 101 |
| 7 | 111 |
$$ (257)_8 = (010\ 101\ 111)_2 = (10101111)_2 $$
Step 2: Regroup binary into groups of 4 (from right)
$$ 10101111 \rightarrow 1010\ 1111 $$
(No padding needed here since 8 bits = two groups of 4.)
| 4-bit Group | Hexadecimal |
|---|---|
| 1010 | A |
| 1111 | F |
Answer
$$ \boxed{(257)8 = (AF){16}} $$
Verification (decimal check): $$ (AF){16} = 10 \times 16 + 15 = 160 + 15 = 175 = (175){10} \checkmark $$
Summary
| From | To | Result |
|---|---|---|
| $(257)_8$ | Decimal | $(175)_{10}$ |
| $(257)_8$ | Hexadecimal | $(AF)_{16}$ |
2080 · 5 marks
Convert $(591.62)_{10}$ into hexadecimal and octal number system. [5]
2079 · 5 marks
Convert $(110.101)_8$ into binary and decimal number system. [5]
2078 · 5 marks
Convert 51966.57 decimal number system into octal number system and hexadecimal number system. [5]
Binary arithmetic operations
2081 · 5 marks
Perform following arithmetic operation: a) $101101 + 011011$ b) $101111 - 010101$ [5]
Binary subtraction using complements
2079 · 5 marks
Subtract $(739.57)_{10}$ - $(78.35)_2$ using both 10's and 9's complement. [5]
2078 · 5 marks
Subtract $(111000.110)_2 - (110100.101)_2$ using both 2's and 1's complement. [5]
2077 · 5 marks
Substract (1011.11- 1010.10) using 2's and l's complement. [5]
2081.2 · 5 marks
Perform $A - B$ with the given binary numbers using 1’s complement. $A = 1010100$, $B = 1000100$. [5]
Show solved answerHide answer
A − B Using 1's Complement Method
Given
- $A = 1010100$
- $B = 1000100$
- Operation: $A - B$ using 1's complement
Decimal check of inputs:
- $A = 1010100_2 = 64+16+4 = 84$
- $B = 1000100_2 = 64+4 = 68$
Solution
Step 1: 1's Complement of B
Invert every bit of $B$:
B = 1000100
1's comp = 0111011
Step 2: Add A and 1's complement of B
1010100
+ 0111011
---------
10001111
Bit-by-bit (right to left):
- $0+1 = 1$
- $0+1 = 1$
- $1+0 = 1$
- $0+1 = 1$
- $1+1 = 0$, carry 1
- $0+1+1 = 0$, carry 1
- $1+0+1 = 0$, carry 1 (carry out)
Result = $1,0001111$ (a carry out of 1 is generated).
Step 3: End-around carry
Since a carry is produced, the result is positive. Add the carry back to the 7-bit sum:
0001111
+ 1
---------
0010000
Step 4: Final Result
$$A - B = 0010000_2$$
Verification
$$0010000_2 = 16_{10}, \quad 84 - 68 = 16 \checkmark$$
Conclusion
$$A - B = 0010000_2 = 16_{10}$$
Fractional number conversions
2078 · 5 marks
Convert (1011.110) into decimal. and hexadecimal [5]
Show solved answerHide answer
Convert $(1011.110)_2$ to Decimal and Hexadecimal
Given Data
- Binary number: $(1011.110)_2$
- Integer part: $1011$
- Fractional part: $.110$
Part 1: Binary to Decimal
Multiply each bit by its positional weight (power of 2) and sum.
Integer part: $1011$
$$1 \times 2^3 + 0 \times 2^2 + 1 \times 2^1 + 1 \times 2^0 = 8 + 0 + 2 + 1 = 11$$
Fractional part: $.110$
$$1 \times 2^{-1} + 1 \times 2^{-2} + 0 \times 2^{-3} = 0.5 + 0.25 + 0 = 0.75$$
Total
$$11 + 0.75 = \boxed{11.75_{10}}$$
Part 2: Binary to Hexadecimal
Group bits into sets of 4, starting from the binary point (left for integer, right for fraction), padding with zeros where needed.
Grouping
- Integer part: $1011$ (already 4 bits)
- Fractional part: $110 \rightarrow 1100$ (pad right with one zero)
$$\underbrace{1011}{\text{integer}} . \underbrace{1100}{\text{fraction}}$$
Convert each group
| Binary Group | Decimal | Hex Digit |
|---|---|---|
| $1011$ | $11$ | $B$ |
| $1100$ | $12$ | $C$ |
Result
$$\boxed{(1011.110)2 = (B.C){16}}$$
Summary
| From | To | Result |
|---|---|---|
| $1011.110_2$ | Decimal | $11.75_{10}$ |
| $1011.110_2$ | Hexadecimal | $B.C_{16}$ |
2077 · 5 marks
Convert (1011.110) into decimal and hexadecimal. [5]
Show solved answerHide answer
Convert $(1011.110)_2$ to Decimal and Hexadecimal
Given
Given data:
- Binary number: $1011.110_2$
- Integer part: $1011$
- Fractional part: $110$
Required conversions: to decimal (base 10) and to hexadecimal (base 16).
Solution
Part A: Binary to Decimal
Integer part $1011$:
$$1\times2^3 + 0\times2^2 + 1\times2^1 + 1\times2^0 = 8 + 0 + 2 + 1 = 11$$
Fractional part $.110$:
$$1\times2^{-1} + 1\times2^{-2} + 0\times2^{-3} = 0.5 + 0.25 + 0 = 0.75$$
Combine:
$$(1011.110)2 = 11 + 0.75 = (11.75){10}$$
Part B: Binary to Hexadecimal
Group into blocks of 4 bits from the binary point outward, padding with zeros.
Integer part: $1011$ (already 4 bits)
$$1011_2 = 8+2+1 = 11 = B$$
Fractional part: $110 \rightarrow$ pad right to $1100$
$$1100_2 = 8+4 = 12 = C$$
Result:
$$(1011.110)2 = (B.C){16}$$
Check via decimal: $11.75_{10} = B + 0.75$. Fraction $0.75 = \frac{12}{16} = 0.C_{16}$. ✓
Summary
| From | To | Result |
|---|---|---|
| $(1011.110)_2$ | Decimal | $(11.75)_{10}$ |
| $(1011.110)_2$ | Hexadecimal | $(B.C)_{16}$ |
2081.2 · 5 marks
Perform the following conversion: (a) $(0.625)_{10}$ to binary. (b) $(173)_8$ to decimal. [2.5+2.5]
Complements of decimal numbers
0 · 5 marks
a) Obtain the 9's and 10's complement of i) 13579 ii) 90090 decimal number. b) Convert 6524275 octal to hexadecimal [5]
Make Unit 1 stick
Practice BIT103 with flashcards & quizzes