Machine Instruction Cycle

Machine Instruction Cycle with Registers and Buses

%e5%b1%8f%e5%b9%95%e5%bf%ab%e7%85%a7-2016-10-01-%e4%b8%8b%e5%8d%8810-37-48(Huang, Yang, & Xu)
  1. Fetch the next instruction: (Dale & John)
    1. The program counter contains the address of the next instruction to be executed. CU turn on enable wire of Instruction Address Register(Program Counter) to allow the next Instruction address to flows to RAM.
    2. Instruction address first goes to Memory Address Register which only tells RAM what address the CPU wants next. CU turns on the set wire of MAR, then memory address goes to RAM.
    3. CU turns on the enable RAM wire. Follow the address that specified in the PC, control unit(CU) makes a copy of the instruction in that address.
    4. Data goes to Memory Data Register from RAM by data bus. Then data (instruction) is stored in instruction register (IR).
    5. Before starting further executions, PC must be undated to the address of the next instruction.
  2. Decode the instruction: Control unit interpret the instruction and break it into pieces of commands for other components inside CPU.
  3. Get data if needed: To execute the instruction, it may required additional memory data from the RAM. If so, the computing system need to get additional data.
  4. Execute the instruction: 
    1. CU turns on the set wire of Accumulator and instructs ALU to store the result in Accumulator (A Register).
    2. CU turns on the enable wire of Accumulator to instruct Accumulator to output the result to the system bus. (John)
  5. Store: The result goes to the MAR and store the result in the specified address in RAM. (Dale & John)

Instruction Set

Each instruction in represented by a three-digit (decimal) instruction set.  In each instruction set, the first digit represents the instruction, and the second and third digits represent the address in RAM. (Chen & Cudmore)

屏幕快照 2016-10-02 下午5.55.12.png
(Chen & Cudmore)
Try to write a program on peterhigginson.co.uk/lmc/ to see how the machine instruction cycle works.

Works Cited

Chen, S. and W.C. Cudmore. “The Little Man Computer”. Yorku.ca. N.p., 2016. Web. 1 Oct. 2016.

Dale, Nell and John Lewis. Computer Science Illuminated. Print.

Huang, Ningjia, Yundi Yang, and Zhongyi Xu. Machine Instruction Cycle With Registers And Buses. 2016. Web.

John, Scott. How A CPU Works. 2013. Web. 1 Oct. 2016.

留下评论