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

Las3 w3 Number System The Language of Computer

This document is a Learning Activity Sheet for Computer Programming 11, focusing on number systems, including decimal, binary, octal, and hexadecimal. It outlines learning objectives, terminology, and provides conversion methods between these number systems, along with example problems and activities for students. The document emphasizes the importance of understanding these concepts for programming and data manipulation.

Uploaded by

cabotajedexter9
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)
0 views9 pages

Las3 w3 Number System The Language of Computer

This document is a Learning Activity Sheet for Computer Programming 11, focusing on number systems, including decimal, binary, octal, and hexadecimal. It outlines learning objectives, terminology, and provides conversion methods between these number systems, along with example problems and activities for students. The document emphasizes the importance of understanding these concepts for programming and data manipulation.

Uploaded by

cabotajedexter9
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
You are on page 1/ 9

LEARNING ACTIVITY SHEETS

COMPUTER PROGRAMMING 11
Week 3 Quarter 1

NUMBER SYSTEM: THE LANGUAGE OF COMPUTER

pixabay.com

JAMAICA Q. RAMOS
Subject Teacher
Name: __________________________________________________
Grade and Section: __________________________ Date:________________________

To the learners:
Read and comprehend every concept discussed in this Learning Activity Sheet. Answer all
questions independently and honestly as you follow carefully all instructions indicated in each activity.
Write your answer in your notebook. Let your parents or guardian sign at the last page of your answer
sheet.
God bless and be the best learner you can be!

To the facilitators:
Work with patience and smile with success. Always be available to offer support and advice to
the learner when needed. Provide the necessary scaffolding and encourage him/her to accomplish task.
Also, remind him/her to accomplish all the activities indicated in the Learning Activity Sheet.

LEARNING OBJECTIVES:
At the end of this lesson, the students should be able to:
1. Identify components and objects that could be measured;
2. Perform conversion and calculation

Introduction
According to Merriam Webster, mensuration is the geometry applied to the computation of
magnitude lengths, areas or volumes from given dimensions or angles. In other words, it is the “act of
measuring”. As programmers, it is essential to understand how data is being translated from one form
to another inside the computer.

TERMINOLOGY:
NUMBER SYSTEMS
Number System or Numeral System is any notation that represents numerals or numbers. Some
are as follows.
A. Decimal.
Most common number system we have ever known and the basis of how we count. It has a
base of 10. This means that the numbers are notated with one digit starting a sequence from 1 to 9,
ending the sequence with a 0 prefixed with another digit, and start another sequence from 1 to 9.
Observe the illustration below.
Illustration 1:
1 11 21 91 991 9991
2 12 22 92 992 9992
3 13 23 93 993 9993
4 14 24 94 994 9994
5 15 25 95 995 9995
6 16 26 … 96 … 996 … 9996
7 17 27 97 997 9997
8 18 28 98 998 9998
9 19 29 99 999 9999
10 20 30 100 1000 10000

B. Binary
This is considered as the computer machine language. Note that the computers can only
understand and perform the manipulation of 0𝑠 and 1𝑠 . 0𝑠 and 1 are called binary digits. Thus,
binary has a base of 2. In terms if counting, this means that a digit is added in sequence for every
two counts using only the symbols 0 and 1.
See illustration below.
Illustration 2:

Binary Decimal Binary Decimal Binary Decimal


0 1 110 6 1100 12
1 2 111 7 1101 13
10 3 1000 8 1110 14
11 4 1001 9 1111 15
100 5 1010 10 10000 16
101 6 1011 11

C. Octal
It is a result of simplifying the representation of characters in programming a computer.
Since programmer cannot deviate from the binary system since it is the very principle in which the
computer performs its tasks, they thought of grouping the binary bits into groups of three (3) called
octets. Thus, 23 is equal to 8, deriving the name octal. This number system has a base of 8 from 0-
7 as illustrated below.

Illustration 3:
Octal Decimal Octal Decimal Octal Decimal
0 0 6 6 14 12
1 1 7 7 15 13
2 2 10 8 16 14
3 3 11 9 17 15
4 4 12 10 20 16
5 5 13 11
D. Hexadecimal
This is a spin off from the octal system. Due to significant developments, the instructions and
character representations fed into it have grown as well. Again, not having the option do deviate from
its binary root, the hexadecimal system was introduced. The hexadecimal system has a base or radix of
16.

Illustration 4:
Dec 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Hex 0 1 2 3 4 5 6 7 8 9 A B C D E F

Dec 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Hex 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
CONVERSION AND CALCULATION
A. Decimal Conversion
STEPS:
1. Divide the decimal number by the base of the number system you want to convert to.
2. Write down the remainder of the division operation.
3. Repeat steps (1) and (2) for each quotient you get until you cannot divide the quotient by
the radix any further.
4. Write down the remainder for each division operation in sequence from bottom to top to get
the converted number.

