0% found this document useful (0 votes)
38 views9 pages

Base Conversions: Decimal, Binary, Octal, Hexadecimal

Chapter 4 covers base conversions between various numbering systems including decimal, binary, octal, and hexadecimal. It details methods for converting numbers from one base to another, including step-by-step procedures for each conversion type. The chapter includes examples and tables to illustrate the relationships between different bases.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views9 pages

Base Conversions: Decimal, Binary, Octal, Hexadecimal

Chapter 4 covers base conversions between various numbering systems including decimal, binary, octal, and hexadecimal. It details methods for converting numbers from one base to another, including step-by-step procedures for each conversion type. The chapter includes examples and tables to illustrate the relationships between different bases.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Chapter 4: Base Conversions..................................................................................................

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

Numbering systems allow for representation


conveniently all natural numbers by means of a number
réduit de symboles.L’homme a besoin d’un système de codage pour
identifier, quantify, qualify objects. These codes allow him to
memorize, process and communicate information. Similarly
All computer tools are based on the same principles.
of calculation, although they manipulate the binary system. The conversions
by name intervene to switch from a numbering system
towards another. In this chapter, we will study how
convert a number from one numeral system to another. We
we will mainly study the systems: binary, decimal, octal and
hexadecimal.

Decimal Octal

Binary Hexadecimal

Figure 1: Possibility of conversion between bases.

Table 1: Symbols in the databases

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

4.1-Conversion in the decimal base


4.1.1-Conversion of a number N from decimal base to a base B
To convert a decimal number N to a base B, we
we can apply two methods: the method by divisions
successive and the method of successive subtractions.
Method by successive divisions:
Step 1: Iteratively divide N by B until obtaining a quotient equal to.
to 0.
Step 2: Note the remainders of each of the divisions performed since
the last division to the first.
Step 3: Write the converted remainders in the order in which they were found, but
from right to left, which gives the writing of N in base B.
Example: (125)10= (?)2

Method of successive subtractions:


Step 1: Subtract the largest power of B from N that is less than or equal to
N.
Step 2: Repeat until you get a result equal to 0.
Step 3: The number N expressed in base B is obtained by noting the
number of times a same power of B has been removed and this for
each power from the greatest appearing in order
decreasing powers.
(235)10= (?)8
4.1.2 - Conversion of a number N from base B to decimal base
Method:
Step 1: Multiply each digit by the base Bn, where is the 'weight' of
this digit.
Step 2: Add the results.
(101011)2= (?)10
= 1*25+0*24+1*23+0*22+1*21+1*20
1*32+0*16+1*8+0*4+1*2+1*1
= 32+ 0 + 8 + 0 + 2 + 1
=43
(101011)2(43)10
31248= (?)10
= 3*83 +1*82+2*81+4*80
= 3*512+1*64+2*8+4*1
= 1536 + 64+ 16+4
= 1620
(3124)8(1620)10
4.2-Conversion in the binary base
4.2.1-Conversion from binary base to decimal base
Method:
Step 1: Multiply each digit by base 2n, where is the "weight" of
this digit.
Step 2: Add the results.
(11110011)2= (?)10
=1*27+1*26+1*25+1*24+0*23+0*22+1*21+1*20
=1*128+1*64+1*32+1*16+0*8+0*4+1*2+1*1
=128+64+32+16+0+0+2+1
(11110011)2(243)10

4.2.2-Conversion from binary to octal


Method:
Step 1: Cut the binary string into packets of three bits from the right
to the left.
Step 2: Convert the number expressed by each packet to base 8
correspondent.
Example :(1011010111)2= (?)8
= 1 011 010 111

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.

Step 2: Convert each quartet


Example: (1010111011)2= (?)16
= 10 1011 1011
= 2B B
(1010111011)2(2BB)16
4.3-Conversion to octal base
4.3.1-Conversion from octal base to decimal base
Step 1: Multiply each digit by the base 8n, where is the “weight” of
this digit.
Step 2: Add the results.
Example: (63124)8 = (?)10
6 times 84 +3*83+1*82+2*81+4*80
= 6*4096+3*512+1*64+2*8+4*1
= 4096 + 1536 + 64+ 16 +4
= 1620
(63124)8(5716)10
4.3.2-Conversion from octal to binary
Conversion of a number N expressed in base 8 to base 2
done through the method below:
Method:
Step 1: Replace each digit of the number with their
binary equivalent on 3 bits.
Step 2: Convert a number N expressed in base 2 to base 8
is done by slicing the binary string N into packets of 3 bits
from the least significant bit to the most significant bit for the part
entire.
(705)8= (?)2
= 7 05
= 111 000 101
(705)8(111000101)2
4.3.3-Conversion from octal base to hexadecimal base
Method: Use the binary base as an intermediate system.
Step 1: Convert the number N from octal base to binary base.
Step 2: Convert the obtained binary number to hexadecimal.
Base 8 Base 2 Base 16
Example: (1076)8= (?)16
= 10 7 6

= 001 000 111 110 Conversion to base 2


0010 0011 1110 Cutting into quartet
= 2 3 E Conversion to base 16
(1076)8(23E)16
4.4-Conversion in the hexadecimal base
4.4.1-Conversion from hexadecimal to decimal base
Step 1: Multiply each digit by the base 16n, where is the “weight” of
this digit.
Step 2: Add the results.
Example: ( 19)16= (?)10
= 1 9
= 10 15 1 9
= 10*163+15*162+1*161+9*160
=10*4096+15*256+1*16+9*1
= 40960 + 3840 + 16 + 9
( 19)16(44825)10
4.4.2-Conversion from hexadecimal base to binary base
Method:
Step 1: Convert the number N from hexadecimal to base
binary.
Step 2: Copy the obtained binary number from right to left.
(10AFD) = (?) 16 2

=1 0 A F D

0001 0000 1010 1111 1110

(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

You might also like