0% found this document useful (0 votes)
191 views14 pages

Math 1 Module 6

This document discusses binary codes and number systems. It begins by outlining the learning outcomes, which are to understand place value in binary numbers, explain common uses of binary numbers, and perform operations in binary. It then provides an introduction to binary digits and how computers use strings of 1s and 0s. The main topics covered are the binary number system, converting between binary and decimal numbers, and examples of conversions using place values and expanded notation. Exercises are provided to have the reader practice conversions between the two number systems.

Uploaded by

Ara Mae
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)
191 views14 pages

Math 1 Module 6

This document discusses binary codes and number systems. It begins by outlining the learning outcomes, which are to understand place value in binary numbers, explain common uses of binary numbers, and perform operations in binary. It then provides an introduction to binary digits and how computers use strings of 1s and 0s. The main topics covered are the binary number system, converting between binary and decimal numbers, and examples of conversions using place values and expanded notation. Exercises are provided to have the reader practice conversions between the two number systems.

Uploaded by

Ara Mae
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/ 14

MODULE 6

BINARY CODES

LEARNING OUTCOMES

As a result of this lesson, students will be able to:


 relate place value in decimal numbers to place value in binary numbers
 understand the term 'binary number'
 explain the place values in base two
 convert base two numbers to base ten numbers
 explain common uses of binary numbers
 perform different operations in binary numbers

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!

Lesson 1: Number System

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.

Properties of Decimal and Binary Number System


Number Base Number of Symbols used to represent Example of the
System Symbols numbers number 13
Decimal 10 10 0,1,2,3,4,5,6,7,8,9 13
Binary 2 2 0,1 1101

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

URS-IM-AA-CI-0167 Rev 00 Effective Date: August 24, 2020


BINARY CODES

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

Lesson 2: Binary Number System

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

Lesson 3: Converting Between Binary Numbers and Decimal Numbers


We individuals are always using the decimal number system, whereas computers
use the binary number system. So, we need to be able to readily shift between the
binary and decimal number representations.

Converting a Binary Number to a Decimal Number


To convert a binary number to a decimal number, we simply write the binary
number as a sum of powers of 2.
Do the following to obtain the decimal value of a binary number.
• Write the number in expanded notation
• Multiply each number with its place value
• Add these values together to obtain the decimal value.

URS-IM-AA-CI-0167 Rev 00 Effective Date: August 24, 2020


BINARY CODES

Examples:
1. Convert 10112 to a decimal number.
10112 = 1x23 + 0x22 + 1x21 + 1x20
= 1x8 + 0x4 + 1x2 + 1x1
=8+0+2+1
= 1110

2. Convert 1011012 to a decimal number.


1011012 = 1x25 + 0x24 + 1x23 + 1x22 + 0x21 + 1x20
= 1x32 + 0x16 + 1x8 + 1x4 + 0x2 + 1x1
= 32 + 8 + 4 + 1
= 4510

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

SELF ASSESSMENT QUESTION No. 1

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 = __________

URS-IM-AA-CI-0167 Rev 00 Effective Date: August 24, 2020


BINARY CODES

ANSWER TO SELF ASSESSMENT QUESTION No. 1

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

Direction: Convert the following binary numbers to decimal numbers.


Note: Use place value for a-e then expanded notation for f-j
a) 10102 = ______ f) 100000112 = ______
b) 111112 = ______ g) 111011112 = ______
c) 1010012 = ______ h) 101.1012 = ______
d) 110011002 = ______ i) 1100.0112 = ______
e) 10111.1012 = ______ j) 10002 = ______

Converting a Decimal Number to a Binary Number


The method for converting a decimal number to binary is one that can be used to
convert from decimal to any number base. The integer and fractional parts of each
number are done separately.

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

URS-IM-AA-CI-0167 Rev 00 Effective Date: August 24, 2020


BINARY CODES

2. Convert 9310 to binary


93 / 2 = 46 remainder 1 (least significant digit)
46 / 2 = 23 remainder 0
23 / 2 = 11 remainder 1
11 / 2 = 5 remainder 1
5 / 2 = 2 remainder 1
2 / 2 = 1 remainder 0
1 / 2 = 0 remainder 1 (most significant digit)

The resulting binary number is: 10111012

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

2. Convert 0.87510 to a binary number.

Hence, 0.87510 = 0.1112

To convert a decimal number with a fraction

1. Convert 17.2510 to a binary number


Step 1: Determine the integral part
17/2 = 8 remainder 1
8/2 = 4 remainder 0
4/2 = 2 remainder 0
2/2 = 1 remainder 0
1/2 = 0 remainder 1 Hence 1710 = 100012

URS-IM-AA-CI-0167 Rev 00 Effective Date: August 24, 2020


BINARY CODES

Step 2: Determine the fractional part

Hence 0.2510 = 0.012

Step 3: Combine the answers for the two separate parts.


Therefore 17.2510 = 10001.012

SELF ASSESSMENT QUESTION No. 2

Conversion: Decimal Numbers to Binary Numbers

Direction: Convert the following into a binary number.


1. 1110 = __________
2. 26.7510 = __________
3. 5310 = __________
4. 9010 = __________
5. 13710 = __________
6. 1.2510 = __________
7. 17.7510 = __________
8. 2710 = __________
9. 8510 = __________
10. 36.12510 = __________

ANSWER TO SELF ASSESSMENT QUESTION No. 2

Conversion: Decimal Numbers to Binary Numbers


