What Does an Arithmetic Logic Unit Do?
- Starter
- Article
- Ages 10+
- 6 min read

The arithmetic logic unit (ALU) is the part of a processor that does integer arithmetic such as adding and subtracting, bit-by-bit operations such as AND and OR, and comparisons. It takes operands from registers, follows an operation signal from the control unit, and returns the result to a register, to memory or to the program counter.
Contents
- First operand (solid arrow into the left arm)
- Second operand (arrow into the right arm)
- ALU (V-shaped block with a plus)
- Result (arrow leaving the base)
- Status flags (frame with a round lamp and a square)
- Operation-select signal (dashed arrow from the left)
What you will learn
- Name the kinds of operation an ALU performs.
- Follow two operands from registers into the ALU and the result out again.
- Explain what a status flag is and who chooses the operation for the ALU.
Before you start
You only need to know that a processor runs instructions and that a register is a small storage cell inside it. Every other term is explained as it comes up.
Which operations can an ALU perform?
An ALU does three kinds of work: integer arithmetic, bit-by-bit operations and comparisons. That means addition and subtraction, AND, OR, NOT and XOR, and comparisons for equal to, greater than and less than. Put more briefly, in the Eight Bit Computer design the ALU performs arithmetical and logical operations using one or both of its inputs.
What is inside? An ALU can include an adder, circuitry that sets flags, a logic unit for the bitwise operations and comparisons, a shifter for bit shifts, and a multiplexer that picks the operation in use. A multiplexer is a selection circuit: it chooses one of several inputs and sends it to the output.
Subtraction does not need a wholly separate circuit: a ripple-carry adder can subtract once multiplexers and inverters are added.
- Adder (block with a plus sign)
- Logic unit (block with two overlapping circles)
- Shifter (block with a horizontal arrow)
- Multiplexer (trapezoid)
- ALU boundary (large frame)
- Operation-select signal (dashed arrow)
- Selected result (solid arrow to the right)
How does data get into and out of the ALU?
Operands come from the register file, and the result goes back to a register, to memory or to the program counter. The ALU takes its operands from the register file, computes, and returns the result to a register (for most operations), to memory (for STORE instructions) or to the program counter (for branches).
Take one instruction. ADD R1, R2, R3 adds the values in R2 and R3 and puts the result in R1. The two values are fetched from the register file, pass through the ALU, and the result is written to R1.
Who tells the ALU to add rather than to AND? The control unit, which interprets the instruction in the instruction register and generates the signals needed to move data through the datapath. Inside the datapath the multiplexers are largely controlled by signals from the control unit, so those signals decide which result is selected.
- Register file (stack of four slots)
- Two operands (arrows from the two filled slots)
- ALU (V-shaped block)
- Result written back to a register (path going down then up)
- Control unit (box with a round dot)
- Control signal (dashed arrow)
- Memory (stack of three slots on the right)
One easy mix-up: the ALU is not a place to keep data. The ALU is among the combinational logic blocks, which operate on data values. The things that hold state are state elements, such as registers and memory.
What are status flags and what are they for?
A flag is extra information about the result. Besides calculating the result, the ALU also stores pieces of information (flags) about the result or the two inputs. In the Eight Bit Computer teaching design, there are four flags: result is zero, result is negative, carry or borrow, and the two inputs are equal.
The ALU includes a status flag register, which holds condition codes. Flags matter when a program has to choose a path. After a conditional branch instruction, if the condition is true the program counter receives the branch target; if it is false, the program carries on in order. Not every processor sets its flags the same way, so this detail depends on the design.
Real-world example
Think of a pocket calculator. You key in two numbers, press a button to choose the operation, and the display shows one result. The two numbers are the operands, the button plays the part of the operation signal, and the display is the result. This is only an analogy: a real ALU works with electrical circuits on bits, and the control unit decides which operation runs, not a person pressing a key.
Common misunderstandings
The ALU is the whole processor. It is one part. The datapath consists of the control unit, one or more ALUs, multipliers, registers, flags and the buses that connect them.
An ALU can only add. It also subtracts, does the bit-by-bit operations, compares and shifts bits.
The ALU keeps data between instructions. Keeping data is the job of registers and memory.
Frequently asked questions
How is an ALU different from a control unit?
The ALU computes. The control unit interprets the instruction and generates control signals that move data through the datapath, including the signal that selects the operation.
Can a processor have more than one ALU?
It can. The datapath has one ALU or several.
Where are the status flags kept?
The ALU includes a status flag register that holds condition codes.
Summary
- An ALU does integer arithmetic, bit-by-bit operations, comparisons and bit shifts.
- Operands come in from the register file; the result goes to a register, to memory or to the program counter.
- The control unit selects the operation, and status flags hold information about the result.
Terms in this article
English and Vietnamese terms, with the meanings used here. Hover, tap or Tab to a term with a dotted underline for an explanation as you read.
- arithmetic logic unitkhối số học và logic
- The circuit in a processor that does arithmetic, logic and comparisons on data.
- operandtoán hạng
- A value fed into the ALU for an operation to work on.
- register filetập thanh ghi
- The group of registers the ALU takes operands from and can write results back to.
- multiplexerbộ ghép kênh
- A circuit that chooses one of several inputs and sends it to the output.
- flagcờ trạng thái
- A piece of information about the result or inputs of an operation, stored for later use.
- control unitkhối điều khiển
- The part of the CPU that interprets instructions and generates control signals for the datapath.
This article is not marked as viewed
Spotted something wrong or unsafe?
Tell the administrator by email. The message already has the article title and address.
More in this topic
StarterWhat Is a Microchip?
Understand microchips, transistors and chip packages through a phone example, and distinguish a semiconductor material from a finished circuit.
5 min read
StarterWhat Is Inside a Microchip?
Explore the semiconductor base, transistors and chip package, and see how these parts form a component used in electronic devices.
5 min read
StarterHow Do Voltage Levels Represent Digital Signals?
See how chips read HIGH and LOW from voltage, how logic families set thresholds, and how a transistor switch flips a level.
5 min read
StarterHow Do Bits, Bytes and Machine Words Differ?
Compare bits, nibbles, bytes and machine words by length, and understand why a byte has a fixed size while word length depends on the design.
5 min read
Sources
These sources are written for older readers. If they feel hard, read them with an adult.
- Datapath (CS 2210, University of Vermont)(opens in a new tab)
University of VermontTier A: government, standards or research bodiesRead on November 14, 2026
- Arithmetic logic unit (Eight Bit Computer)(opens in a new tab)
Eight Bit Computer documentationTier C: other sourcesRead on November 14, 2026
- Introduction to datapath (CS 61C, UC Berkeley)(opens in a new tab)
University of California, BerkeleyTier C: other sourcesRead on November 14, 2026
