0% found this document useful (0 votes)
67 views19 pages

Arithmetic and Logic Unit: Yuivr VI U Ho Kohud College of Education of Akre Department of English Language

The document discusses the arithmetic and logic unit (ALU). It begins by explaining that an ALU performs basic arithmetic and logic operations on binary numbers and is a fundamental component of CPUs, GPUs, and other computing circuits. It then provides a brief history of ALUs, describing how early computers had simple serial ALUs while modern ALUs can perform complex operations in a single clock cycle due to advances in integrated circuit technology. The document concludes by explaining how an ALU works by using logic gates to manipulate binary numbers and perform operations like addition, subtraction, AND, and OR.

Uploaded by

Wafa Haji
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)
67 views19 pages

Arithmetic and Logic Unit: Yuivr VI U Ho Kohud College of Education of Akre Department of English Language

The document discusses the arithmetic and logic unit (ALU). It begins by explaining that an ALU performs basic arithmetic and logic operations on binary numbers and is a fundamental component of CPUs, GPUs, and other computing circuits. It then provides a brief history of ALUs, describing how early computers had simple serial ALUs while modern ALUs can perform complex operations in a single clock cycle due to advances in integrated circuit technology. The document concludes by explaining how an ALU works by using logic gates to manipulate binary numbers and perform operations like addition, subtraction, AND, and OR.

Uploaded by

Wafa Haji
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/ 19

Arithmetic and logic unit

yuivr vi u ho kohud

College of education of akre

Department of English language

tkiE tE h aaaE a E auuy u

Moodle email: [email protected]

Year: first year

Course: computer skills

Course:Re1202

Instructor: baker khalid baker

Date:22/6/2020
Table of Contents
noitpodntnaCp.rhtpahC ...................................................................................................... 6
1.1.What is ALU………………………..……………………………………………………………………………………………………..2

1.2.History……………………………….………………………………………………………………………………………………………3

1.3.How an ULA work……………….…………………………………………………………………………………………………….4

1.4.Arithmetic Oparation………..…………………………………………………………………………………………………………6

Chapter.2 . Body % Methods…………………………………………………………………………9

2.1.Signals………………………………………………………………………………………………………..9

2.1.1 Status…………………………………………………………………………………………………9

2.2.Data…………………………………………………………………………………………………………….9

2.3.Apcode………………..………………………………………………………………………………………10

2.4.Application……………..……………………………………………………………………………………10

2.4.1 Multiple-precision arithmetic…………………………………………………………………………10

2.5.Design of ALU……………………………………………………………………………………………….12

2.6. Difference Between ALU and CPU………………………………………………………………………..14

Chapter .3 .Conclusition………………………………………………………………………………16

Chapter .4. Reference………………………………………………………………………………….19

1
Chapter .1.intrudoction

1.1Arithmetic

An arithmetic logic unit (ALU) is a combinational digital electronic circuit that


performs arithmetic and bitwise operations on integer binary numbers. This is in
contrast to a floating-point unit (FPU), which operates on floating point numbers. An
ALU is a fundamental building block of many types of computing circuits, including
the central processing unit (CPU) of computers, FPUs, and graphics processing units
(GPUs). A single CPU, FPU or GPU may contain multiple ALUs.

The inputs to an ALU are the data to be operated on, called operands, and a code
indicating the operation to be performed; the ALU's output is the result of the performed
operation. In many designs, the ALU also has status inputs or outputs, or both, which
convey information about a previous operation or the current operation, respectively,
between the ALU and external status registers.

ALU stands for Arithmetic and Logic Unit. It is a subsystem or a component of CPU.
The main objective of it is to handles arithmetic and logic operations. Arithmetic
operations are addition, subtraction, division, multiplication etc. The logical operations
determine whether a statement is true or false. Furthermore, Graphical Processing Units
(GPU), Floating Point Units (FPU) also have ALUs. A single CPU, FPU or a GPU can
have multiple ALUs to handle advanced calculations ALU performs various calculations.
The inputs to it are the data on which it is to operate. They are called operands. In a
mathematical expression such as “2+3 = 5”, 2 and 3 are the operands .

