Spiceworks Inc

What Is an Arithmetic Logic Unit (ALU)? Meaning, Components, and Functions

ALU is a circuit in the CPU which performs mathematical and logical operations using electrical signals in 0s and 1s.

April 24, 2023

A symbolic imagery displaying the complex circuitry of ALUs

Table of Contents

What Is an Arithmetic Logic Unit (ALU)?

Arithmetic logic unit (ALU) is a circuit board embedded within a computer’s central processing unit (CPU), which performs mathematical and logical operations using gateways made of electrical transistors that can convey signals in 0s and 1s.

Illustration of ALU

Source: WebeduclickOpens a new window

At its core, the ALU is a digital combinational circuit that executes arithmetic and bitwise functions on integer binary variables. In contrast, a floating-point unit (FPU) handles floating-point values (i.e., numerical operations on a probability-led rendition of real values).

If the CPU is the computer’s brain, then the ALU is its calculator. It is where the circuitry to perform arithmetic computations on information stored in registers occurs. It also contains the circuitry for comparing values, such as determining if the values in registers are identical.

Everything is ultimately coordinated by the CU (control unit), which employs the ALU, memory unit, registers, and other CPU components as required to fetch and decode instructions, read data from storage, execute the commands, and possibly write registers back.

While this overarching function remains the same, arithmetic logic units (ALUs) can be of the following types:

How were ALUs developed?

In 1945, the mathematician John von Neumann presented the ALU idea in a study on the EDVAC computer’s underpinnings.

Throughout the early stages of the information era, electronic circuitry was fairly expensive, large, and energy-consuming. Therefore, most early computers, such as the PDP-8, featured a rudimentary ALU that simultaneously worked on a single data bit while presenting programmers with a larger word size (the greatest quantity of bits a CPU can compute at once).

The 1948 Whirlwind I was one of the early computers with several ALU circuits and the ability to process 16-bit words.

Fairchild created the very first ALU constructed as an integrated circuit in 1967 with the Fairchild 3800, which consisted of an 8-bit ALU with only an accumulator. Other integrated ALUs followed quickly. Typically, these devices were “bit slice” capable, which meant that they enabled the use of many linked ALU chips to construct an ALU with a larger word size.

The next phase in the evolution of ALUs was when microprocessors began to appear in the 1970s. Although transistors were reduced in size frequently, there was insufficient room for a full-word-width-complete ALU. Consequently, several early microprocessors had a limited ALU that required many cycles per instruction.

Following Moore’s law, transistor geometries shrunk further over time, making constructing bigger ALUs on microprocessors possible.

Modern integrated circuit (IC) circuits are exponentially thinner than early microprocessors, allowing very complicated ALUs to be accommodated on ICs. Numerous ALUs of the present day have broad word widths and features like barrel shifters or binary multipliers. This enables them to execute (in just one clock cycle) operations that require numerous clock cycles on prior ALUs.

ALUs may be implemented as mechanical, electro-mechanical, or entirely electronic circuits, but their core operations and conceptualization remain unchanged.

See More: What Is a Software Engine? Types, Applications, and Importance

How does an arithmetic logic unit work?

The ALU is equipped with an assortment of electrical output and input connections, resulting in the transmission of digital signals between both the ALU and the external electronics. External circuits supply data to the ALU inputs, and the ALU transmits information directly to the external electronics, indicating the mathematical program’s output.

See More: CPU vs. GPU: 11 Key Comparisons

Where is the ALU used?

Arithmetic logic units are integral to nearly every computing system capable of processing data. It is found in all advanced processors, and its core uses include the following:

See More: What Is USB (Universal Serial Bus)? Meaning, Types, and Importance

ALU Components

An ALU has two main components — the arithmetic unit and the logic unit, along with some additional components. Here is a brief overview of each.

ALU Components

1. Arithmetic unit

The arithmetic unit performs all numerical operations in a computer, like addition and subtraction. It also performs other basic operations, such as the increment operation. At its most fundamental level, the ALU component combines two binary digits. Two input signals, X and Y, may yield an output consisting of the summation of two digits. The output, X and Y, are all single bits.

Since X and Y can be 0 or 1, the first three possibilities are 0+0=0, 0+1=1, and 1+0=1 (1 is equal to true, and 0 is equal to false). However, 1+1 in binary language equals (10)2, which has more than one bit. The arithmetic unit ALU has a special circuit called the half adder to accommodate this. In addition to half adders, the ALU has full and 8-bit adders, which are essentially circuit architectures.

2. Logic unit

The logic unit is the second half of the ALU. Instead of mathematical operations, the logic unit performs logical operations such as AND, OR, and XOR. In addition, it conducts numerical tests. For instance, it determines whether or not the integer is negative. It also regulates whether the ALU’s output is zero. In addition, it supports a variety of flags, including overflow, zero, and negative. These flags assist us by identifying if the output is 0 or not and which input is greater than another.

In addition to these core components, the ALU contains:

3. Built-in storage

The ALU typically has storage locations for input operands, adding operands, the cumulative result (saved in an accumulator), and shifting results. Gated circuits control the movement of bits and the tasks performed on them within the ALU’s subunits. These gates are regulated by a sequential logic unit that employs a specific algorithm or sequencing for every operation code. In the arithmetic logic unit, division and multiplication are accomplished using a sequence of additions, subtractions, and shifts.