Example: Convert the decimal number 250 to binary, octal and hexadecimal numbers
respectively.

• Decimal to Binary

250 ÷ 2 = 125 remainder 0


125 ÷ 2 = 62 remainder 1
62 ÷ 2 = 31 remainder 0
31 ÷ 2 = 15 remainder 1
15 ÷ 2 = 7 remainder 1
7÷2=3 remainder 1
3÷2=1 remainder 1
1÷2=0 remainder 1

Thus, 25010 = 111110102

• Decimal to Octal

250 ÷ 8 = 31 remainder 2
31 ÷ 8 = 3 remainder 7
3÷8=0 remainder 3
Thus, 25010 = 3728

• Decimal to Hexadecimal

250 ÷ 16 = 15 remainder 10
15 ÷ 16 = 0 remainder 15
Note: When we are converting decima to hexadecimal, two-digit number has a corresponding character.
For 15 we have “F” and for 10 we have “A”.
Thus, 25010 = 𝐹𝐴16

ACTIVITY 1: DECIMAL CONVERSION


Directions: Convert the following decimal to binary, octal and hexadecimal
1. 75
2. 250
3. 198

B. Binary Conversion
• Binary to Decimal
To convert a binary number to decimal number, multiply each value of the binary bit by the
powers of two (2𝑥 ), where (x) is the (ordinal bit number -1). Then, add them altogether
Example:

11012 = (1𝑥23 ) + (1𝑥22 ) + (0𝑥21 ) + (1𝑥20 )


= (1𝑥8) + (1𝑥4) + (0𝑥2) + (1𝑥1)
= (8) + (4) + (0) + (1)
= 1310
• Binary to Octal

STEPS:
1. Arrange the given binary bits in groups of 3 starting from the least significant digit (right-
most digit).
1100011011002 = 110_001_101_100
2. Convert each group to its octal equivalent by using the formula:
𝑓 (𝑎, 𝑏, 𝑐 ) = (𝑎𝑥4) + (𝑏𝑥2) + 𝑐

110_001_101_100
(1𝑥4) + (1𝑥2) + 0 = 4 + 2 + 0 = 6
(0𝑥4) + (0𝑥2) + 1 = 0 + 0 + 1 = 1
(1𝑥4) + (0𝑥2) + 1 = 4 + 0 + 1 = 5
(1𝑥4) + (0𝑥2) + 0 = 4 + 0 + 0 = 4

Thus, 1100011011002 = 61548


• Binary to Hexadecimal
Converting from binary to hexadecimal is pretty much like converting from binary to octal. The
only difference is that instead of grouping the binary string in sets of 3, you will need to group them in
sets of 4 to get a single hexadecimal value for each set.
STEPS:
1. Arrange the given binary bits in groups of 4 starting from the least significant digit (right-
most digit). Use leading “0”on the most significant digit if necessary to complete the
grouping
1101001110111002 = 0110_1001_1101_1100
Convert each group to its hexadecimal equivalent by using the formula:
𝑓 (𝑎, 𝑏, 𝑐, 𝑑 ) = (𝑎𝑥8) + (𝑏𝑥4) + (𝑐 + 2) + 𝑑
0110_1001_1101_1100
(0𝑥8) + (1𝑥4) + (1𝑥2) + 0 = 0 + 4 + 2 + 0 = 6
(1𝑥8) + (0𝑥4) + (0𝑥2) + 1 = 8 + 0 + 0 + 1 = 9
(1𝑥8) + (1𝑥4) + (0𝑥2) + 1 = 8 + 4 + 0 + 1 = 13 = 𝐷16
(1𝑥8) + (1𝑥4) + (0𝑥2) + 0 = 8 + 4 + 0 + 0 = 12 = 𝐶16

𝑇ℎ𝑢𝑠, 1101001110111002 = 69𝐷𝐶16 .

ACTIVITY 2: BINARY CONVERSION


Directions: Convert the following binary to decimal, octal and hexadecimal
1. 1000100012
2. 1001000002 +2 + 0 = 6
+2 + 0 = 6
C. OCTAL CONVERSION
+2 + 0 = 6
• Octal to Decimal
+2 + 0 = 6
Octal to decimal conversion is no different from binary to decimal conversion. Only this time,
instead of using the powers of 2, you use the power of 8.
Let us consider the example below.
Example:

70418 = (7𝑥83 ) + (0𝑥82 ) + (4𝑥81 ) + (1𝑥80 )


= (7𝑥512) + (0𝑥64) + (4𝑥8) + (1𝑥1)
= (3584) + (0) + (32) + (1)
= 361710
• Octal to Binary
STEPS:
1. First convert the octal to decimal

70418 = (7𝑥83 ) + (0𝑥82 ) + (4𝑥81 ) + (1𝑥80 )


= (7𝑥512) + (0𝑥64) + (4𝑥8) + (1𝑥1)
= (3584) + (0) + (32) + (1)
= 361710

2. Convert the decimal formed to binary