2
1.2. History

Mathematician John von Neumann proposed the ALU concept in 1945 in a report on
the foundations for a new computer called the EDVAC.[1]

The cost, size, and power consumption of electronic circuitry was relatively high
throughout the infancy of the information age. Consequently, all serial computers and
many early computers, such as the PDP-8, had a simple ALU that operated on one data
bit at a time, although they often presented a wider word size to programmers. One of
the earliest computers to have multiple discrete single-bit ALU circuits was the
1948 Whirlwind I, which employed sixteen of such "math units" to enable it to operate
on 16-bit words.

In 1967, Fairchild introduced the first ALU implemented as an integrated circuit, the
Fairchild 3800, consisting of an eight-bit ALU with accumulator.[2] Other integrated-
circuit ALUs soon emerged, including four-bit ALUs such as the Am2901 and 74181.
These devices were typically "bit slice" capable, meaning they had "carry look ahead"
signals that facilitated the use of multiple interconnected ALU chips to create an ALU
with a wider word size. These devices quickly became popular and were widely used in
bit-slice minicomputers.

Microprocessors began to appear in the early 1970s. Even though transistors had
become smaller, there was often insufficient die space for a full-word-width ALU and,
as a result, some early microprocessors employed a narrow ALU that required multiple
cycles per machine language instruction. Examples of this includes the popular Zilog
Z80, which performed eight-bit additions with a four-bit ALU.[3] Over time, transistor
geometries shrank further, following Moore's law, and it became feasible to build wider
ALUs on microprocessors.

Modern integrated circuit (IC) transistors are orders of magnitude smaller than those of
the early microprocessors, making it possible to fit highly complex ALUs on ICs.
Today, many modern ALUs have wide word widths, and architectural enhancements
such as barrel shifters and binary multipliers that allow them to perform, in a single
clock cycle, operations that would have required multiple operations on earlier ALUs.

3
1.3 How an ALU Works
An ALU performs basic arithmetic and logic operations. Examples of arithmetic
operations are addition, subtraction, multiplication, and division. Examples of logic
operations are comparisons of values such as NOT, AND, and OR.

All information in a computer is stored and manipulated in the form of binary


numbers, i.e. 0 and 1. Transistor switches are used to manipulate binary numbers
since there are only two possible states of a switch: open or closed. An open transistor,
through which there is no current, represents a 0. A closed transistor, through which
there is a current, represents a 1.

Operations can be accomplished by connecting multiple transistors. One transistor can


be used to control a second one - in effect, turning the transistor switch on or off
depending on the state of the second transistor. This is referred to as a gate because the
arrangement can be used to allow or stop a current.

The s Implest type of operation is a NOT gate. This uses only a single transistor. It uses
a single input and produces a single output, which is always the opposite of the input
This figure (1) shows the logic of the NOT gate:

Figure (1) logic of the NOT gate

4
Other gates consist of multiple transistors and use two inputs. The OR gate results in a
1 if either the first or the second input is a 1. The OR gate only results in a 0 if both
inputs are 0. This figure (2) shows the logic of the OR gate:

Figure (2) logic of the OR gate

The AND gate results in a 1 only if both the first and second input are 1s. figure (3)
shows the logic of the AND gate:

Figure (3) logic of the AND gate

5
NOT gate : Not gate is used to reverse the result of gates or reverse Boolean state from
0 to 1 and 1 to 0.Not gate is also used with ‘AND’ and ‘OR’ gate. While using with
AND or ‘OR’ gate, NOT gate is representing an as small circle in front of both gates.
After using NOT gate, AND gates convert into NAND or ‘OR’ gate convert into NOR.

Figure(4)

1.4.arithmatic operation

 The basic arithmetic operations for real numbers are addition, subtraction,
multiplication, and division.
 The basic arithmetic properties are the commutative, associative, and distributive
properties.

