Arithmetic Logic Unit -The ‘Brain’ Of the Computer

A computer is a wonder of technology. It is an electronic device that we can program to our own ease. A computer accepts raw data as input and proceeds to process it. The computer uses a set of commands called a program to compute the result. This result is called output. It shows the output just after doing math and/or logical operations. The computer can save the output. This is to use the output in the future. The computer is able to do stuff based on numbers as well as the ones not based on numbers. Scientists derived the term “computer” from the Latin word “computare”. “Computare” means to calculate.

Arithmetic Logic Unit

A computer is made to be able to execute commands. The user provides the commands to the computer. It provides a variety of solutions through both the software and hardware parts. It takes the help of programs and represents the decimal numbers through a set of binary digits. The binary digits used are 1 and 0. The computer also has a memory that stores the input data, programs. The memory stores the produced outputs too. The physical components of a computer are called hardware. Hardware consists of the main machinery. Examples of hardware are wires, transistors, circuits, hard disks etc. Whereas, the programs and stored or input data are called software.

Charles Babbage invented the Analytical Engine in 1837. The Analytical Engine was the first computer. It used punch cards containing data as read-only memory. Charles Babbage is also known as the father of the computer.

Parts of a computer

The basic parts of a computer are as follows:

  • Processor: It connects the software and hardware and tells them how to work. It acts as an intermediate between the two. The processor is made up of the Arithmetic Logic Unit (ALU).
  • Memory: It is the primary memory for data transfer between the central processor and storage.
  • Motherboard: It is the part that connects all other parts of a computer. This part acts like the original commander for all parts of the computer.
  • Storage Device: It permanently stores the data in the hard drive.
  • Input Device: It allows the user to communicate with the computer. It also allows the user to input data. Examples of such devices include a keyboard, mouse etc.
  • Output Device: It enables the user to see the output. Most commonly it is a monitor.

What is the Arithmetic Logic Unit (ALU) and its components?

In a computer system, the Arithmetic Logic Unit (ALU) is a prime part of the Central Processing Unit (CPU). The ALU can do math and logical operations. We can also call it Integer Unit (IU). The IU is an integrated circuit within a CPU which is the last part to compute problems in the processor.

It is able to perform various types of arithmetic and logical operations. For example, you can do simple stuff such as addition, subtraction, and shifts. You can also perform Boolean comparisons for example; XOR, OR, AND, and NOT operations. It also uses binary numbers to perform math and bitwise operations.

What are the two parts of the Arithmetic Logic Unit (ALU)?

We hereby split the arithmetic logic unit into two parts. The two parts are AU (arithmetic unit) and LU (logic unit). The mode of operations and programs used by the ALU help it to identify operations. Specifically the operations that need to be performed according to the data input. When the ALU completes processing the input, the processed data is sent to the computer’s primary memory.

Arithmetic Logic Unit

Arithmetic Logic Unit (ALU) in Computer Architecture

Besides performing stuff like the usual binary operations such as addition and subtraction, ALUs handle multiplication of two integers too. The Arithmetic Logic Unit (ALU) can also multiply two integer numbers. The input integers come from the user. The output of this is also an integer.

However, the ALU may not be able to perform division of numbers. This is because division may produce an output in a floating-point number. Therefore, the Floating Point Unit (FPU) handles this operation. The FPU can also calculate stuff on numbers that are not integers. The FPU follows commands through programs to get the result.

We can also design the Arithmetic Logic Unit (ALU) to perform any possible type of operation. However, the ALU becomes costlier to design. This is because the operations become much more complex. The reasons being that the ALU releases more heat. The ALU also takes up more space in the CPU. This is the reason for which the engineers make powerful ALU. The ALUs need less space to house it within the CPU.

The results required by the CPU are all handled by the Arithmetic Logic Unit (ALU). Most of the operations among the required ones are completely based on logic. If the CPU is made more powerful, which depends on the basis of how the ALU is created. Then it releases more heat and needs more power or energy. Therefore, there must be a middle line between how powerful and efficient the ALU is. This is also to make sure that the Arithmetic Logic Unit (ALU) is not very costly.

Arithmetic Logic Unit (ALU) Operations

The Arithmetic Logic Unit (ALU) is a major part of the processor. Despite this the design of the ALU and function may be different in the various processors. For instance, we design some Arithmetic Logic Units (ALU) specifically to perform only calculations involving integers. We can also design some for operating on only floating-point numbers. Some programmed processors include a single Arithmetic Logic Unit (ALU) to perform operations. While other processors may contain numerous ALUs to complete the required operations.

The operations performed by ALU are as follows:

  • Logical Operations: The logical operations include OR, AND, NOR, NAND, NOT, XOR, and others.
  • Bit-Shifting Operations: Such operations cause changes in the locations of the bits to the left or right. This happens in a certain number of places. We call such an operation a multiplication.
  • Arithmetic Operations: Although the (ALU) can multiply and divide, this refers to bit addition and subtraction. But multiplication and division operations are more expensive to program. In the place of multiplication, the Arithmetic Logic Unit (ALU) can also use addition as a substitute. Similarly, the Arithmetic Logic Unit (ALU) can use subtraction as a substitute for division.

Arithmetic Logic Unit

Arithmetic Logic Unit (ALU) signals

The Arithmetic Logic Unit (ALU) contains many input and output electrical circuits. This leads to casting the digital signals between the devices. The devices are external electronics and the Arithmetic Logic Unit (ALU).

The Arithmetic Logic Unit (ALU) gets input signals from external circuits. And in response, the Arithmetic Logic Unit (ALU) sends output signals to the external hardware.

