Number System 2

Author: Ravi Poswal

System

Base

Range

Binary

2

0, 1

Octal

8

0 – 7

Decimal

10

0 – 9

Hexadecimal

16

0 – 9, A – F

V. Converting Numbers from One Base to Another

A) Converting Any Base to Decimal

Method:

  1. Find the position (column) value of each digit
  2. Multiply each digit by its position value
  3. Add up all the products

Example — Convert 4706₈ to Decimal

4706₈ = (4×8³) + (7×8²) + (0×8¹) + (6×8⁰)

       = 2048 + 448 + 0 + 6

       = 2502₁₀

B) Converting Decimal to Any Base — Division-Remainder Method

Method:

  1. Divide the decimal number by the new base
  2. Write down the remainder — this is the rightmost (last) digit of the answer
  3. Divide the quotient again by the same base
  4. Repeat this process until the quotient becomes 0
  5. Read all the remainders from BOTTOM to TOP — that gives the final answer

Example — Convert 952₁₀ to Octal

952 ÷ 8  =  119   remainder = 0

119 ÷ 8  =   14   remainder = 7

 14 ÷ 8  =    1   remainder = 6

  1 ÷ 8  =    0   remainder = 1

Reading remainders bottom to top:  952₁₀ = 1670₈

C) Converting One Base to Another Base (Not Decimal)

Method:

  1. First convert the given number to decimal
  2. Then convert that decimal number to the target base

Example — Convert 545₆ to Base 4

Step 1: Convert 545₆ to decimal

  545₆ = (5×6²)+(4×6¹)+(5×6⁰) = 180+24+5 = 209₁₀

Step 2: Convert 209₁₀ to base 4

  209÷4=52 rem 1   52÷4=13 rem 0   13÷4=3 rem 1   3÷4=0 rem 3

  Reading bottom to top: 209₁₀ = 3101₄

So, 545₆ = 3101₄

VI. Shortcut Conversion Tricks

Because Binary, Octal and Hexadecimal are all closely related (8 = 2³ and 16 = 2⁴), we can convert between them quickly — WITHOUT going through decimal.

A) Binary → Octal

  1. Starting from the right, group the binary digits into sets of 3
  2. Convert each group of 3 bits into its equivalent octal digit

Example — Convert 1101010₂ to Octal

Group in 3s:   001   101   010

Convert:        1     5     2

Answer: 1101010₂ = 152₈

B) Octal → Binary

  1. Convert each octal digit into a 3-bit binary group
  2. Join all the groups together

Example — Convert 562₈ to Binary

5 = 101      6 = 110      2 = 010

Answer: 562₈ = 101110010₂

C) Binary → Hexadecimal

  1. Starting from the right, group the binary digits into sets of 4
  2. Convert each group of 4 bits into its equivalent hex digit

Example — Convert 111101₂ to Hexadecimal

Group in 4s:   0011   1101

Convert:         3      D

Answer: 111101₂ = 3D₁₆

D) Hexadecimal → Binary

  1. Convert each hex digit into a 4-bit binary group
  2. Join all the groups together

Example — Convert 2AB₁₆ to Binary

2 = 0010     A = 1010     B = 1011

Answer: 2AB₁₆ = 001010101011₂

VII. Fractional Numbers

Just like the decimal system has digits after the decimal point (e.g. 3.14), other number systems can also have digits after their own 'point' (binary point, octal point, etc.).

Rule:

  • Digits to the LEFT of the point use positive powers of the base: base⁰, base¹, base², …
  • Digits to the RIGHT of the point use negative powers of the base: base⁻¹, base⁻², base⁻³, …

Example — Binary Fraction: 110.101₂

110.101₂ = (1×2²)+(1×2¹)+(0×2⁰)+(1×2⁻¹)+(0×2⁻²)+(1×2⁻³)

          = 4 + 2 + 0 + 0.5 + 0 + 0.125

          = 6.625₁₀

 

Example — Octal Fraction: 127.54₈

127.54₈ = (1×8²)+(2×8¹)+(7×8⁰)+(5×8⁻¹)+(4×8⁻²)

         = 64 + 16 + 7 + 0.625 + 0.0625

         = 87.6875₁₀