3617 ÷ 2 = 1808 reminder 1
1808 ÷ 2 = 904 reminder 0
904 ÷ 2 = 452 reminder 0
452 ÷ 2 = 226 reminder 0
226 ÷ 2 = 113 reminder 0
113 ÷ 2 = 56 reminder 1
56 ÷ 2 = 28 reminder 0
28 ÷ 2 = 14 reminder 0
14 ÷2=7 reminder 0
7 ÷2=3 reminder 1
3 ÷2=1 reminder 1
1 ÷2=0 reminder 1

Thus, 70418 = 1110001000012 .

• Octal to Hexadecimal
STEPS:

1. Convert the octal to decimal

70418 = (7𝑥83 ) + (0𝑥82 ) + (4𝑥81 ) + (1𝑥80 )


= (7𝑥512) + (0𝑥64) + (4𝑥8) + (1𝑥1)
= (3584) + (0) + (32) + (1)
= 361710

2. Convert the decimal to hexadecimal

3617 ÷ 16 = 226 reminder 1


226 ÷ 16 = 14 reminder 2
14 ÷ 16 = 0 reminder 14 = “E”
Thus, 70418 = 𝐸212 .

ACTIVITY 3: OCTAL CONVERSION


Directions: Convert the following octal to binary, decimal and hexadecimal
1. 80208
2. 5428
D. HEXADECIMAL CONVERSION
• Hexadecimal to Decimal
To convert from hexadecimal number to decimal number just like converting any other number
system to decimal, we multiply each hexadecimal bit with the powers of the base number, in this case
we use 16. However, please note and remember that the hexadecimal number system uses alphabet
characters as well to represent the decimal numbers from 10 to 15. Use the table below as reference.

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

Example:
𝐹4𝐶216
Based on the table, 𝐹16 = 1510 and 𝐶16 = 1210 . So, we will just substitute the decimal values
to the letters in the given hexadecimal number notation.
𝐹4𝐶216 = (15𝑥163 ) + (4𝑥162 ) + (12𝑥161 ) + (2𝑥160 )
= (15𝑥4096) + (4𝑥256) + (12𝑥16) + (2𝑥1)
= 61440 + 1024 + 192 + 2
= 6265810
• Hexadecimal to Binary
To convert, we will just use the short method of converting each hexadecimal bit to binary
strings, this time in groups of 4. You may refer to the table above as well to get the binary equivalent
of each hexadecimal digit. Thus,

𝐹4𝐶216 = 1111 0100 1100 0010 (𝑡ℎ𝑒𝑛 𝑝𝑢𝑡 𝑡ℎ𝑒𝑚 𝑎𝑙𝑡𝑜𝑔𝑒𝑡ℎ𝑒𝑟)


= 11110100110000102
• Hexadecimal to Octal
STEPS:

1. Get the binary conversion of the hexadecimal to be converted.

𝐹4𝐶216 = 1111 0100 1100 0010 (𝑡ℎ𝑒𝑛 𝑝𝑢𝑡 𝑡ℎ𝑒𝑚 𝑎𝑙𝑡𝑜𝑔𝑒𝑡ℎ𝑒𝑟)


= 11110100110000102
2. Regroup the binary string into groups of 3 then get the octal value of each binary group.

1111010011000010 = 001 111 010 011 000 010

001 111 010 011 000 010


(0𝑥4) + (0𝑥2) + 1 = 0 + 0 + 1 = 1
(1𝑥4) + (1𝑥2) + 1 = 4 + 2 + 1 = 7
(0𝑥4) + (1𝑥2) + 0 = 0 + 2 + 0 = 2
(0𝑥4) + (1𝑥2) + 1 = 0 + 2 + 1 = 3
(0𝑥4) + (0𝑥2) + 0 = 0 + 0 + 0 = 0
(0𝑥4) + (1𝑥2) + 0 = 0 + 2 + 0 = 2
Thus, 𝐹4𝐶216 = 1723028 .

ACTIVITY 4: HEXADECIMAL CONVERSION


Directions: Convert the following hexadecimal to+2 + 0decimal
binary, = 6 and octal
1. 𝐵7516 +2 + 0 = 6
2. 𝐴𝐵𝐶16
+2 + 0 = 6
+2 + 0 = 6
ASSESSMENT +2 + 0 = 6
Directions: Complete the table below by converting to the different number systems.
+2 + 0 = 6
Decimal Binary Octal Hexadecimal
11001
165
566
1CC2
12621

REFLECTION

What are you thinking now, after reading and doing all the activities in this activity sheet? Your
reflection must be at least three paragraphs.
1st paragraph (In this activity, I learned that…)
2nd paragraph (I realized that…)
3rd paragraph (I will, or I am committed to or I promise to…)
_________________________________
PARENT’S NAME AND SIGNATURE
References:

• Innovative Training Works, Inc (2016), Computer Programming, Rex Bookstore

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy