The machine instruction cycle: Difference between revisions

From Computer Science Wiki
Line 25: Line 25:
'''Address Bus:''' The address bus is a data bus that is used to specify a physical address. A CPU will specify the memory location.<ref>https://compsci2014.wikispaces.com/2.1.4+Explain+the+machine+instruction+cycle</ref>
'''Address Bus:''' The address bus is a data bus that is used to specify a physical address. A CPU will specify the memory location.<ref>https://compsci2014.wikispaces.com/2.1.4+Explain+the+machine+instruction+cycle</ref>


== Excellent simulation of the machine instruction cycle ==  
== Excellent simulations of the machine instruction cycle ==  


[https://tools.withcode.uk/cpu/ Click here for a great simulation! ]
# [https://tools.withcode.uk/cpu/ Click here for a great simulation! ]
# [http://www.peterhigginson.co.uk/LMC/ This is also very good simulation (little man simulation)]


== References ==
== References ==

Revision as of 07:55, 13 March 2019

This is a basic concept in computer science

Fetch-execute-cycle.png


Instructions are processed under the direction of the control unit in a step-by-step manner.

There are four fundamental steps in the instruction cycle:

1. Fetch the instruction The next instruction is fetched from the memory address that is currently stored in the Program Counter (PC), and stored in the Instruction register (IR). At the end of the fetch operation, the PC points to the next instruction that will be read at the next cycle.

2. Decode the instruction The decoder interprets the instruction. During this cycle the instruction inside the IR (instruction register) gets decoded.

3. Execute The Control Unit of CPU passes the decoded information as a sequence of control signals to the relevant function units of the CPU to perform the actions required by the instruction such as reading values from registers, passing them to the ALU to perform mathematical or logic functions on them, and writing the result back to a register. If the ALU is involved, it sends a condition signal back to the CU.

4. Store result The result generated by the operation is stored in the main memory, or sent to an output device. Based on the condition of any feedback from the ALU, Program Counter may be updated to a different address from which the next instruction will be fetched.


Data Bus: A data bus is a connection between the different parts of a computer that information is sent on.

Address Bus: The address bus is a data bus that is used to specify a physical address. A CPU will specify the memory location.[1]

Excellent simulations of the machine instruction cycle

  1. Click here for a great simulation!
  2. This is also very good simulation (little man simulation)

References