Arithmetic Logic Unit In Computer Architecture

Arithmetic Logic Unit

What Is Arithmetic Logic Unit ( ALU ) ?

In computer architecture, the arithmetic logic unit ( ALU ) is an combinational digital electronic circuit and fundamental building block of all  microprocessor chips.

The ALU essentially works as a mathematical brain of the all processor chips. It performs all the arithmetic and logical operations performed by the processor.

The main function microprocessor ( CPU )  is to execute the computer program. The computer program contains set of machine instructions. The CPU executes the program.

In order to execute the program, the CPU has to perform number of arithmetic and logical operations as per the program instructions. These operations are performed by the ALU.

The ALU is an essential part of each central processing unit ( CPU ). The CPU is also alternately referred to as processor or a microprocessor.

Arithmetic Logic Unit , ALU, Arithmetic And Logic Unit

The ALU is also a crucial component of the Graphics Processing Unit ( GPU ) . A GPU is a dedicated processor used for handling the graphics processing which improves the system performance.

Depending upon the microprocessor architecture, the CPU and GPU can contain one or more Arithmetic and logic units. The ALU for the GPU is optimized for rapid graphics processing.

The ALU is a fundamental building block of all microprocessor. From simple to highly advanced microprocessor, all the processor chips, the ALU is a essential component.

In this article, you will learn what is arithmetic logic unit, how ALU works, functions of the ALU, logic gates and other important topics related to the central processing unit ( CPU ) and ALU.

Arithmetic Logic Unit ( ALU ) In Computer Architecture

ALU And CPU Architecture

The ALU is a crucial component of all the microprocessor chips. And therefore, The ALU operations can be best understood in the context of how CPU works.

The CPU stands for the central processing unit and it functions as a brain of the computer system. The CPU is an integrated circuit chip and crucial component of the computer system.

It is CPU is responsible to process the data as per the program instructions. The CPU provides the processing power to the computer by performing complex calculations.

Central Processing Unit CPU Functional Units

The processor internally consists of three functional units. These functional units are control unit ( CU ), arithmetic and logic unit ( ALU ) and the memory unit ( MU ).

The control unit ( CU ) decodes the operation code ( Opcode ) part of the machine instruction. The CU then directs the arithmetic logic unit ( ALU ) to perform a specific operation as per the operation code.

The ALU operates on the data ( Operand ) part of the machine instruction and processed data is stored into the memory unit ( MU ).

During the program execution, the CPU stores the program instructions and data into the internal high speed memory unit of the CPU. The memory unit consists of CPU registers.

What Are Arithmetic And Logic Operations ?

The ALU is a part of the processor and the number of operations supported by the processor ( operations performed by the ALU ) depends upon the instruction set architecture of the processor.

The modern processor contains highly advanced ALU circuit that is capable of performing complex arithmetic and logic operations.

The ALU is said to be a combinational circuit because the ALU circuit internally consists of combination of both arithmetic Unit and the logic unit.

Arithmetic Operations

The ALU performs both arithmetic and logic operations. The arithmetic operations of the ALU include all the basic mathematical operations.

For example, the ALU arithmetic operations includes addition, subtraction, division multiplication and raise to the power.

Logic Operations

All the decision making operations based on the conditional logic are said to be the logical operations.

The ALU logical operations include the grater than ( ≥ ) less than ( ≤ ) , comparison, equal to  shifting operations, Boolean operations comparisons ( XOR, OR, AND, and NOT operations ).

The ALU supports only binary operations. The arithmetic and logic unit internally consists of AU ( arithmetic unit ) and the LU ( logic unit ).

ALU Arithmetic Operations

ALU Logic Operations

+   Addition

=  Equal To , ≠  Not Equal To

-   Subtracition

> Greater Than 

÷  Division

<  Less Than 

 ×  Multiplication

≥ Greater Than Or Equal To

Raise By A Power

≤ Less Than Or Equal To

Arithmetic Logic Unit And Boolean Algebra

The arithmetic logic unit ( ALU ) handles three types of operations performed by the CPU. These three basic operations of the ALU include arithmetic, logical and shift operations.

The ALU circuits consists of different types of logic gates that allows the ALU to perform the logical operations. The logic gates are digital circuits and fundamental building block of all the digital circuits.

The computer system is a digital electronic machine. Since all the electronic components of the computer system works on the principles of digital electronic.

And therefore, the computer can execute the machine instructions in the binary format. The machine instructions are represented in binary that contains only two digits that is either zero or one.

ALU And Boolean Algebra

The ALU performs the logical operations with the help of logic gates. The ALU makes use of different types of logic gates to execute different logic operations.

A logic gate is an electronic device that works as a building block for all the digital electronic circuits. The logic gates perform basic logical functions that are essential for the digital circuits.

In a digital circuit, the logic gates will make decisions based on a combination of digital signals received from its inputs. Most logic gates have two inputs and one output.

Logic gates are based on the principles of the Boolean algebra.  In mathematics, the Boolean algebra is the branch of algebra in which the values of the variables are the truth values.

The Boolean algebra is based on the binary number system. The truth value is either true and false and it is denoted 1 and 0, respectively in the binary.

The logic gates take binary inputs and provide one single binary output. There are seven basic logic gates represented by specific symbol. There seven basic logic gates are AND, OR, XOR, NOT, NAND, NOR, and XNOR.

What Are Logic Gates ?

The arithmetic logic unit internally consists of two sub functional units which includes the arithmetic unit and the logic unit.

The arithmetic unit performs the arithmetic operations. Whereas, the logic unit performs the logic operations such as decision making.

When the program instruction contains the conditional logic, the CPU has to first evaluate the condition. The CPU further operation depends upon the result of the conditional expression.

The arithmetic logic unit executes the conditional statements with the help of the logic gates.

Types Of Logic Gates , ALU Logic Gates

The logic gates are used in the ALU to make decisions during the program execution. The logic gates allow the electrical outputs are only  ‘turn on’ when the correct logic sequence has been applied.

The logic gate has a specific name that helps to describe how different inputs will determine the possible outputs.

In order to understand how a logic gate works, the table of logic possibilities needs to be studied. In Boolean algebra , this table is called a ‘truth table’ .

In digital electronics, truth tables are used for planning and designing the logic gates.

Arithmetic Logic Unit Functions

The ALU is that functional part of the processor that operates on the data. The Opcode part of the instruction format defines the operation to be performed.

Whereas, the data is represented by Operand into the instruction format. The addressing mode part directs the control unit regarding the manner in which data is represented into the instruction format.

The arithmetic logic unit performs three types of functions.

  1.   To perform An Arithmetical Operations.
  2.   To perform The Bitwise Logic Operations.
  3.   To perform The Bit Shift Operations.
Instruction Format 16 Bits , Instruction Register

Bitwise Logic Operations

The bitwise logic operations include all the basic decision making operations such as AND , OR , Exclusive-OR   bitwise  XOR, 

Bit Shift Operations

The bit shift operations are used to move the bits to either the left or right in an instruction word.

There are three types of bit shift operations performed by the ALU. These bit shift operations are logical shift, arithmetic shift and rotate. A logical bit shift operation moves bits to the left or right.

The bits which ‘fall off’ the end of the instruction word are discarded. The falling bit in the instruction word is replaced by 0’s from the opposite end.

How ALU Works ?

The arithmetic logic unit ALU plays an important role in the program execution. The ALU is part of the processor which performs the mathematical calculations and decision-making logical operations.

The program execution starts when operating system loads the program into the main memory RAM. The microprocessor is responsible to execute the program.

The CPU initiates the program execution by its internal execution mechanism called an instruction cycle. The instruction cycle is the basic CPU operation which consists of four steps.

Instruction Cycle Example

The instruction cycle is a four stage CPU operation and it is also called as fetch, decode and execute cycle.

The CPU initiates the program execution by fetching the program instructions one by one. The program instruction is also referred as machine instruction or instruction word.

Each time the instruction is fetched, the program counter ( PC ) register is incremented so that it points to the address of the next instruction.

Each processor has three functional units which includes control unit, arithmetic logic unit and the memory unit.

The control unit ( CU ) inside the processor controls the entire execution cycle performed by the processor and generates the necessary control signals.

The control unit is also responsible to decode the program instruction stored into the instruction register. The decoding part of the instruction takes place in the control unit as per the instruction format.

The operation code ( Opcode ) part of the instruction format is decoded by the control unit CU to decode which operation is to be performed. The CU also decodes the Operand to fetch the data.

After the decode operation is completed, the control unit generates the necessary control signals and directs the ALU to perform the desired operation as specified in the Opcode.

The arithmetic logic unit ( ALU ) then performs the necessary mathematical and logical operations on the data. The processed data is stored into the output register and then transferred to the main memory.

The operating system regains the control of the processed data stored into the main memory RAM for further action.

Arithmetic Logic Unit FAQ

In computer architecture, the arithmetic logic unit ( ALU ) is an combinational electronic circuit which handles arithmetic and logical operations of the processor. The ALU is a fundamental building block of all the microprocessor chips.

The ALU essentially works as a mathematical brain for the central processing unit ( processor chip ) that performs the arithmetic and logical operations performed by the processor.

The ALU components depending upon its architecture can consists of arithmetic unit and logic unit. The arithmetic unit performs all arithmetic operations.

The logic unit handles all decision making logical operations of the CPU. For example, logic functions are AND , OR , Exclusive-OR   bitwise  XOR.

A processor ( CPU ) is an integrated circuit ( IC ). The processor consist of millions of IC chips and each IC chip consist of millions of tiny component called transistor. The Transistor is madeup of silicon which is a semiconductor material .

The processor ( CPU ) controls all the activities of the computer system. And therefore it is referred as brain of the computer system. There are two main computer processor manufacturers  Intel and Advanced Micro Devices ( AMD ). These two companies produce most of the processors used in desktop,  laptops  and  notebooks.

A  Central Processing Unit ( CPU )  performs millions  tasks per second  to execute a  computer program by performing the basic arithmetic, logical, control and input  /  output ( I / O ) operations  as  specified  by the  program  instructions. 

A   CPU  is  placed  on  the  motherboard  in  a  processor  socket  with  locking  liver mechanism   in  order  to  fix  the  processor  chip  properly  into the  processor  socket . The processor socket contains a IC socket in which the processor  chip is firmly mounted . A heatsink  is mounted on the top of the processor chip which  protects  the processor  from  excessive  heat generated.

The arithmetic logic unit performs three important functions to execute the program instructions and operate on the data.

The control unit decodes the machine instructions and directs the ALU to perform specific operation.

  • To perform The Arithmetical Operations.
  • To perform The Bitwise Logic Operations.
  • To perform The Bit Shift Operations.

The Logic gates are electronic components used in the digital electronics to handle logical functionality.

The logic gate is an electronic circuit used in the ALU to compute a function on a two valued signal. Logic gates are the basic building block of digital circuits.

The logic gates accept two inputs and produce one output. Some logic gates like NOT gate has only one input and one output.

The logic gate being a digital electronic component,  can handle inputs only in the binary format (only low 0, or high 1) by receiving the input voltage.

Join The Best Seller

Computer Science Online Course

This is the most comprehensive  and unique  Computer Science  And Programming Fundamentals course Online which will give you in depth understanding of most important fundamental concepts in computer science And Programming .

Don`t copy text!