Computer - Arithmetic Logic Unit (ALU)



What is ALU?

ALU stands for Arithmetic Logic Unit. An ALU is a key component of the CPU which performs arithmetic and logical operations. It can perform billions of operations per second. An ALU circuit has the integration of four key components inputs, operands, outputs, and storage.

ALU

To store binary digits, computers use transistor switches that are either open or closed. Data is also stored in a register designated to store output. ALUs tend to be fast and accurate. These conduct logical operations such as bitwise operations, which are operations on a string of binary numbers. The CPU processor directly supports bitwise logical operations, which are fast, simple, and range from basic to higher-level. ALUs conduct bit shifting, which is the movement of bits in response to particular instructions from bit operators.

Block Diagram of ALU

ALUs may also do multiple-precision arithmetic, which is a software operation required when the desired level of accuracy exceeds the hardware's capacity. ALUs can do complex arithmetic and logical operations because they enable modern computers to split difficult calculations into a large number of binary processes.

What does the ALU do?

ALUs carry out arithmetic and logical operations. Also found in the CPU are Control Units, or CUs. The CU directs the ALU in performing specific operations, with the ALU being responsible for carrying out these operations.

The NOT Gate consists of a single transistor and one input logic gate. Its function is to produce outputs that are the inverse of the input. For instance, an input of 1 would result in an output of 0.

Multiple transistors and two inputs are used in the OR Gate. The output is only 1 if the first or second input is 1. Conversely, the OR gate produces an output of 0 when both inputs are 0.

The AND Gate utilizes multiple transistors and two inputs. The output is 1 only if both the first and second inputs are 1.

Functions of ALU

The ALU is an essential component of the CPU. It majorly performs arithmetic and logical operations on inputted data. The ALU has different electrical input and output connections that enable the transmission of digital signals between the ALU and external electronic devices. Data is provided to the ALU inputs by external circuits, and the ALU sends processed computational results. Some of the key functionalities of the ALU are as −

  • Arithmetic Operations − It includes addition, subtraction, multiplication, and division.
  • Logical Operations − It includes AND, OR, NOT, XOR (exclusive OR), and bit-shifting logical operations.
  • Comparison Operations − The ALU also performs a comparison of numbers to determine greater than, less than, or equal to.
  • Bitwise Operations − These include operations that change individual bits inside a data word, such as shifting them left or right and masking specific bits.
  • Data flow into the ALU − ALU has direct access to the CPU controllers, primary memory, and input/output devices. ALU takes input data from memory using the bus-like electrical route.
  • Applying functions − The internal components of the ALU are used to perform binary calculations for a variety of functions.
  • Provides Temporary Storage − The ALU commonly includes memory blocks to store input operands, operands to be added, accumulated results, and shifted results.

The ALU takes input from the processor's registers and gets back the results to the registers. It is a critical component of the CPU, allowing it to do the computations required for various tasks and operations in a computer system.

Advertisements