The ALU (Arithmetic Logic Unit) performs various operations, such as arithmetic and logical operations, using operands and control signals received from the registers and the CU(Control Unit) within the CPU.
The speed at which the CPU accesses memory is much slower than the speed at which it accesses registers.
→ The result of the ALU is first stored in a register rather than in memory.
The ALU outputs flags along with the result of an operation
Flags are used by the CPU to determine conditions such as overflow, zero result, or carry, which affect the flow of control during program execution.
Register is a small, temporary storage unit inside the CPU that holds instructions and data from a program before and after execution.