BIT103 · 2081 · 5 marks
Convert (257)₈ into hexadecimal and decimal number system.
Convert (257)₈ into hexadecimal and decimal number system. [5]
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}$ |
Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.