Other number bases

Table of contents

  1. Introduction
  2. Octal Number System
  3. Hexadecimal Number System
  4. Converting between bases
    1. Octal to Decimal conversion
    2. Decimal to Octal conversion
    3. Hexadecimal to Decimal conversion
    4. Decimal to Hexadecimal conversion

Introduction

  • Before, learning about other number bases let first understand what is Number Systems. It is a writing system used for expressing numbers. We can express number in various ways, but most commonly used systems are Binary Number System, Decimal Number System, Octal Number System and Hexadecimal Number System.
  • Now let’s have brief information about Number Bases. A number Base represents how many number of different digits or combination of digits and alphabets are used to represent a number in a particular Number System.
  • Positional number systems uses the position of a digit to know the contribution of that particular digit in the number. I guess it might look little difficult to understand, so let’s discuss it using an example of a most popular Positional Number System called as Decimal System.

According to Decimal System 123 can be represented as 1*100 + 2*10 + 3*1. It shows that as 1 is on hundredth place so its contribution in the number will be 1*100=100 and so on.

Octal Number System

Octal Number System has 8 as the base of the number. It uses digits from 0-7

Hexadecimal Number System

Hexadecimal Number System has 16 as the base of the number. It uses digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E and F

Converting between bases

Octal to Decimal conversion

  • STEP 1: Write the decimal value of each digit on top of them respectively. The value which you seek to write is 8(place value from right) beginning from 0 i.e., 80, 81, 88 …. continuing up to 87.
  • STEP 2: Now, multiply each digit of octal number with its value.
  • STEP 3: Add ‘em all.
  • STEP 4: Result is ready :)

Decimal to Octal conversion

  • STEP 1: Divide the decimal number by 8
  • STEP 2: At each step store the value of remainder in reverse order.
  • STEP 3: Result is ready :)

Hexadecimal to Decimal conversion

  • STEP 1: Write the decimal value of each digit on top of them respectively. The value which you seek to write is 16(place value from right) beginning from 0 i.e., 160, 161, 168 …. continuing up to 167.
  • STEP 2: Now, multiply each digit of octal number with its value.
  • STEP 3: Add ‘em all.
  • STEP 4: Result is ready :)

Decimal to Hexadecimal conversion

  • STEP 1: Divide the decimal number by 16
  • STEP 2: At each step store the value of remainder in reverse order (If the remainder is greater than 9 represent it using alphabet from the hex table For e.g., Use A if the remainder is 10).
  • STEP 3: Result is ready :)

Note: Once you get the number in decimal form, you can convert decimal format into binary as shown before.