Math 1 Module 6
Math 1 Module 6
BINARY CODES
LEARNING OUTCOMES
Introduction
Every computer is made up of billions of bits. It is based on the most basic
beginnings of 2 electronic states. It can only be in one of two states: ‘on’ or ‘off’. A bit
(binary digit) represents these two states by using a series of 0s and 1s. Codes are like
a secret language that computers, apps, and phones speak. Hence, one could say that
strings of ones and zeros are the mother tongue of the computer!
The number system that is familiar to us, that we use every day, is the decimal
number system, also commonly referred to as the base-10 system.
This means that in our number system, we represent amounts using ten
numerals/symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. The decimal number system therefore
has a base of 10.
Place Value
Place value means that each column, or place, in a number has a particular value.
Each place to the left increases by a power of ten. So, the place of the figure determines
its value.
Consider the decimal number 843. The value of the 8 in 843 is 800. For the value
43, 4’s place value is 40.
Place values of the decimal number system
3
Power 10 102 101 100 10-1 10-2 10-3
Place Value 1000 100 10 1 . 0.1 0.01 0.001
Given 6 3 4 9 . 2 3
Number 8 4 3
Expanded Notation
By multiplying numbers with their place values, you can write numbers in
expanded notation.
Examples:
1. 6349.2310 = 6x103 + 3x102 + 4x101 + 9x100 + 2x10-1 + 3x10-2
2. 84310 = 8x102 + 4x101 + 3x100
Take note: Since we are working with two different number systems, you must include the base to
ensure that everybody knows in which number system you are working. If you do not include the
base, marks will be deducted in this module
In the binary number system, there are only two possible values that can appear
in each digit Position. Only the numerals 0 and 1 are used in binary numbers. When
talking about binary numbers, it is often necessary to talk of the number of bits used to
store or represent the number.
Place values of the binary number system
Power 25 24 23 22 21 20 2-1 2-2
Place Value 32 16 8 4 2 1 . 0.5 0.25
Given 1 0 1 1 0 1 .
Number 1 1 0 1 . 1 0
Expanded Notation
By multiplying numbers with their place values, you can write numbers in expanded
notation.
Examples:
1. 1011012 = 1x25 +0x24 +1x23 + 1x22 + 0x21 + 1x20
2. 1101.1012 = 1x23 + 1x22 + 0x21 + 1x20 + 1x2-1 + 0x2-2
Examples:
1. Convert 10112 to a decimal number.
10112 = 1x23 + 0x22 + 1x21 + 1x20
= 1x8 + 0x4 + 1x2 + 1x1
=8+0+2+1
= 1110
Take note: You can also get the decimal number equivalent by simply taking the
place value of those with 1’s.
For example, to convert the binary number 10101.012 to decimal, we annotate
the position values below the bit values:
Place Value 16 8 4 2 1 . 0.5 0.25
Given Number 1 0 1 0 1 . 0 1
Then we add the position values for those positions that have a bit value of 1:
16 + 4 + 1 + 0.50 + 0.25 = 21.75 Thus,
10101.012 = 21.7510
A. Identification.
Direction. Provide the word(s) that best describe the given statement.
____________1. It determines the value of the given numerals
____________2. Binary digit that represents the “off” electric state.
____________3. It is considered as the most familiar type of number system
that all humans used every day.
____________4. Base-value of binary number system.
____________5. Number of symbols used in decimal number system.
B. Conversion:
Direction: Convert the following into a decimal number.
1. 11011012 = __________
2. 1101102 = __________
3. 1011012 = __________
4. 1000002 = __________
5. 101102 = __________
A. Identification.
1. Place value 3. Decimal Number
2. 0’s 4. 2 5. 10
B. Conversion:
1. 11011012 = 10910
2. 100111.012 = 39.7510
3. 101.1012 = 5.62510
4. 1000002 = 3210
5. 101102 = 2210
EXERCISE No. 1
The integer part: It involves using successive division by the radix until the
dividend reaches 0. At each division, the remainder provides a digit of the converted
number, starting with the least significant digit.
Examples:
1. Convert 3710 to binary
37 / 2 = 18 remainder 1 (least significant digit)
18 / 2 = 9 remainder 0
9 / 2 = 4 remainder 1
4 / 2 = 2 remainder 0
2 / 2 = 1 remainder 0
1 / 2 = 0 remainder 1 (most significant digit)
The resulting binary number is: 1001012
The fractional part: Multiply the fraction by two, until it becomes 0. The digit
(0 or 1) in the left most column will be the decimal fraction. The binary fraction is
written from top to bottom.
Examples:
1. Convert 0.2510 to a binary number.
Step 1: Multiply by 2 until the answer is 0.
Remember to write
down a carry over of 0
on the left most column
Step 2: Write the left most column down from top to bottom.
Hence, 0.2510 = 0.012
EXERCISE No. 2
Solution 1: Solution 2:
Binary Addition
When we add two binary ones together, we have a carry into the next column (from
the ones column to the twos column). This idea of “carrying over to the next column”
when adding binary numbers together is analogous to carrying over when adding
decimal numbers.
The following combinations exist when two single digit binary numbers are added:
0 0 1 1
+0 +1 +0 +1
0 1 1 1 0 (transfer of 1)
Addition Rules
A B A+B
0 0 0
0 1 1
1 0 1
1 1 0 – carry 1 to the most significant bit
Examples
1: Calculate the following: 101012 + 102
Transfer (none)
10101
+ 10
1 0 1 1 12
Transfer 11
10111
+ 110
1 1 1 0 12
Transfer 1111
11101 Remember that when three or
+ 111 more numbers must be added, the
100100 chances of making a mistake
becomes much smaller if the first
+ 1011 two numbers are added and then
1 0 1 1 1 12 the third one
2. 1 0 1 1 0 1 4. 1111
+1 0 0 1 1 1 +1010
------------- -------------
5. 1 1 0 0 1 + 1 0 0 + 1 1 0 1
1111 11
2. 1 0 1 1 0 1 4. 1111
+1 0 0 1 1 1 +1010
1010100 11001
11 1
5. 1 1 0 0 1
+100
11101
+1101
101010
EXERCISE No. 3
Binary Subtraction
Subtraction Rules
A B A- B
0 0 0
0 1 1 – borrow 1 from the more significant bit
1 0 1
1 1 0
Take note: In binary subtraction, once you cancel 0, you need to replace it with two 1’s.
Examples
1: Calculate the following: 11112 - 1102
1111
- 110
1 0 0 12
2. 1000 4. 10101
- 0011 - 01111
------------- -------------
5. 1 1 1 1 - 1 1 0
1. 10 3. 101 5. 1001
2. 111 4. 110
EXERCISE No. 4
Binary Multiplication
Multiplication Rules
A B AxB
0 0 0
0 1 0
1 0 0
1 1 1 no carry or borrow bits
As we can see that if we can compare these rules of binary multiplication with that
of decimal multiplication we will not have any difference at all. So it is a comparatively
easy method than the previously discussed two operations.
Examples
1. Solve 1010 × 101
1010
x 101
1010
0000
0 1 0 1 0 ……. First Intermediate Sum
1010
1 1 0 0 1 0 …… Final
The placement of the binary point in the product of two binary numbers having
fractional representation is determined in the same way as in the product of decimal
numbers with fractional representation. The total number of places after the binary point
in the multiplicand and the multiplier is counted. The binary point in the product is then
placed before this total number of places counted from right.
10111
x1101
10111 ← First partial product
x 10111
1110011 ← First intermediate sum
10111
100101011 ← Final sum.
EXERCISE No. 5
Binary Division
The binary division operation is similar to the base 10 decimal system. The
division is probably one of the most difficult operations of the basic arithmetic
operations. There are different ways to solve division problems using binary
operations. Long division is one of them and the easiest and the most efficient
way.
Division Rules
A B A/B
0 0 meaningless
0 1 meaningless
1 0 0
1 1 1
Take note: In binary division, you need to consider this format in order to perform
operation.
quotient
𝑑𝑖𝑣𝑖𝑠𝑜𝑟 √𝑑𝑖𝑣𝑖𝑑𝑒𝑛𝑑
:
remainder
Examples:
1. Solve 100111 ÷ 11
001101
1 1 √1 0 0 1 1 1
- 11 . Consider this values:
011 11 > 1
- 11 . 11> 10
001 11 < 100
- 00 . 11>001
0011 Also, once the remainder
- 11 becomes 0, you can stop
Remainder 0
EXERCISE No. 6