You are on page 1of 21

#9 BS IN INFORMATION TECHNOLOGY

BS IN COMPUTER SCIENCE

FLEX Course Material


Identify and define the
major component of a
computer system
responsible for
arithmetic operation.
Be able to do different

Introduction to
arithmetic operations
on number system.
Be able to perform
binary additions.
Be able to compute and
get the result of binary
Computing
subtractions using:
Give the product of
binary numbers using
multiplication
operation.
Show the quotient of Binary Arithmetic Operations
binary divisions.
Apply the 4
fundamental arithmetic
operations on the
different bases in the
number system.

Malimata, Charlyn A.
FOCAL POINTS

This module focuses on the arithmetic logic unit which is a


major component of the CPU that handles all the calculations
the CPU may need. Most of these operations are logical in
nature. Depending on how the ALU is designed, it can make
the CPU more powerful, but it also consumes more energy
and creates more heat. Therefore, there must be a balance
between how powerful and complex the ALU is and how
expensive the whole unit becomes. This is why faster CPUs are
more expensive, consume more power and dissipate more
heat.

In this module, binary arithmetic operations will be


discussed thoroughly.

Lesson 1 P4
Overview of Arithmetic Logic Unit

?
Lesson 2 P6
Binary Addition
Lesson 3 P10
Binary Subtraction
Lesson 4 P15
Binary Multiplication
INSIDE
Lesson 5 P18
Binary Division
#1

Overview of
Arithmetic
Logic
Unit
Understanding
the
Arithmetic
Logic
Unit

An arithmetic logic unit (ALU) is a digital circuit used to perform arithmetic and logic operations. It
represents the fundamental building block of the central processing unit (CPU) of a computer. Modern
CPUs contain very powerful and complex ALUs. In addition to ALUs, modern CPUs contain a control unit
(CU).
Most of the operations of a CPU are performed by one or more ALUs, which load data from input registers.
A register is a small amount of storage available as part of a CPU. The control unit tells the ALU what
operation to perform on that data, and the ALU stores the result in an output register. The control unit
moves the data between these registers, the ALU, and memory.

4
ALU is also known as an Integer Unit (IU). The arithmetic logic unit is that part of the CPU that
handles all the calculations the CPU may need. Most of these operations are logical in nature.
Depending on how the ALU is designed, it can make the CPU more powerful, but it also consumes
more energy and creates more heat. Therefore, there must be a balance between how powerful
and complex the ALU is and how expensive the whole unit becomes. This is why faster CPUs are
more expensive, consume more power and dissipate more heat.

Different operation as carried out by ALU can be categorized as follows –

▪ logical operations − These include operations like AND, OR, NOT, XOR, NOR, NAND, etc.

▪ Bit-Shifting Operations − This pertains to shifting the positions of the bits by a certain
number of places either towards the right or left, which is considered a multiplication or
division operations.

▪ Arithmetic operations − This refers to bit addition and subtraction. Although multiplication
and division are sometimes used, these operations are more expensive to make.
Multiplication and subtraction can also be done by repetitive additions and subtractions
respectively.

5
#2

Binary
Addition
Understanding
Binary
Addition

It is a key for binary subtraction, multiplication, division. There are four rules of binary addition.

In fourth case, a binary addition is creating a sum of (1 + 1 = 10) i.e. 0 is written in the given column and
a carry of 1 over to the next column.

7
ASSESSMENT TASK

Exercise: Addition of Binary Numbers

Perform binary addition on the following numbers.

101010101 2 + 1111111111 2
ANS. ____________________

0.12345 8 + 0.765432 8
ANS. ____________________

123.4567 10 + 987564.25 10
ANS. ____________________

FA.CE 16 + 0.BAD 16
ANS. ____________________

1CE.7EA 16 + C0F.FEE 16
ANS. ____________________

8
#3

Binary
Subtraction
Understanding
Binary
Subtraction

Subtraction and Borrow, these two words will be used very frequently for the binary subtraction. There are
four rules of binary subtraction.

10
Subtraction Using 1’s Complement

Steps In Using the 1’s Complement (+ Difference) Examples


1. Convert or express the numbers in binary.
2. Put 0’s at the outermost LEFT and/or RIGHT
of the binary bits of the Minuend and
Subtrahend to balance them.
3. Copy the Minuend (first term).
4. Convert the Subtrahend (second term) to its
1’s complement. Examples
5. Proceed by using ADDITION operation.
6. If the sum of step 5 produces a value of 1 at
the outermost left add that bit (1) to the
outer most right of the sum.
7. The result is the difference of the said two
numbers (same as in using subtraction
operation).

Steps In Using the 1’s Complement (- Difference) Examples