Let us now take a closer look at the accumulator component.

4. Accumulator

In a computer’s ALU, the accumulator is a buffer that stores intermediary arithmetic logic unit outcomes. During the processing cycles, it stores data or the findings of an operation. During every ALU operation, the accumulator may contain any of the operands. For instance, if we wanted to add two bytes, one would be placed in the accumulator and the second in memory or a general-purpose register.

5. General-purpose register

A register functions as a fast memory for receiving, storing, and transmitting information and instructions, which the ALU (and, therefore, the CPU) will require immediately. General purpose registers comprise additional CPU registers employed whenever data or a memory address is necessary. These registers serve as storage for operands and pointers. Notably, a numerical value used as input for an action is called an operand, and a pointer indicates instructions.

6. Data buses

A data bus is utilized to transport data from the memory to the registers and from the registers to the memory. A fundamental ALU consists of three parallel data buses containing two entry operands (X and Y) and one output. Every data bus is a collection of signals carrying a single binary integer. Generally, the total number of signals composing each bus and the exterior circuit encircling the ALU are similar (such as the enclosing CPU).

7. Circuit operation

The circuit is the last and most important component of the ALU. The ALU is a combined logic circuit, meaning its outputs respond asynchronously to input changes. In normal functioning, the ALU inputs receive steady signals. When sufficient time has elapsed (called the “propagation delay”), the outcome of the operation is transferred to the output register.

External circuitry attached to the ALU is accountable for maintaining input signal stability. In addition, adequate time is allowed for the signal to propagate before the findings are evaluated.

See More: 9 Types of Device Drivers and Their Applications

Functions of an ALU

The arithmetic logic unit performs numerous functions. Let’s understand a few.

ALU Functions

1. Basic mathematical operations

It executes arithmetic operations such as addition, subtraction, and multiplication. It may include X and Y as carry-in or carry-out options, which occurs when the result cannot fit in a 1-bit binary structure. Similarly, it can subtract B from A or vice versa with the difference at Y and carry-in or carry-out.

2. Advanced mathematical operations

The ALU can also perform advanced operations like increments and decrements. When X or Y is raised by 1, and the output reflects the new value, this is an increment. Similarly, decrement occurs when X or Y is lowered by 1, with the output representing the new value.

3. Logic operations

It executes logical operations such as AND, OR, X-OR, NOT, etc. These are essentially instructions or rules that help the ALU determine whether something is true or false given a set of conditions. AND and OR functions allow the arithmetic logic unit to understand how two conditions work together. It also plays an important role in logic calculations, such as fuzzy logic.

4. Bit shift operations

This function relates to ALU shift operations, whereby one can shift the X (or Y) operand left or right and output the shifted operand. Typically, simple ALUs can only move the operand by a one-bit position. Complex ALUs use barrel shifters, which enable processors to move the operand by a definite number of bits in a single operation.

5. Data checks through special value

ALUs may also provide distinct outputs. They create different signals that are frequently used to regulate program branching. Traditional ones include Z (zero), C (carry), N (negative), or V. (signed carry). These values may provide a wealth of information. For instance, if the result of subtracting two integers is 0, both must be identical. This is equally applicable to larger than and less than calculations.

6. Transferring data to and from registers

The arithmetic logic unit accepts the accumulator or temporary register’s inputs. Additionally, the result is stored in the accumulator (the temporary register). Lastly, it delivers outcome states to the signal register.

7. Specially programmed operations

Engineers can also program the ALU to perform any operation of their choice, such as in the case of supercomputers. However, as the complexity of the operations increases, the ALU becomes much more expensive as it generates more heat and occupies more space on the CPU. Therefore, there needs to be a balance between the complexity and strength of ALU and its cost. The fundamental reason faster CPUs are much more expensive is that their ALUs use more energy and generate more heat.

See More: What Is BIOS? Meaning, Types, and Importance

Takeaway

Since the birth of computing, arithmetic logic units have been at the center of mathematical calculations and data-driven performance. Today, ALUs may take a backseat in personal computing but are integral to business operations like data analytics, forecasting, financial analysis, etc.

Companies are constantly working to develop new and more advanced ALUs. For example, GBT Technologies recently filed a patent for a new ALU architecture that uses proprietary circuitry and parallelization to speed up processes. Enterprises must stay abreast of new ALU developments and trends to use the most sophisticated computing technology available today.

Did this article help you understand the working of an arithmetic logic unit? Tell us on FacebookOpens a new window , TwitterOpens a new window , and LinkedInOpens a new window . We’d love to hear from you!

Image source: Shutterstock

MORE ON HARDWARE

Chiradeep BasuMallick

Technical Writer

Chiradeep is a content marketing professional, a startup incubator, and a tech journalism specialist. He has over 11 years of experience in mainline advertising, marketing communications, corporate communications, and content marketing. He has worked with a number of global majors and Indian MNCs, and currently manages his content marketing startup based out of Kolkata, India. He writes extensively on areas such as IT, BFSI, healthcare, manufacturing, hospitality, and financial analysis & stock markets. He studied literature, has a degree in public relations and is an independent contributor for several leading publications.

Recommended Reads

Exit mobile version