Base Conversions: Decimal, Binary, Octal, Hexadecimal
Base Conversions: Decimal, Binary, Octal, Hexadecimal
2
Introduction............................................................................................................................................ 2
4.1-Conversion into the decimal base.................................................................................... 3
4.2-Conversion in binary base......................................................................................... 6
4.3-Conversion to octal base.......................................................................................... 7
4.4-Conversion in the hexadecimal base.......................................................................... 8
Chapter 4: Base Conversions
Introduction
Decimal Octal
Binary Hexadecimal
Base2 0 1
Base 8 0 12 3 4 5 6 7
Base 10 0 12 3 4 5 6 7 8 9
Base 16 0 12 3 4 5 6 7 8 9 A B C D E F
Table 2: Representation of elements from 0 to 15
10 2 8 16
0 0000 0 0
1 0001 1 1
2 0010 2 2
3 0011 3 3
4 0100 4 4
5 0101 5 5
6 0110 6 6
7 0111 7 7
8 1000 8
9 1001 9
10 1010 A
11 1011 B
12 1100 C
13 1101 D
14 1110 E
15 1111 F
Table 3: Power Bn
BASE
n 2 8 10 16
0 1 1 1 1
1 2 8 10 16
2 4 64 100 256
3 8 512 1000 4096
4 16 4096 10000 65536
5 32 32768 100000 1048576
6 64 262144 1,000,000 16777216
7 128 2097152 10,000,000 268435456
8 256 16777216 100,000,000 4294967296
9 512 134217728 1,000,000,000 68719476736
10 1024 1073741824 10000000000 1099511627776
1 3 2 7
(1011010111)2(1327)8
4.2.3-Conversion from binary base to hexadecimal base
Method:
Step 1: Cut the binary string N into packets of 4 bits from the
from the least significant bit to the most significant bit.
=1 0 A F D
(10AFD) 16
= (00010000101011111110) 2
4.4.3-Conversion from hexadecimal to octal
Method: Use the binary base as an intermediate system.
Step 1: Convert the number N from hexadecimal base to base
binary.
Step 2: Convert the obtained binary number to octal.
Base 16 Base 2 Base 8
Example: (1F0C)16= (?)8
= 1 F 0 C
= 0001 1111 0000 1100 Binary conversion
0 001 111 100 001 100 Triplet cutting
= 1 74 14 Conversion to base 8
(1F0C)16=(17414)8