ITKokka
Lesson 3 ยท Note 8

Number System Conversions (Octal - Binary & Hexadecimal)

๐Ÿ“Œ The Short Note

Download

๐Ÿ“– Explanation

Octal to Binary and Hexadecimal Conversions

An octal number can be converted into binary or hexadecimal without repeatedly dividing the number. These conversions use the relationship between the bases: each octal digit corresponds to exactly 3 binary bits, while hexadecimal digits correspond to 4 binary bits.

This note explains how to convert octal numbers to binary and how to convert octal numbers to hexadecimal through binary.

1. Octal to Binary Conversion

The octal number system has base 8 and uses the digits 0 to 7. The binary number system has base 2 and uses only 0 and 1.

Since (8 = 2^3), each octal digit can be represented by a group of exactly 3 binary digits (bits). Therefore, converting an octal number to binary is a matter of replacing each octal digit with its 3-bit binary equivalent.

Method

  1. Take each octal digit separately.
  2. Replace each digit with its 3-bit binary equivalent.
  3. Write the binary groups in the same order as the original octal digits.
  4. Join the groups to form the binary number.

Octal-to-binary reference table

Octal digit3-bit binary
0000
1001
2010
3011
4100
5101
6110
7111

Every group must contain three bits. Add leading zeros when necessary. For example, octal digit 3 is written as 011, not just 11, because the conversion uses 3-bit groups.

Example 1: Convert (57_8) to binary

Replace each octal digit with its 3-bit equivalent:

Octal digit57
3-bit binary101111

Join the groups in the same order:

[ 57_8 = 101111_2 ]

Example 2: Convert (306_8) to binary

Convert each digit separately. The zero must also be represented by three bits.

Octal digit306
3-bit binary011000110

Join the groups:

[ 306_8 = 011000110_2 ]

The leading zero may be removed when writing the final binary value, so (11000110_2) represents the same value. Keeping the leading zero is useful here because it shows the original 3-bit grouping.

2. Octal to Hexadecimal Conversion

The hexadecimal number system has base 16. It uses the digits 0 to 9 and the letters A to F, where A represents 10, B represents 11, C represents 12, D represents 13, E represents 14, and F represents 15.

There is no single fixed-width digit replacement from octal to hexadecimal. Instead, convert the octal number to binary first, then group the binary digits into sets of four from the right. Each 4-bit group corresponds to one hexadecimal digit.

Method

  1. Convert every octal digit into its 3-bit binary equivalent.
  2. Join the binary groups in the original order.
  3. Starting from the right, divide the binary digits into groups of 4.
  4. If the leftmost group has fewer than 4 bits, add leading zeros to complete it.
  5. Convert each 4-bit group to its hexadecimal equivalent.
  6. Write the hexadecimal digits from left to right.

4-bit binary-to-hexadecimal reference table

BinaryHexadecimalBinaryHexadecimal
0000010008
0001110019
001021010A
001131011B
010041100C
010151101D
011061110E
011171111F

Example 1: Convert (57_8) to hexadecimal

Step 1: Convert octal to binary.

[ 5_8 = 101_2,\qquad 7_8 = 111_2 ]

Therefore:

[ 57_8 = 101111_2 ]

Step 2: Group the binary digits into sets of four from the right.

[ 101111_2 \rightarrow 0010\ 1111_2 ]

Two leading zeros are added to complete the leftmost 4-bit group. These zeros do not change the value.

Step 3: Convert each group to hexadecimal.

4-bit binary groupHexadecimal digit
00102
1111F

Read the hexadecimal digits from left to right:

[ 57_8 = 2F_{16} ]

Example 2: Convert (306_8) to hexadecimal

Step 1: Convert octal to binary.

[ 3_8 = 011_2,\qquad 0_8 = 000_2,\qquad 6_8 = 110_2 ]

[ 306_8 = 011000110_2 ]

Step 2: Group into 4-bit sets from the right.

[ 011000110_2 \rightarrow 0001\ 1000\ 0110_2 ]

The leftmost group is completed with leading zeros. The groups are 0001, 1000, and 0110.

Step 3: Convert each group to hexadecimal.

4-bit binary groupHexadecimal digit
00011
10008
01106

Therefore:

[ 306_8 = 186_{16} ]

3. Why the Conversion Uses Binary

Octal and binary are closely related because the octal base is a power of two:

[ 8 = 2^3 ]

That is why one octal digit always maps to three binary bits.

Hexadecimal is also a power-of-two number system:

[ 16 = 2^4 ]

Therefore, one hexadecimal digit maps to four binary bits. When converting octal to hexadecimal, binary provides a convenient intermediate representation:

The grouping for hexadecimal must start at the right-hand side because the rightmost digit represents the least significant part of the number. Adding zeros to the left completes the group without changing the number's value.

4. Important Points for Examinations

  • Each octal digit is replaced by exactly 3 binary bits.
  • Keep the original order of the octal digits when converting to binary.
  • To convert octal to hexadecimal, convert to binary first.
  • Group binary digits into 4-bit groups from the right for hexadecimal conversion.
  • Add leading zeros to complete a group; do not add zeros to the right.
  • Use A to F for hexadecimal values 10 to 15.
  • The number's value stays the same; only its representation changes.

Key Idea: Octal to binary uses 3-bit replacement. Octal to hexadecimal uses 3-bit replacement followed by 4-bit grouping from the right.

5. Quick Practice

Convert each octal number as requested.

  1. (110_8) to binary
  2. (72_8) to binary
  3. (346_8) to hexadecimal
  4. (1F_{16}) is not an octal value; check that the given number uses only digits 0 to 7 before beginning an octal conversion.

Answers

  1. (110_8 = 001\ 001\ 000_2), or (1001000_2) without the leading zeros.
  2. (72_8 = 111\ 010_2 = 111010_2).
  3. (346_8 = 011\ 100\ 110_2 = 0111\ 0011\ 0_2). Grouping correctly from the right gives (0001\ 1100\ 1110_2 = 1CE_{16}).

Summary

To convert an octal number to binary, replace every octal digit with its 3-bit binary equivalent and join the groups in the same order. To convert octal to hexadecimal, first perform that octal-to-binary conversion, then group the bits into sets of four from the right and convert each group to a hexadecimal digit. Leading zeros may be added on the left to complete a group, but the value of the number does not change.

Share:
โ† Number System Conversions (Binary - Octal & Hexadecimal)Number System Conversions (Hexadecimal - Binary & Octal) โ†’