You are on page 1of 10

SAINT MICHAEL’S COLLEGE OF LAGUNA

OLD NATIONAL ROAD, PLATERO, CITY OF BIÑAN, LAGUNA

Learning
Packet Number System
1

Learning Objectives:
At the end of the lesson, the students are expected to:

1. identify the different number systems.


2. identify the base and the digits used for each number system.
3. convert number systems from one base to another.

Binary Number System


The word Binary comes from "Bi-" meaning two. We see "bi-" in words such as
"bicycle" (two wheels) or "binocular" (two eyes).
A single Binary digit (like "0" or "1") is called a "bit". For example, 11010 is five
bits long. The word bit is made up from the words "Binary digit"
Binary is a base 2 numbering system which is made up of two numbers: 0 and
1. 0 means OFF and 1 means ON. The computer’s central processing unit (CPU)
only recognizes these two states – ON and OFF. It is the foundation for all Binary
code, which is used in computer and digital systems.
A Binary Number is made up of only 0s and 1s. If larger values than 1 are needed,
extra columns are added to the left. Each column value is now twice the value
of the column to its right. For example, the decimal value three is written 11 in
Binary (1 two + 1 one).
SAINT MICHAEL’S COLLEGE OF LAGUNA
OLD NATIONAL ROAD, PLATERO, CITY OF BIÑAN, LAGUNA

Converting Decimal to Binary using long division method:


Conversion can be done by dividing the decimal number by 2 repeatedly to give
a result and a remainder of either a “1” or a “0” until the final result is 0.
Example:
1. Convert 29410 into its Binary number equivalent.

Dividing each decimal number


294 ÷ 2 result 147 remainder 0
by “2” as shown will give a result
plus a remainder.
147 ÷ 2 result 73 remainder 1

73 ÷ 2 result 36 remainder 1 If the decimal number being


divided is even then the result
36 ÷ 2 result 18 remainder 0 will be whole and the remainder
will be equal to “0”. If the
18 ÷ 2 result 9 remainder 0 decimal number is odd then the
result will not divide completely
9÷2 result 4 remainder 1 and the remainder will be a “1”.

4÷2 result 2 remainder 0 The Binary result is obtained by


placing all the remainders in
2÷2 result 1 remainder 0 order with the least significant
bit (LSB) being at the top and
1÷2 result 0 remainder 1 the most significant bit (MSB)
being at the bottom.
Binary number is taken from the remainders starting from the last to the first,
or in the illustration above, from bottom to top.
29410 = 1001001102
2. Convert 35710 into its Binary number equivalent.
SAINT MICHAEL’S COLLEGE OF LAGUNA
OLD NATIONAL ROAD, PLATERO, CITY OF BIÑAN, LAGUNA

357 ÷ 2 result 178 remainder 1


178 ÷ 2 result 89 remainder 0
write the remainder from
89 ÷ 2 result 44 remainder 1 bottom to top to get the
44 ÷ 2 result 22 remainder 0 Binary digit.
22 ÷ 2 result 11 remainder 0
35710 = 1011001012
11 ÷ 2 result 5 remainder 1
5÷2 result 2 remainder 1
2÷2 result 1 remainder 0
1÷2 result 0 remainder 1

Subtraction Method
If division is too confusing to grasp, we can achieve the same conversion using
subtraction. This is mostly the same process as division, but instead of dividing,
we subtract. Record a 1 for each place value that results in a positive whole
number. If the result is negative, record a 0 in its place. Use the difference (the
result of subtraction) for the next calculation. Continue from left to right until 1
is computed.

Exponent 28 27 26 25 24 23 22 21 20
Value 256 128 64 32 16 8 4 2 1
On / Off

Example:
1. Convert 19510 into its Binary number equivalent using the subtraction
method.

Create a table of powers to two (2) as shown below. The highest possible power
should be less than the given.
The given is 19510, so the highest power to be used is 128, because the next
power of 2, which is 28 is equal to 256, which is already greater than 195.

Exponent 27 26 25 24 23 22 21 20
Value 128 64 32 16 8 4 2 1
On / Off

The column under each power will contain 1 or 0, if we can subtract the given
number or the difference (results from subtraction), we put 1, otherwise, we
put 0.
SAINT MICHAEL’S COLLEGE OF LAGUNA
OLD NATIONAL ROAD, PLATERO, CITY OF BIÑAN, LAGUNA

Given: 195 Highest possible power of 2 to be subtracted: 128


195 – 128 = 67. A positive result means we need to write 1 under their column.

