Las3 w3 Number System The Language of Computer
Las3 w3 Number System The Language of Computer
COMPUTER PROGRAMMING 11
Week 3 Quarter 1
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:
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
• 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
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:
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
• Octal to Hexadecimal
STEPS:
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,
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: