Day 10-12 Conversion of Computer Number (Octal, Decimal, & Hexadecimal).ppt

MalloryAlvaCastaneda 75 views 28 slides Sep 04, 2024
Slide 1
Slide 1 of 28
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28

About This Presentation

dfgkdfdfkgdflgfdgdfgdfg


Slide Content

DAY 10

Octal Numbers
•The octal number system is a base-8 system that uses digits from 0
to 7 to represent any number. It is similar to other number systems like
binary and hexadecimal. Here are some key points about octal numbers:
Base and Digits:
The base of the octal system is 8.
It uses the digits 0, 1, 2, 3, 4, 5, 6, and 7.
Representation:
Octal numbers are usually represented by binary numbers when grouped in
pairs of three.
For example, the octal number 128 is expressed as 0010102 in binary,
where 1 is equivalent to 001 and 2 is equivalent to 010.

Octal Numbers
Base and Digits:
The base of the octal system is 8.
It uses the digits 0, 1, 2, 3, 4, 5, 6, and 7.
Representation:
Octal numbers are usually represented by binary numbers
when grouped in pairs of three.
For example, the octal number 12 8 is expressed as
0010102 in binary, where 1 is equivalent to 001 and 2 is
equivalent to 010.

Octal Numbers

Octal Numbers

Applications
Octal numbers are commonly used in computer
programming because they provide a compact way to
represent binary numbers (each octal digit corresponds
to three binary digits).
1. How many symbols are used in octal numbering system?
2. Can you explain the concept of place value in octal
numbers?
3. Why are octal numbers often used in computer
programming?

Worked Example
1. Explain the purpose of dividing the decimal
number by 8 in the conversion process.
2. Describe how the remainders of the divisions
are used to form the octal number.
3. Why is it important to write the digits of the
octal number in reverse order?

Lesson Activity
Answer Learning Activity Sheet, Lesson 3 –
Activity #2

DAY 11

Decimal Numbers
A decimal number is a number that consists of a
whole number and a fractional part separated by a point
(often called the decimal point).
Whole Number Part: The whole number part
represents the integral value of the quantity. It can be any
positive or negative integer.
For example:
 In the decimal number 42.85, the whole number part is
42.
In the decimal number -123.456, the whole number part is
-123.

Decimal Numbers
Fractional Part: The fractional part represents a value smaller than one. It
appears after the decimal point.
For example:
• In the decimal number 42.85, the fractional part is 0.85.
• In the decimal number -123.456, the fractional part is 0.456.
Decimal Point: The decimal point separates the whole number part from the
fractional part. It serves as a visual indicator that we are dealing with a
decimal.
For example:
The decimal point in 42.85 separates 42 (whole) from 85 (fractional).
The decimal point in -123.456 separates -123 (whole) from 456 (fractional).
Decimal numbers allow us to express quantities that are whole plus
some part of a whole. They are commonly encountered in everyday situations,
such as grocery shopping, measurements, and financial calculations.

Decimal Numbers
Fractional Part: The fractional part represents a value smaller than one. It
appears after the decimal point.
For example:
• In the decimal number 42.85, the fractional part is 0.85.
• In the decimal number -123.456, the fractional part is 0.456.
Decimal Point: The decimal point separates the whole number part from the
fractional part. It serves as a visual indicator that we are dealing with a
decimal.
For example:
The decimal point in 42.85 separates 42 (whole) from 85 (fractional).
The decimal point in -123.456 separates -123 (whole) from 456 (fractional).
Decimal numbers allow us to express quantities that are whole plus
some part of a whole. They are commonly encountered in everyday situations,
such as grocery shopping, measurements, and financial calculations.

Let’s check your understanding
1. Explain the difference between a whole number and a
decimal number.
2. Describe the steps to round a decimal number to the
nearest hundredth.
3. How would you add two decimal numbers with different
numbers of digits to
the right of the decimal point?

Lesson Activity
Answer Learning Activity Sheet, Lesson 3 –
Activity #3

DAY 12

Hexadecimal Number
•The hexadecimal number system often simply called “hex,” is a
base-16 numeral system. Unlike our familiar base-10 (decimal)
system, which uses ten symbols (0 to 9) to represent numbers,
hexadecimal employs sixteen symbols. These symbols include the
numerals 0 to 9 and the letters A to F. Each digit in a hexadecimal
number corresponds to a specific value, allowing us to express
quantities in a compact and efficient manner.
Base-16 Representation:
• Hexadecimal uses a base value of 16. This means that each column in
a hexadecimal number represents a power of 16.
• The sixteen symbols used in hexadecimal are: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
A, B, C, D, E, and F.
• For example, the hexadecimal number “1A” represents 1 × 16 + 10 = 26
in decimal.

Hexadecimal Number
Conversion to Other Systems:
• Hexadecimal numbers can be converted to other number systems:
• To decimal (base-10): Each digit is multiplied by the corresponding
power of 16 and summed.
• To binary (base-2): Each hexadecimal digit corresponds to a 4-bit
binary representation.
• To octal (base-8): First convert to decimal, then to octal.
• These conversions are essential in computer science and digital
systems.
Hexadecimal provides a convenient way to work with binary
data and efficiently represent values in various contexts.

Hexadecimal Number

Worked Example
1. What is the base of a hexadecimal number
system?
2. How many unique symbols are used in
hexadecimal numbers?
3. Can you explain why hexadecimal numbers
are commonly used in computer science and
digital systems?

Worked Example
Example: Convert the decimal number 456 to hexadecimal
1. Divide the decimal number by 16 and record the quotient and remainder.
2. Repeat the division using the quotient from the previous step until the quotient is zero.
3. The hexadecimal number is formed by the remainders read from bottom to top.
Steps:
1. Initial Number: 456
2. First Division:
○ Divide 456 by 16.
○ Quotient: 456÷16=28456 \div 16 = 28456÷16=28 (integer part)
○ Remainder: 456 mod
  16=8456 \mod 16 = 8456mod16=8
3. So, 456 divided by 16 gives a quotient of 28 and a remainder of 8.
4. Second Division:
○ Now divide the quotient from the first division (28) by 16.
○ Quotient: 28÷16=128 \div 16 = 128÷16=1 (integer part)
○ Remainder: 28 mod
  16=1228 \mod 16 = 1228mod16=12
5. So, 28 divided by 16 gives a quotient of 1 and a remainder of 12. Note that in
hexadecimal, 12 is represented as 'C'.

Worked Example
6. Third Division:
○ Now divide the quotient from the second division (1) by 16.
○ Quotient: 1÷16=01 \div 16 = 01÷16=0 (integer part)
○ Remainder: 1mod
  16=11 \mod 16 = 11mod16=1
7. So, 1 divided by 16 gives a quotient of 0 and a remainder of 1.
8. Construct the Hexadecimal Number:
○ Write the remainders from the last to the first.
○ The remainders are 1, 12 (C in hexadecimal), and 8.
9. Therefore, the hexadecimal representation of the decimal number 456 is 1C8.
Summary
● Divide the decimal number by 16.
● Write down the remainder.
● Use the quotient for the next division.
● Repeat until the quotient is zero.
● The hexadecimal number is the remainders read from bottom to top.
The steps above show the conversion process clearly. This method can be used for any decimal
number to convert it to hexadecimal.

Lesson Activity
1.Answer Learning Activity Sheet, Lesson 3
– Activity #4
2.Multiple choice

Lesson Activity

Reflection
How do you find today’s lesson? Was
it hard? Which part of the lesson do you
find difficult?

Formative Assessment
Multiple Choice Questions:

Formative Assessment
Multiple Choice Questions:

Formative Assessment
Multiple Choice Questions:

Formative Assessment
Multiple Choice Questions:
Tags