processor carries out when it is executing a computer program.
Each cycle retrieves an
instruction from memory (fetch), translates it into a series of commands (decode), and then performs the required action (execute).
2 The following program is
stored in main memory, for the CPU to execute: Input num1 Input num2 num3 = num1 + num2
Explain how this short program would
be held in computer memory and how the control unit would carry out this program.
The short program is stored in main
memory as binary instructions that the CPU executes. The control unit reads these instructions and performs corresponding operations. The program has three instructions are num1 -retrieves input num1 from the input device, num2 - retrieves input num2 and adds them, resulting in num3 = num1 + num2. The control unit completes the program after executing the third instruction.