The Four Arithmetic Operation :

Addition

Addition is the most basic operation of arithmetic. In its simplest form, addition
combines two quantities into a single quantity, or sum. For example, say you have a
group of 2 boxes and another group of 3 boxes. If you combine both groups together,
you now have one group of 5 boxes. To represent this idea in mathematical terms:

2+3=5

6
Subtraction

Subtraction is the opposite of addition. Instead of adding quantities together, we are


removing one quantity from another to find the difference between the two. Continuing
the previous example, say you start with a group of 5 boxes. If you then remove 3 boxes
from that group, you are left with 2 boxes. In mathematical terms:

5−3=2

Multiplication

Multiplication also combines multiple quantities into a single quantity, called


the product. In fact, multiplication can be thought of as a consolidation of many
additions. Specifically, the product of xx and yy is the result of xx added
together yy times. For example, one way of counting four groups of two boxes is to add
the groups together:

2+2+2+2=8

However, another way to count the boxes is to multiply the quantities:

2⋅4=82⋅4=8

Note that both methods give you the same result—8—but in many cases, particularly
when you have large quantities or many groups, multiplying can be much faster.

Division

Division is the inverse of multiplication. Rather than multiplying quantities together to


result in a larger value, you are splitting a quantity into a smaller value, called
the quotient. Again, to return to the box example, splitting up a group of 8 boxes into 4
equal groups results in 4 groups of 2 boxes:

8÷4=2

7
The Basic Arithmetic Properties :

Commutative Property

The commutative property describes equations in which the order of the numbers
involved does not affect the result. Addition and multiplication are commutative
operations:

 2+3=3+2=52+3=3+2=5
 5⋅2=2⋅5=105⋅2=2⋅5=10

Subtraction and division, however, are not commutative.

Associative Property

The associative property describes equations in which the grouping of the numbers
involved does not affect the result. As with the commutative property, addition and
multiplication are associative operations:

 (2+3)+6=2+(3+6)=11(2+3)+6=2+(3+6)=11
 (4⋅1)⋅2=4⋅(1⋅2)=8(4⋅1)⋅2=4⋅(1⋅2)=8

Once again, subtraction and division are not associative.

Distributive Property

The distributive property can be used when the sum of two quantities is then multiplied
by a third quantity.
 (2+4)⋅3=2⋅3+4⋅3=18(2+4)⋅3=2⋅3+4⋅3=18

Negative Numbers Arithmetic operations can be performed on negative numbers


according to specific rules

8
Chapter 2 . body & method
2.1.signals
2.1.1 status

Type 1 –output he status outputs are various individual signals that convey
supplemental information about the result of the current ALU operation. General-
purpose ALUs commonly have status signals such as:

 Carry-out, which conveys the carry resulting from an addition operation, the borrow
resulting from a subtraction operation, or the overflow bit resulting from a binary
shift operation.
 Zero, which indicates all bits of Y are logic zero.
 Negative, which indicates the result of an arithmetic operation is negative.
 Overflow, which indicates the result of an arithmetic operation has exceeded the
numeric range of Y.
 Parity, which indicates whether an even or odd number of bits in Y are logic one.

At the end of each ALU operation, the status output signals are usually stored in
external registers to make them available for future ALU operations (e.g., to
implement multiple-precision arithmetic) or for controlling conditional branching. The
collection of bit registers that store the status outputs are often treated as a single, multi-
bit register, which is referred to as the "status register" or "condition code register".

Type 2_inputs

The status inputs allow additional information to be made available to the ALU when
performing an operation .typically this is a single "carry-in "bit that is the stored carry –
out fr0m a previous ALU opretion.

2.2.Data
A basic ALU has three parallel data buses consisting of two input operands (A and B)
and a result output (Y). Each data bus is a group of signals that conveys one binary
integer number. Typically, the A, B and Y bus widths (the number of signals

comprising each bus) are identical and match the native word size of the external
circuitry (e.g., the encapsulating CPU or other processor).

9
2.3. Apcode