Exponent 27 26 25 24 23 22 21 20
Value 128 64 32 16 8 4 2 1
On / Off 1
Previous difference: 67

67 – 64 = 3. A positive result means we need to write 1 under their column.

Exponent 27 26 25 24 23 22 21 20
Value 128 64 32 16 8 4 2 1
On / Off 1 1

When we subtract 32 , 16 , 8 and 4 from 3, a negative result will be derived, so


write 0 under their column.
Exponent 27 26 25 24 23 22 21 20
Value 128 64 32 16 8 4 2 1
On / Off 1 1 0 0 0 0

3 minus 2 = 1. A positive result so we will right 1 on the table.

Exponent 27 26 25 24 23 22 21 20
Value 128 64 32 16 8 4 2 1
On / Off 1 1 0 0 0 0 1

1 – 1 is 0. It is not a negative result so we will still write 1 on the table.

Exponent 27 26 25 24 23 22 21 20
Value 128 64 32 16 8 4 2 1
On / Off 1 1 0 0 0 0 1 1

Note: In writing your solution, you don’t need to write the table every
time you put 1 or zero.
SAINT MICHAEL’S COLLEGE OF LAGUNA
OLD NATIONAL ROAD, PLATERO, CITY OF BIÑAN, LAGUNA

In writing the final answer we will ignore all 0 at left side of the first 1 value. In
the illustration above we will begin writing the final answer from the table 128
because it is the first column with 1 as a value. therefore
19510 = 110000112

2. Convert 9410 into its Binary number equivalent using the subtraction
method.

94 - 64 = 30. A positive result so we will right 1 on the table.

Exponent 26 25 24 23 22 21 20
Value 64 32 16 8 4 2 1
On / Off 1

Since the next value on the table is 32 and it is higher that the previous result
30 it will lead to a negative result that is why we will write 0 on the table.

Exponent 26 25 24 23 22 21 20
Value 64 32 16 8 4 2 1
On / Off 1 0

30 - 16 = 14. A positive result so we will right 1 on the table.

Exponent 26 25 24 23 22 21 20
Value 64 32 16 8 4 2 1
On / Off 1 0 1

14 - 8 = 6. A positive result so we will right 1 on the table.

Exponent 26 25 24 23 22 21 20
Value 64 32 16 8 4 2 1
On / Off 1 0 1 1

6 - 4 = 2. A positive result so we will right 1 on the table.


SAINT MICHAEL’S COLLEGE OF LAGUNA
OLD NATIONAL ROAD, PLATERO, CITY OF BIÑAN, LAGUNA

Exponent 26 25 24 23 22 21 20
Value 64 32 16 8 4 2 1
On / Off 1 0 1 1 1

2 - 2 = 0. A positive result so we will right 1 on the table.

Exponent 26 25 24 23 22 21 20
Value 64 32 16 8 4 2 1
On / Off 1 0 1 1 1 1

If the answer on the previous equation already reached 0 as a result all you
have to do is write 0 to the remainder slot on the table.

Exponent 26 25 24 23 22 21 20
Value 64 32 16 8 4 2 1
On / Off 1 0 1 1 1 1 0

9410 = 10111102
3. Convert 57910 into its Binary number equivalent using the subtraction
method.

579 - 512 = 67. A positive result so we will right 1 on the table.

Exponent 29 28 27 26 25 24 23 22 21 20
Value 512 256 128 64 32 16 8 4 2 1
On / Off 1

When we subtract 256 and 128 from 64, a negative result will be derived, so
write 0 under their column.

Exponent 29 28 27 26 25 24 23 22 21 20
Value 512 256 128 64 32 16 8 4 2 1
On / Off 1 0 0

67 - 64 = 3. A positive result so we will right 1 on the table.

Exponent 29 28 27 26 25 24 23 22 21 20
Value 512 256 128 64 32 16 8 4 2 1
On / Off 1 0 0 1
When we subtract 32 , 16 , 8 and 4 from 3, a negative result will be derived,
so write 0 under their column.
SAINT MICHAEL’S COLLEGE OF LAGUNA
OLD NATIONAL ROAD, PLATERO, CITY OF BIÑAN, LAGUNA

Exponent 29 28 27 26 25 24 23 22 21 20
Value 512 256 128 64 32 16 8 4 2 1
On / Off 1 0 0 1 0 0 0 0

3 - 2 = 1. A positive result so we will right 1 on the table.