Data: The Arithmetic Logic Unit (ALU) contains three parallel buses. These buses include two input and output operands. These three buses handle the number of input signals. The numbers remain the same and do not vary.

Opcode: When the Arithmetic Logic Unit (ALU) is going to perform the required operation, it is elaborated by the operation selection code. This code tells the Arithmetic Logic Unit (ALU) what type of operation an ALU is going to perform. This means whether it’s an arithmetic or logical operation.

The Arithmetic Logic Unit (ALU) deals with the status of the inputs in the following ways;

  • Output: The output results of the Arithmetic Logic Unit (ALU) operations are given by the status outputs. This output is in the form of packets of data as there are multiple signals. Usually, the status signals are zero, carry out, overflow, negative, and more. They are contained by the simple Arithmetic Logic Units (ALU). When the Arithmetic Logic Unit (ALU) completes each operation, the external registers of the device contain the status output signals. The external registers store these signals that allow them to be there for future Arithmetic Logic Unit (ALU) operations.
  • Input: When the Arithmetic Logic Unit (ALU) once follows the commands, the status inputs allow the Arithmetic Logic Unit (ALU) to access further data to complete the operation. Hereby, we call the stored carry-out function from a previous Arithmetic Logic Unit (ALU) work a single “carry-in” bit.

Arithmetic Logic Unit (ALU) Functions

Arithmetic Logic Unit (ALU) does a number of basic arithmetic and logic functions. General purpose Arithmetic Logic Units that are pretty basic usually include these operations in their programs.

Arithmetic operations

  • Addition: Arithmetic Logic Unit (ALU) adds A and B and the final sum appears at Y and carry-out.
  • Add with carry: Arithmetic Logic Unit (ALU) adds the input numbers A, B and carry-in. Thereby, the ALU makes the sum appear at Y and carry-out.
  • Subtraction: Arithmetic Logic Unit (ALU) deducts B from A (or vice versa). Then the ALU shows the final difference at Y and carry-out. For this operation, carry-out is an important indicator of “borrow”. This operation can also compare the values of A and B. And in such cases the processor will ignore the Y output. This is because the processor only needs the status bits (particularly zero and negative) that result from the code.
  • Subtract with borrow: Arithmetic Logic Unit (ALU) deducts B from A (or vice versa) with borrow (carry-in). This results in the computed difference appearing at Y and carry-out (borrow out).
  • Two’s complement (negate): Arithmetic Logic Unit (ALU) subtracts A (or B) from zero. Then the ALU makes the output difference appear at Y.
  • Increment: Arithmetic Logic Unit (ALU) increases A (or B) is by one and the resulting value appears at Y.
  • Decrement: Arithmetic Logic Unit (ALU) decreases A (or B) is by one and the final value appears at Y.
  • Pass through: All bits of A (or B) appear unchanged at Y. The Arithmetic Logic Unit (ALU) typically uses this operation to determine the parity of the operand. It also finds out whether it is zero or negative. It also uses this process to load the operand into a processor register.

Bitwise logical operations

  • AND: the bitwise AND operation of input A and B appears at Y.
  • OR: the bitwise OR result of numbers A and B appears at Y.
  • EXCLUSIVE-OR: the bitwise XOR calculation of A and B appears at Y.
  • ONE’S COMPLEMENT: Arithmetic Logic Unit (ALU) reverses all bits of A (or B) and makes them appear at Y.

Bit shift operations

  • Arithmetic Shift: (ALU) treats this operand as a complement of two integers. This means that the most significant bit is a “sign” bit. Hence, the Arithmetic Logic Unit (ALU) preserves it.
  • Logical Shift: Arithmetic Logic Unit (ALU) shifts a logic zero into the input operand. Arithmetic Logic Unit (ALU) uses this operation specifically to shift integers that do not include a sign.
  • Rotate: the Arithmetic Logic Unit (ALU) treats the operand as a circular buffer of bits so its least and adjacently puts the most important bits efficiently.
  • Rotate through carry: the Arithmetic Logic Unit (ALU) treats the carry bit and operand collectively as a circular buffer of bits within the operation.

Arithmetic Logic Unit (ALU) Examples

We can also design the Arithmetic Logic Unit (ALU) to conduct any type of operation. The user of the computer gives the commands for the ALU to execute. However, the ALU needs more money and effort to design as the operations become more complex. The reasons being that the ALU releases more heat. The ALU also takes up more space in the CPU. This is the reason for which we try to make a powerful ALU. The ALUs need less space to house it within the CPU. This is the main reason the faster CPUs are much more expensive. Hence, they take much power and remove more heat. Arithmetic Logic Unit (ALU) mainly performs arithmetic and logical operations. Besides them, the ALU also performs bit-shifting operations. These operations are a bit more complex than the regular ones.

Read Also: Sum of cubes: Natural numbers, formulas, examples, and more

Besides being able to do the basic binary operations such as addition and subtraction, ALUs can multiply two integers too. We have designed the multiplication function to execute calculations on integers; hence, its output is also an integer.


What is the design of Arithmetic Logic Unit?

The Arithmetic Logic Unit is made up of different integrated circuits. The circuits have connected buses within them that can transmit information. A program is used by the circuit to perform the tasks required by the user.

What is Arithmetic Logic Unit and Control Unit?

The Arithmetic Logic Unit has two specific parts that are the AU and LU. The LU is referred to as the Control Unit. While the AU is the main center to produce output, the code paths are located in the control unit of the ALU. The control unit is important to help the ALU compute.