1. Convert or express numbers into binary.
2. Put 0’s at the outermost LEFT and/or RIGHT
of the binary bits of the Minuend and the
Subtrahend to balance them.
3. Copy the Minuend (first term).
4. Convert the Subtrahend (second term) to its Examples
1’s complement.
5. Proceed using ADDITION operation.
6. The SUM of step 5 is called the TEMPORARY
ANSWER.
7. Convert again the TEMPORARY ANSWER to its
1’s complement.

11
Subtraction Using 2’s Complement

Steps In Using the 2’s Complement (+ Difference) Examples


1. Convert or express the number into binary.
2. Put 0’s at the outermost LEFT and/or RIGHT
of the binary bits of the Minuend and the
Subtrahend to balance them.
3. Copy the Minuend (first term).
4. Convert the Subtrahend (second term) to its
2’s complement. Examples
5. Proceed using ADDITION operation.
6. If the sum of step 5 produces a value of 1 at
the outermost LEFT, DROP that bit.
7. The remaining bits are the FINAL ANSWER.

Steps In Using the 2’s Complement (- Difference) Examples


1. Convert or express the numbers into binary.
2. Put 0’s at the outermost LEFT and/or RIGHT
of the binary bits of the Minuend and the
Subtrahend to balance them.
3. Copy the Minuend (first term).
4. Convert the Subtrahend (second term) to its
2’s complement. Examples

5. Proceed using ADDITION operation.


6. The SUM of step 5 is called TEMPORARY
ANSWER.
7. Convert again the TEMPORARY ANSWER to its
2’s complement.

12
ASSESSMENT TASK

Exercise: Subtraction of Binary Numbers

Perform binary subtraction on the following numbers.

1111111111 2 - 10101010 2 ANS. ____________________

0.765432 8 - 0.1234 8 ANS. ____________________

987654.25 10 - 123.4567 10 ANS. ____________________

FA.CE 16 - 0.BAD 16 ANS. ____________________

C0F.FEE 16 - 1CE.7EA 16 ANS. ____________________

Perform binary subtraction using 1’s complement on the following


numbers.

101010101 2 - 1111111111 2 ANS.


__________________

1CE.7EA 16 - C0F.FEE 16 ANS. __________________

Perform binary subtraction using 2’s complement on the following


numbers.

101010101 2 - 1111111111 2 ANS. __________________

FA.CE 16 - 0.BAD 16 ANS. __________________

13
#4

Binary
Multiplication
Understanding
Binary
Multiplication

Binary multiplication is similar to decimal multiplication. It is simpler than decimal multiplication because
only 0s and 1s are involved. There are four rules of binary multiplication.

15
ASSESSMENT TASK

Exercise: Multiplication of Binary Numbers

Perform binary multiplication on the following numbers.

100001 2 * 10.00001 2 ANS. ____________________

123 8 * 0.1234 8 ANS. ____________________

FA.CE 16 * 0.FF 16 ANS. ____________________

1234 5 * 12345 6 ANS. ____________________

AA.A 12 * B.BB 13 ANS. ____________________

16
#5

Binary
Division
Understanding
Binary
Division

Binary division is similar to decimal division. It is called as the long division procedure.

Examples

Examples

18
ASSESSMENT TASK

Exercise: Division of Binary Numbers

Perform binary division on the following numbers. If the numbers are


not expressed in their binary forms … convert them first before
doing binary division.

100001 2 / 10.00001 2 ANS. ____________________

123 8 / 0.1234 8 ANS. ____________________

FA.CE 16 / 0.FF 16 ANS. ____________________

1234 5 / 12345 6 ANS. ____________________

AA.A 12 / B.BB 13 ANS. ____________________

19
SUMMARY

▪ An arithmetic logic unit (ALU) is a digital circuit


used to perform arithmetic and logic operations.
It represents the fundamental building block of
the central processing unit (CPU) of a computer.

▪ Arithmetic operations refers to bit addition and


subtraction. Although multiplication and division
are sometimes used, these operations are more
expensive to make. Multiplication and subtraction
can also be done by repetitive additions and
subtractions respectively.

KEY TERMS

▪ Arithmetic Logic Unit (ALU)


▪ Central Processing Unit (CPU)
▪ Arithmetic Operations

20
REFERENCES

Online Resources
▪ Tutorialspoint, “Arithmetic Logic Unit (ALU)”,
https://www.tutorialspoint.com/arithmetic-
logic-unit-alu

▪ Study.com, “Arithmetic Logic Unit (ALU):


Definition, Design & Function”,
https://study.com/academy/lesson/arithmet
ic-logic-unit-alu-definition-design-
function.html

21

You might also like