Working of CPU


Since the CPU carries out large volume of work in the computer, data passed continuously through it. The data comes from the other units. After processing the data is sent back to RAM and other units.

Now every time the CPU executes an instruction, it takes a series of steps. The completed series of steps taken to execute an instruction is called machine cycle. Each machine cycle is divided into:

  1. Instruction cycle
  2. Execution cycle


a. Instruction Cycle:


At the beginning of machine cycle i.e. during the instruction cycle, the CPU takes two steps:

  1. Fetching
  2. Decoding

During the fetching step, the control unit fetches or locates an instruction in the memory. During the decoding step, the control unit decodes the instruction into microcodes which corresponds to those on the CPU’s instruction set. Microcodes are the series of basic operations that tells the CPU how to execute complex tasks.


b. Execution Cycle:


During this, the control unit signals the ALU to execute the instruction. The ALU executes the instructions and stores the results in accumulator of other registers. The program counter register is incremented to identify the location of the next instruction to be executed. The similar process of fetch, decode and execute sequence in then repeated for next instruction. This process continues until the program ends. These processes take few milliseconds (about 200ms and below).

Through the process is complex, the CPU can translate millions of instruction every second. So the CPU’s performance is measured in millions of instructions per second (MIPS).





0 comments:

Post a Comment