1. 1110 = 10112
2. 26.7510 = 11010.112
3. 5310 = 1101012
4. 9010 = 10110102
5. 13710 = 100010012
6. 1.2510 = 1.012
7. 17.7510 = 10001.112
8. 2710 = 110112
9. 8510 = 10101012
10. 36.12510 = 100100.0012

URS-IM-AA-CI-0167 Rev 00 Effective Date: August 24, 2020


BINARY CODES

EXERCISE No. 2

Direction: Convert the following decimal numbers to binary numbers.


1. 53.12510 = _________________
2. 201.062510 = ___________________

Solution 1: Solution 2:

Lesson 4: Arithmetic Operation


Arithmetic operations with numbers in base r follow the same rules as decimal
numbers.
Transfer 1 1 1
768
+475 Take note: It is always done from right to left
1243

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)

URS-IM-AA-CI-0167 Rev 00 Effective Date: August 24, 2020


BINARY CODES

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

2: Calculate the following: 101112 + 1102

Transfer 11
10111
+ 110
1 1 1 0 12

3: Calculate the following: 111012 + 1112 + 10112

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

SELF ASSESSMENT QUESTION No. 3

Addition: Binary Numbers


Direction: Perform the addition of the binary numbers:
1. 1 0 1 1 0 1 3. 1111
+1011 +101
------------- --------

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

URS-IM-AA-CI-0167 Rev 00 Effective Date: August 24, 2020


BINARY CODES

ANSWER TO SELF ASSESSMENT QUESTION No. 3

Addition: Binary Numbers


1111 111
1. 1 0 1 1 0 1 3. 1111
+1011 +101
111000 10100

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

Addition: Binary Numbers

Direction: Calculate the following.


1. 11011110 2. 0 1 0 1 1 0 1 0
+ 11011101 +11110011
10001000

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.

URS-IM-AA-CI-0167 Rev 00 Effective Date: August 24, 2020


BINARY CODES

Examples
1: Calculate the following: 11112 - 1102

1111
- 110
1 0 0 12

2: Calculate the following: 10002 - 112


1 1 1
1 1 1
Since it is not possible to subtract
1000 0 from 1, we borrow value from the
- 11 more significant bit, then add 2 1’s
1 0 12 on the 0 column.

SELF ASSESSMENT QUESTION No. 4

Subtraction: Binary Numbers


Direction: Perform the subtraction of the binary numbers:
1. 1001 3. 1100
- 0111 -0101
------------- --------

2. 1000 4. 10101
- 0011 - 01111
------------- -------------

5. 1 1 1 1 - 1 1 0

ANSWER TO SELF ASSESSMENT QUESTION No. 4

Subtraction: Binary Numbers

1. 10 3. 101 5. 1001
2. 111 4. 110

URS-IM-AA-CI-0167 Rev 00 Effective Date: August 24, 2020


BINARY CODES

EXERCISE No. 4

Subtraction: Binary Numbers


Direction: Calculate the following.
1. 1 0 1 0 0 1 0 1 2. 1 0 1 1 0 0 1 1
- 01010001 - 01010110

Note: Do not forget to indicate your solution.

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

2. Calculate 1011.01 × 110.1

URS-IM-AA-CI-0167 Rev 00 Effective Date: August 24, 2020


BINARY CODES

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.

SELF ASSESSMENT QUESTION No. 5

Multiplication: Binary Numbers


Direction: Solve the below given questions using multiplication rules, based for
binary numbers.
1. Multiply 101112 by 11012
2. Solve 11011.1012 by 101.1112

ANSWER TO SELF ASSESSMENT QUESTION No. 5

Multiplication: Binary Numbers

1. Multiply 101112 by 11012

10111
x1101
10111 ← First partial product
x 10111
1110011 ← First intermediate sum
10111
100101011 ← Final sum.

Hence the required product is 100101011

2. Solve 11011.1012 by 101.1112


11011.101
x 101.111
11011.101
110111.01 ← First partial product
1010010 111 ← First intermediate sum
1101110 1 .
11000001 011 ← Second intermediate sum
11011101 .
110011110 011 ← Third intermediate sum
11011101 1
10100010010011
Hence the required result is 10100010.010011

URS-IM-AA-CI-0167 Rev 00 Effective Date: August 24, 2020


BINARY CODES

EXERCISE No. 5

Multiplication: Binary Numbers

Direction: Calculate the following.


1. 00101001 2. 0 0 0 1 0 1 1 1
x 00000110 x 00000011

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

The resulting binary number is: 11012

URS-IM-AA-CI-0167 Rev 00 Effective Date: August 24, 2020


BINARY CODES

SELF ASSESSMENT QUESTION No. 6

Division: Binary Numbers


A. Direction: Solve the given questions below using division rules, based for binary
numbers.
1. 101102 / 1002 = __________________
2. 11112 / 1012 = __________________
3. 110112 / 1102 = __________________
4. 1010102 / 1112 = __________________
B. How do we know that the answer to our division problem includes a fraction?

ANSWER TO SELF ASSESSMENT QUESTION No. 6

Division: Binary Numbers


A. The binary answers are listed below.
1. 101102 / 1002 = 101.12
2. 11112 / 1012 = 112
3. 110112 / 1102 = 100.12
4. 1010102 / 1112 = 1102
B. We know our division problem includes a fraction when all the digits of
the dividend have been considered and there is still a remainder. When
this happens, we mark a radix point in the dividend, append a zero, and
continue the division.

EXERCISE No. 6

Division: Binary Numbers

Solve the following binary division problems.


1. 10002 / 102
2. 11112 / 112
3. 11002 / 102
4. 10012 / 112
5. 1112 / 102

URS-IM-AA-CI-0167 Rev 00 Effective Date: August 24, 2020

You might also like