0% found this document useful (0 votes)
2 views

Conversion_Between_Bases

The document explains methods for converting numbers between different bases, including decimal, binary, octal, and hexadecimal. It provides examples of conversions from decimal to binary, octal, and hexadecimal, as well as the reverse process of converting from binary, octal, and hexadecimal back to decimal. Additionally, it highlights the relationship between binary, octal, and hexadecimal due to their base properties.

Uploaded by

aub.tho
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Conversion_Between_Bases

The document explains methods for converting numbers between different bases, including decimal, binary, octal, and hexadecimal. It provides examples of conversions from decimal to binary, octal, and hexadecimal, as well as the reverse process of converting from binary, octal, and hexadecimal back to decimal. Additionally, it highlights the relationship between binary, octal, and hexadecimal due to their base properties.

Uploaded by

aub.tho
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Conversion between Bases

Numbers can be converted from one base to another using different methods. Decimal
numbers can be converted to different bases by dividing the decimal number by the new base,
then successively dividing the resulting quotient by the new base until the resulting quotient is
zero. The remainder from each division taken from last to first represents the digits of the
number in the new base.

Decimal to Binary
For example converting the number 1310 to binary

Division by 2 Quotient Remainder


13 / 2 6 1
6/2 3 0
3/2 1 1
1/2 0 1

The remainder column taken from bottom to top gives 11012 which is equivalent to 1310.

Decimal to Octal
The same process can be done for other bases simply by using the base number instead of 2.
For example converting the number 8810 to octal (base 8):

Division by 8 Quotient Remainder


88 / 8 11 0
11 / 8 1 3
1/8 0 1

The remainder column taken from bottom to top gives 1308 which is equivalent to 8810.
Decimal to Hexadecimal
The same process can be used to convert 12310 to hexadecimal (base 16):

Division by 16 Quotient Remainder

123 / 16 7 11

7 / 16 0 7

Taking the numbers in the remainder column from bottom to top gives 7B16 which is equivalent
to 12310. The letter B is used to represent the digit value 11 in hexadecimal. For digit values 10
to 15 the letters A to F are used: A = 10, B = 11, C = 12, D = 13, E = 14 and F = 15.

In order to convert from any base to decimal we simply multiply each digit by powers of
the base which increase from right to left, starting with a power of zero. The sum of the resulting
products is the number in base 10.

Binary to Decimal
10112 can be converted to decimal as follows:
1 x 23 + 0 x 22 + 1 x 21 + 1 x 20 =8+0+2+1 = 1110

Octal to Decimal
1308 can be converted to decimal as follows:
1 x 82 + 3 x 81 + 0 x 8 0 = 64 + 24 = 8810

Hexadecimal to Decimal
7B16 can be converted to decimal as follows:
7 x 161 + 11 x 160 = 112 + 11 = 12310

The letter B is replaced with the corresponding digit value 11 in order to perform the conversion.
Hexadecimal and octal can be easily converted to and from binary as 8 and 16 are both
powers of 2. For this reason these two bases, particularly hexadecimal, are used frequently in
computing.

Octal to Binary
Each digit in base 8 can be represented by a combination of three bits in binary. The method
previously discussed can be used for converting each digit to binary.

For example the number 2548 can be converted to binary as follows:

2 = 010 in binary
5 = 101 in binary
4 = 100 in binary

2548 = 0101011002

The binary number can be converted back to octal by dividing it into groups of three and getting
the decimal value of each combination.

Hexadecimal to Binary
Each digit in hexadecimal can be represented by a combination of four bits in binary. The first
method presented can be used for converting each digit to binary.

For example the number 2FA16 can be converted to binary as follows:

2 = 0010 in binary
F (15) = 1111 in binary
A (10) = 1010 in binary

2FA16 = 0010111110102

The binary number can be converted back to hexadecimal by dividing into groups of four and
getting the decimal value for each combination, taking care to represent values 10 to 15 with the
appropriate letter.
The following table shows the equivalent binary, octal, decimal and hexadecimal representation
for the first fifteen positive integers.

Binary Octal Decimal Hexadecimal


0000 0 0 0
0001 1 1 1
0010 2 2 2
0011 3 3 3
0100 4 4 4
0101 5 5 5
0110 6 6 6
0111 7 7 7
1000 10 8 8
1001 11 9 9
1010 12 10 A
1011 13 11 B
1100 14 12 C
1101 15 13 D
1110 16 14 E
1111 17 15 F

You might also like