Parts of the CPU
The Arithmetic Logic Unit (ALU) is the part of the CPU that carries out calculations and tests on values. It is a CPU component, not a register: it works on values rather than storing them.
The ALU handles three kinds of operation:
if statement only chooses a branch once the ALU has compared the values.For example, a school trip is booking minibuses. Each minibus seats 15 students and 4 minibuses have been reserved, so the ALU multiplies 15 by 4 to get 60, which is stored in the Accumulator. The ALU then compares 60 with the 57 students who returned their permission slips and gives true, because there is room for everyone. The Accumulator holds the answer to a calculation, not the calculation itself.
The ALU does not fetch or decode instructions, and it does not control the flow of data around the CPU; the Control Unit does that. The ALU receives values, performs the operation it has been given and sends the result to the Accumulator.
OCR GCSE Computer Science · Parts of the CPU