The opcode input is a parallel bus that conveys to the ALU an operation selection code,
which is an enumerated value that specifies the desired arithmetic or logic operation to
be performed by the ALU. The opcode size (its bus width) determines the maximum
number of different operations the ALU can perform; for example, a four-bit opcode
can specify up to sixteen different ALU operations. Generally, an ALU opcode is not
the same as a machine language opcode, though in some cases it may be directly
encoded as a bit field within a machine language opcode

2.4 applications
2.4.1.Multiple-precision arithmetic

In integer arithmetic computations, multiple-precision arithmetic is an algorithm that


operates on integers which are larger than the ALU word size. To do this, the algorithm
treats each operand as an ordered collection of ALU-size fragments, arranged from
most-significant (MS) to least-significant (LS) or vice versa. For example, in the case of
an 8-bit ALU, the 24-bit integer 0x123456 would be treated as a collection of three 8-

bit fragments: 0x12 (MS), 0x34 , and 0x56 (LS). Since the size of a fragment exactly

matches the ALU word size, the ALU can directly operate on this "piece" of operand.

The algorithm uses the ALU to directly operate on particular operand fragments and
thus generate a corresponding fragment (a "partial") of the multi-precision result. Each
partial, when generated, is written to an associated region of storage that has been
designated for the multiple-precision result. This process is repeated for all operand
fragments so as to generate a complete collection of partials, which is the result of the
multiple-precision operation.

In multiple-precision shift operations, the order of operand fragment processing depends


on the shift direction. In left-shift operations, fragments are processed LS first because
the LS bit of each partial—which is conveyed via the stored carry bit—must be
obtained from the MS bit of the previously left-shifted, less-significant operand.
Conversely,

10
operands are processed MS first in right-shift operations because the MS bit of each
partial must be obtained from the LS bit of the previously right-shifted, more-significant
operand.

In bitwise logical operations (e.g., logical AND, logical OR), the operand fragments
may be processed in any arbitrary order because each partial depends only on the
corresponding operand fragments (the stored carry bit from the previous ALU operation
is ignored).

Figure(5)

11
2.5.disign of ALU

"To Design Is To Represent" Design activity yields description/representation of an


object.

 Traditional craftsman does not distinguish between the conceptualization and the
artifact.
 Separation comes about because of complexity.
 The concept is captured in one or more representation languages .

This process IS designDesign Begins With Requirements

-- Functional Capabilities: what it will do

Process Design

Finishes As Assembly

 Design understood in terms of components and how they have been assembled
 Top Down decomposition of complex functions (behaviors) into more primitive
functions.
 bottom-up composition of primitive building blocks into more complex
assemblies.
UPC
FGRDGDTR
TEETERETR
CETRTESC
CCCFOCC
htatataD DFFHFFC
UoranoC
FTF

ULC sgeR RDtfagn

dtrN etag

Design is a "creative process," not a simple method

12
Design Refinement

Informal System Requirement

Initial Specification

Intermediate Specification

Final Architectural Description

Intermediate Specification of Implementation refinement increasing level of detail

Final Internal Specification

Physical Implementation

Design involves educated guesses and verification

-- Given the goals, how should these be prioritized?

-- Given alternative design pieces, which should be selected?

-- Given design space of components & assemblies, which part will yield the best
solution?

Feasible (good) choices vs. Optimal choices

MIPS ALU requirements

° Add, AddU, Sub, SubU, AddI, AddIU

• => 2’s complement adder/sub with overflow detection

° And, Or, AndI, OrI, Xor, Xori, Nor

• => Logical AND, logical OR, XOR, nor

° SLTI, SLTIU (set less than)

13
2.6. Difference Between ALU and CPU

The key difference between ALU and CPU is that the ALU is an electronic circuit
which is a subsystem of CPU that performs arithmetic and logical operations while
CPU is an electronic circuit that handles instructions to operate the computer.

