Download the BYJU'S Exam Prep App for free GATE/ESE preparation videos & tests - Download the BYJU'S Exam Prep App for free GATE/ESE preparation videos & tests -

ALU (Arithmetic Logic Unit)

An arithmetic logic unit (ALU) is a key component of a computer’s central processor unit. The ALU performs all arithmetic and logic operations that must be performed on instruction words. The ALU is split into two parts in some microprocessor architectures: the AU and the LU.

In this article, we will dive deeper into ALU (Arithmetic Logic Unit) according to the GATE Syllabus for (Computer Science Engineering) CSE. Keep reading ahead to learn more.

Table of Contents

What is ALU (Arithmetic Logic Unit)?

ALU conducts arithmetic and logic operations. It is a major component of the CPU in a computer system. An integer unit (IU) is just an integrated circuit within a GPU or GPU that performs the last calculations in the processor.

It can execute all arithmetic and logic operations, including Boolean comparisons, such as subtraction, addition, and shifting (XOR, OR, AND, and NOT operations). Binary numbers can also perform bitwise and mathematical operations. AU (arithmetic unit) and LU (logic unit) are two types of arithmetic logic units. The ALU’s operands and code instruct it on which operations to perform based on the incoming data. When the ALU has finished processing the data, it sends the result to the computer memory.

alu-arithmetic-logic-unit

Uses of ALU

ALUs, in addition to doing addition and subtraction calculations, also handle the process of multiplication of two integers because they are designed to perform integer calculations; thus, the result is likewise an integer. Division operations, on the other hand, are frequently not done by ALU since division operations can result in a floating-point value. Instead, division operations are normally handled by the floating-point unit (FPU), which may also execute other non-integer calculations.

Engineers can also design the ALU to do any operation they choose. However, as the operations become more sophisticated, ALU becomes more expensive since it generates more heat as well as takes up more space on the CPU. Therefore, engineers create powerful ALUs, ensuring that the CPU is both quick and powerful.

The ALU performs the computations required by the CPU; most of the operations are logical in nature. If the CPU is built more powerful, it will be designed on the basis of the ALU. Then it generates more heat and consumes more energy or power. As a result, there must be a balance between how intricate and strong ALU is and how much it costs. The primary reason why faster CPUs are more expensive is that they consume more power and generate more heat due to their ALUs. The ALU’s major functions are arithmetic and logic operations, as well as bit-shifting operations.

Operations Performed by ALU

Although the ALU is a critical component of the CPU, the design and function of the ALU may vary amongst processors. Some ALUs, for example, are designed solely to conduct integer calculations, whereas others are built to perform floating-point computations. Some processors have a single arithmetic logic unit that performs operations, whereas others have many ALUs that conduct calculations. ALU’s operations are as follows:

1. Arithmetic Operators: It refers to bit subtraction and addition, despite the fact that it does multiplication and division. Multiplication and division processes, on the other hand, are more expensive to do. Addition can be used in place of multiplication, while subtraction can be used in place of division.

2. Bit-Shifting Operators: It is responsible for a multiplication operation, which involves shifting the locations of a bit to the right or left by a particular number of places.

3. Logical Operations: These consist of NOR, AND, NOT, NAND, XOR, OR, and more.

ALU Signals

The ALU contains a variety of electrical input and output connections, which result in the digital signals being cast between the ALU and the external electronics. External circuits send signals to the ALU input, and the ALU sends signals to the external electronics.

Opcode: The operation selection code specifies whether the ALU will conduct arithmetic or a logic operation when it performs the operation.

Data: The ALU contains three parallel buses, each with two input and output operands. These three buses are in charge of the same amount of signals.

Status

Input: Once ALU has completed the operation, then the status inputs allow the ALU to obtain more information needed to complete the process successfully. A single “carry-in” is used, which is a stored carry-out from the prior ALU operation.

Output: The status outputs, which are numerous signals, offer the results of an ALU operation in the form of extra data. Overflow, carry out, zero, negative, and other status signals are usually handled by general ALUs. The status output signals were stored in the external registers after the ALU completed each operation. These signals are saved in external registers, which allows them to be used in future ALU operations.

alu-arithmetic-logic-unit

ALU Configurations

The following is a description of how the ALU interacts with the processor. These configurations are included in every arithmetic logic unit:

  • Accumulator
  • Instruction Set Architecture
  • Stack
  • Register Stack
  • Register to Register
  • Register Memory

Pros of ALU

The following are some of the benefits of ALU:

  • It supports high-performance parallel architecture and applications.
  • It can provide the desired output at the same time and combine integers and floating-point variables.
  • It has the ability to carry out instructions on a large number of items and has a high level of precision.
  • The ALU can combine two arithmetic operations in the same code, such as multiplication and addition or subtraction and addition, or any two operands. A+B*C is an example.
  • They remain consistent throughout the presentation, and they’re spaced in such a way that they do not interrupt any of the segments.
  • It is, in general, highly rapid, and as a result, it produces results swiftly.
  • With ALU, there are no sensitivity difficulties or memory wastage.
  • They are less costly and reduce the number of logic gates required.

Cons of ALU

The following are some of ALU’s drawbacks:

  • Floating variables have higher delays with the ALU, and the intended controller is difficult to grasp.
  • If memory space were fixed, bugs would appear in the results.
  • Amateurs are tough to understand since their circuits are complex, and the principle of pipelining is also difficult to grasp.
  • The inconsistencies in latencies are a known drawback of ALU.
  • Another flaw is rounding off, which reduces precision.

Practice Problems on ALU (Arithmetic Logic Unit)

1. Which of these refers to the ‘heart’ of a processor that performs various different operations?

a. Memory

b. Control Unit

c. Motherboard

d. Arithmetic and logic unit

Answer – (d) Arithmetic and Logic Unit

2. Which of these does not refer to a bitwise operator?

a. <<

b. .

c. ^

d. |

Answer – (b) .

3. There are a total of ______________ numbers of bits in ALU.

a. 8

b. 4

c. 2

d. 16

Answer – (d) 16

Keep learning and stay tuned to get the latest updates on GATE Exam along with GATE Eligibility Criteria, GATE 2023, GATE Admit Card, GATE Syllabus, GATE Previous Year Question Paper, and more.

Also Explore,

Comments

Leave a Comment

Your Mobile number and Email id will not be published.

*

*