Exponent 29 28 27 26 25 24 23 22 21 20
Value 512 256 128 64 32 16 8 4 2 1
On / Off 1 0 0 1 0 0 0 0 1

1 - 1 = 0. A positive result so we will right 1 on the table.

Exponent 29 28 27 26 25 24 23 22 21 20
Value 512 256 128 64 32 16 8 4 2 1
On / Off 1 0 0 1 0 0 0 0 1 1

57910 = 10010000112

The Octal Number System


The main characteristics of an Octal Numbering System is that there are only 8
distinct counting digits from 0 to 7. In the earlier days of computing, Octal
numbers and the Octal numbering system was very popular for counting inputs
and outputs because as it works in counts of eight, inputs and outputs were in
counts of eight, a byte at a time.
As the base of an Octal Numbers system is 8 (base-8), which also represents the
number of individual numbers used in the system, the subscript 8 is used to
identify a number expressed in Octal. For example, an Octal number is expressed
as: 2378
Converting Decimal to Octal using long division method:
Converting Decimal into Octal is most likely same as in Binary but this time
instead of dividing the decimal number by 2 repeatedly we will divide the
number by 8 to give a result and a remainder of either any digits from 0 - 7 until
the final result is 0.
Example:
1. Convert 35710 into its Octal number equivalent.
SAINT MICHAEL’S COLLEGE OF LAGUNA
OLD NATIONAL ROAD, PLATERO, CITY OF BIÑAN, LAGUNA

357 ÷ 8 result 44 remainder 5


44 ÷ 8 result 5 remainder 4
5÷8 result 0 remainder 5

Octal number is taken from the remainder starting from the last to the first, or
in the illustration above, from bottom to top, which is 5458.
35710 = 5458

2. Convert 212610 into its Octal number equivalent.

2126 ÷ result 265 remainder 6


8
265 ÷ 8 result 33 remainder 1
33 ÷ 8 result 4 remainder 1
4÷8 result 0 remainder 4
212610 = 41168
3. Convert 56510 into its Octal number equivalent.

565 ÷ 8 result 70 remainder 5


70 ÷ 8 result 8 remainder 6
8÷8 result 1 remainder 0
1÷8 result 0 remainder 1
56510 = 10658

Hexadecimal Number System


The Hexadecimal system is a type of positional numbering system based
on the number 16. Its numbers are represented by the first 10 digits of the
decimal numbering, and the interval from the number 10 to 15 are represented
by the following letters of the alphabet A - B - C - D - E and F. The normal
numbering system is based on decimal or ten, the idea was adopted of using the
first six letters of the alphabet to be able to supply the numbers that were needed.
In this way, the symbols used in the Hexadecimal system are the following:
SAINT MICHAEL’S COLLEGE OF LAGUNA
OLD NATIONAL ROAD, PLATERO, CITY OF BIÑAN, LAGUNA

S = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F}
Note that A= 10, B= 11, C= 12, D= 13, E= 14 and the letter F corresponds to the
number 15.
Converting Decimal to Hexadecimal using long division method:
Converting Decimal into Octal is most likely same as in Binary but this time
instead of dividing the decimal number by 2 repeatedly we will divide the
number by 8 to give a result and a remainder of either any digits from 0 - 7 until
the final result is 0.
Example:
1. Convert 357110 into its Octal number equivalent.

3571 ÷ 16 result 223 remainder 3


223 ÷ 16 result 13 remainder 15 or F
13 ÷ 16 result 0 remainder 13 or D
Write the remainder starting from the last to the first, or in the illustration above,
from bottom to top, which is DF316.
357110 = DF38
2. Convert 212610 into its Octal number equivalent.

2126 ÷ result 132 remainder 14 or


16 E
132 ÷ 16 result 8 remainder 4
8 ÷ 16 result 0 remainder 8
212610 = 84E16
3. Convert 516510 into its Octal number equivalent.

5165 ÷ 16 result 322 remainder 13 or D


322 ÷ 16 result 20 remainder 2
20 ÷ 16 result 1 remainder 4
1 ÷ 16 result 0 remainder 1
516510 = 142D16
Farrell, J. 2014. Java programming. Course Technology/ Cengage Learning

3G E-Learning, 2015. Java programming. 3G E-Learning FC LLC


SAINT MICHAEL’S COLLEGE OF LAGUNA
OLD NATIONAL ROAD, PLATERO, CITY OF BIÑAN, LAGUNA

Fain, Y. 2015. Java programming: 24 hour trainer. Wiley Publishing Inc.

You might also like