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

Intended Learning Outcomes:: After Studying This Chapter The Student Will Be Able To

- The document discusses different number systems including binary, decimal, octal, and hexadecimal. It provides methods for converting between these different number systems. - The key points are that each number system has a base or radix - binary has base 2, decimal base 10, octal base 8, hexadecimal base 16. The document outlines steps for converting a number from one base to another, such as dividing and taking remainders to change the base. - Examples are provided to demonstrate how to convert between binary, decimal, octal, and hexadecimal numbers using the described methods. Conversion methods involve grouping bits or digits and representing them according to the target base.

Uploaded by

Joyce Cullo
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views

Intended Learning Outcomes:: After Studying This Chapter The Student Will Be Able To

- The document discusses different number systems including binary, decimal, octal, and hexadecimal. It provides methods for converting between these different number systems. - The key points are that each number system has a base or radix - binary has base 2, decimal base 10, octal base 8, hexadecimal base 16. The document outlines steps for converting a number from one base to another, such as dividing and taking remainders to change the base. - Examples are provided to demonstrate how to convert between binary, decimal, octal, and hexadecimal numbers using the described methods. Conversion methods involve grouping bits or digits and representing them according to the target base.

Uploaded by

Joyce Cullo
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

Intended Learning Outcomes:

=>After studying this chapter the student


will be able to:
-Learn about binary, octal, decimal and
hexadecimal number systems
-Learn conversions between two different
number systems
Radix representation of numbers
• Radix or base: is the total number of
symbols used to represent a value. A number
system of radix r uses a string consisting of r
distinct symbols to represent a value.
=>Digital computers represent data by means
of an easily identified symbol called a digit.
=>Numbering Systems: Each number
system has a base also called a Radix. A
decimal number system is a system of base
10; binary is a system of base 2; octal is a
system of base 8; and hexadecimal is a
system of base 16. What are these varying
bases? The answer lies in what happens when
we count up to the maximum number that the
numbering system allows. In base 10, we can
count from 0 to 9, that is,10 digits.
Converting a number from one Base to another:
=>Binary to Decimal
•Method to convert Binary to Decimal:
•1. Start at the rightmost bit.
•2. Take that bit and multiply by 2n where n is the current
position beginning at 0 and
•increasing by 1 each time. This represents a power of two.
•3. Sum each terms of product until all bits have been used.
•Example
•Convert the Binary number 101011 to its Decimal equivalent.
=1 * 25 + 0 * 24 + 1 * 23 + 0 * 22 + 1 * 21 + 1 * 20
=32 + 0 + 8 + 0 +2 + 1 = (43)10
Decimal to Binary
Method to convert a Decimal number into its
Binary equivalent:
1. Divide the decimal number by 2.
2. Take the remainder and record it on the side.
3. Divide the quotient by 2.
4. REPEAT UNTIL the decimal number cannot
be divided further.
5. Record the remainders in reverse order and
you get the resultant binary number.
Example
Convert the Decimal number 125 into its Binary
equivalent.
125 / 2 = 62 1
62 / 2 = 31 0
31 / 2 = 15 1
15 / 2 = 7 1
7/2=3 1
3/2=1 1
1/2=0 1
Answer: (1111101)2
Decimal to Octal
The method to convert a decimal number into its octal
equivalent:
1. Divide the decimal number by 8.
2. Take the remainder and record it on the side.
3. Divide the quotient by 8.
4. REPEAT UNTIL the decimal number cannot be divided
further.
5. Record the remainders in reverse order and you get the
resultant binary
Example
Convert the Decimal number 125 into its Octal equivalent.
125 / 8 = 15 5
15/ 8 = 1 7
1/8 =0 1 Answer: (175)8
Octal to Decimal
Method to convert Octal to Decimal:
1. Start at the rightmost bit.
2 . Take that bit and multiply by 8n where n is the
current position beginning at 0 and increasing by 1
each time. This represents the power of 8.
3. Sum each of the product terms until all bits have
been used.
Example:Convert the Octal number 321 to its Decimal
equivalent.
3 * 82 + 2 * 81 + 1 * 80
192+16+ 1 = (209)10
Decimal to Hexadecimal
Method to convert a Decimal number into its
Hexadecimal equivalent:
1. Divide the decimal number by 16.
2. Take the remainder and record it on the side.
3. REPEAT UNTIL the decimal number cannot
be divided further.
4. Record the remainders in reverse order and
you get the equivalent hexadecimal number.
Example: Convert the Decimal number 300 into its hexadecimal
equivalent.
300 / 16 = 18 12-(C)
18 / 16 = 1 2
1 / 16 = 0 1
Answer: (12C)16
Converting Decimal fraction to Hexadecimal
Example
Convert (0.75)10 to hexadecimal
•Multiply the given fraction by 16. Keep the integer in the product as it is
and multiply
•the new fraction in the product by 16. Continue the process and read the
integers in the
•products from top to bottom.
•Given fraction 0.75
•Multiply 0.75 by 16 12.00 = C
•Reading the integers from top to bottom 0.75 in decimal number system is
0C in Hexadecimal number system.
Hexadecimal to Decimal
Method to convert Hexadecimal to Decimal:
1. Start at the rightmost bit.
2. Take that bit and multiply by 16n where n is the
current position beginning at 0 and increasing by 1
each time. This represents a power of 16.
3. Sum each terms of product until all bits have been
used.
Example: Convert the Hexadecimal number AB to its
Decimal equivalent.
=A * 161 + B * 160
=10 * 161 + 11 * 160
=160+11 = (171)10
Binary to Hexadecimal
The hexadecimal number system uses the
digits 0 to 9 and A, B, C, D, E, F.
Method to convert a Binary number to its
Hexadecimal equivalent is:
We take a binary number in groups of 4 and
use the appropriate hexadecimal digit in it’s
place. We begin at the rightmost 4 bits. If we
are not able to form a group of four, insert 0s to
the left until we get all groups of 4 bits each.
Write the hexadecimal equivalent of each
group. Repeat the steps until all groups have
been converted.
Example
Convert the binary number 1000101 to its
Hexadecimal equivalent.
0100 0101 Note that we needed to insert a 0 to
the left of 100.
45
Answer: (45)16
Hexadecimal to Binary
Method to convert a Hexadecimal number to its
Binary equivalent is:
Convert each digit of Hexadecimal Number to it’s
binary equivalent and write them in 4 bits. Then,
combine each 4 bit binary number and that is the
resulting answer.
Example
Convert the Hexadecimal number (10AF)16 to its
Binary equivalent.
1 0 A F
0001 | 0000 | 1010 | 1111
Answer: (0001000010101111)2
Example
Convert the Hexadecimal number (A2F)16 to
its Binary equivalent.
A 2 F
1010 | 0010 | 1111
Answer: (1010 0010 1111)2
Binary to Octal and Octal to Binary
•To convert Binary to Octal, as the octal system
is a power of two (23), we can take the bits into
groups of 3 and represent each group as an
octal digit. The steps are the same for the
binary to hexadecimal conversions except we
are dealing with the octal base now.
•To convert from octal to binary, we simply
represent each octal digit in it’s three bit binary
form.
Example
Convert the Octal number (742)8 to its Binary
equivalent.
7| 4| 2
111 | 100 | 010
Answer: (111100010)2
Hexadecimal to Octal and Octal to
Hexadecimal
=>To convert Hexadecimal to Octal, Convert
each digit of Hexadecimal Number to it’s
binary equivalent and write them in 4 bits.
Then, combine each 3 bit binary number and
that is converted into octal.
Example: Convert the Hexadecimal number
(A42)16 to its Octal equivalent.
A| 4| 2
1010 | 0100 | 0010
101 | 001 | 000 | 010 Answer: (5102)8
To convert Octal to hexadecimal, convert each
digit of Octal Number to it’s binary equivalent
and write them in 3 bits. Then, combine each 4
bit binary number and that is converted into
hexadecimal.
Example
•Convert the Octal number (762)8 to its
hexadecimal equivalent.
• 7| 6 |2
•111 | 110 | 010
•0001 | 1111 | 0010
•Answer: (1F2)16
The following table summarizes the number
representation in decimal, binary, octal and
hexadecimal number system:

You might also like