A computer system consists of both hardware and software. Hardware is the electronic
or mechanical components. Software refers to the data and instructions. The essential
component to perform the tasks of the computer is the CPU. CPU consist of two main
subsystems. They are the ALU and the Control Unit.

What is ALU?
ALU stands for Arithmetic and Logic Unit. It is a subsystem or a component of CPU.
The main objective of it is to handles arithmetic and logic operations. Arithmetic
operations are addition, subtraction, division, multiplication etc. The logical operations
determine whether a statement is true or false. Furthermore, Graphical Processing Units
(GPU), Floating Point Units (FPU) also have ALUs. A single CPU, FPU or a GPU can
have multiple ALUs to handle advanced calculations ALU performs various calculations.
The inputs to it are the data on which it is to operate. They are called operands. In a
mathematical expression such as “2+3 = 5”, 2 and 3 are the operands .

14
What is CPU?
CPU (or commonly known as a processor) handles instructions to perform various tasks
of the computer. The main subsystems of the CPU are ALU and CU. ALU handles
arithmetic and logical operations. The CU that stands for the Control Unit regulates and
synchronizes operations of the computer. And it consists of programmable registers and
other electronics. Therefore, it fetches instructions from memory, decodes them and
directs them to various units to perform the required task.
Memory is an important component for the CPU to function properly. It provides the
instructions for the CPU to perform, and also after data processing, the result goes back to
the memory for storing. Furthermore, the other components that CPU relies on are system
clock, secondary storage, data and address buses. CPU can process 32bit instructions or 64-
bit instructions depending on the computer architecture.
The difference between ALU and CPU is that ALU is an electronic circuit, which is a
subsystem of CPU that performs arithmetic and logical operations while a CPU is an
electronic circuit that handles instructions to operate the computer.

15
Chapter .3 .Conclusion
The arithmetic logic unit (ALU) is a coalition of digital electronic chain that executes
real numbers and bitwise logical operations on integer binary numbers.

The major performance parameters for an ALU are:

1. The variety of arithmetic and logic functions it can perform (i.e., the
functionality)
2. the speed of operation

The Arithmetic Logic Unit (ALU) is split into three units (and also three physical
cards): the logic unit, the arithmetic unit and the control unit. The logic and arithmetic
cards handle 8-bit logic and arithmetic functions respectively. The control unit handles
function decoding, zero detection and holds the condition registers.

About design

the Design Process

Hierarchical Design to manage complexity

Top Down vs. Bottom Up vs. Successive Refinement

Importance of Design Representationsa

Block Diagrams

Decomposition into Bit Slices

Truth Tables, K-Maps

Circuit Diagrams

Other Descriptions: state diagrams, timing diagrams, reg xfer. . . ,

Four bit Arithmetic Logic Unit (ALU) is designed and simulated using logic gates.
Forty eight logical and arithmatic operations are implementedn

The difference between ALU and CPU is that ALU is an electronic circuit, which is a
subsystem of CPU that performs arithmetic and logical operations while a CPU is an
electronic circuit that handles instructions to operate the computer.

16
The central processing unit (CPU) is a complex set of electronic circuitry that
executes program instructions; it consists of a control unit and an arithmetic/logic
unit.

The central processing unit interacts closely with primary storage, or memory.
Memory provides temporary storage of data while the computer is executing the
program. Secondary storage holds permanent or semipermanent data.

The control unit of the CPU coordinates execution of the program instructions by
communicating with the arithmetic/logic unit and memory—the parts of the system
that actually execute the program.

The arithmetic/logic unit (ALU) contains circuitry that executes the arithmetic and
logical operations.

17
Chapter .4. reference

1.“Arithmetic Logic Unit.” Wikipedia, Wikimedia Foundation, 22 Apr.


2018.

2.https://wps.prenhall.com/bp_capron_computers_8/9/2481/635350.cw/
content/index.html

3.http://www.eng.ucy.ac.cy/mmichael/courses/ECE314/alu-design.pdf.

4.https://www.sciencedirect.com/topics/computer-science/arithmetic-
logic-unit

18

You might also like