2.1.4+Machine+Instruction+Cycle

=__**2.1.4 Explain the machine instruction cycle**__=

**__ Machine Instruction Cycle[[image:machine-cycle.jpg width="313" height="143" align="right"]] __**

 * 4 process cycle
 * 1) reads and 2) interprets machine language
 * 3) executes and 4) stores the code
 * performed by CPU

**__The 4 Stepson the machine instruction cycle__**

 * 1) **Fetch**
 * instructions pulled from memory
 * instructions stored in main memory
 * CPU requests instructions from secondary memory
 * instructions stored in main memory
 * the **Program counter** (also instruction pointer) stores the **address**, which is the location of storage
 * Via data bus the content of address contained in the program counter is fetched from the main memory & stored in the CIR (Current Instruction Register)
 * **instruction register**: part of CPU that holds instructions executed
 * Program counter = incremented by 1
 * 1) **Decode **
 * The instruction decoder interprets the instruction
 * All required data = fetched from main memory & put in data registers
 * 1) **Execute **
 * CPU performs the actions required
 * 1) **Store **
 * Results of calculations in CPU = stored in main memory or sent to output devices
 * Program Counter could be updated to a new address

__**REPEAT **__
__1. Fetch cycle__ __ 2. Execute cycle __
 * **Steps 1 & 2 are called the __Fetch Cycle__**
 * same for each instruction
 * processes the instruction from the **instruction word** (fixed number of digits), which contains an **opcode** and **operand**
 * **instruction word:** fixed number of digits for a data value (binary)
 * **opcode:** operation code - part of instruction naming the operation to be executed
 * **operand:** part of instruction specifying which data values to manipulate
 * ** Steps 3 & 4 are called the __Execute__ ** __**Cycle**__
 * steps change with each instruction
 * 1st step
 * Process-Memory
 * data is transferred between the CPU and I/O module
 * 2nd step
 * Data-Processing
 * mathematical & logical operations used in reference to data
 * 3rd step
 * Central alterations
 * sequence of operations
 * e.g. jump operation
 * Last step
 * combined operation
 * combines all steps

//First video example of the Machine Instruction Cycle:// media type="youtube" key="KEUnJSzP9Rw?hl=en" height="344" width="425"

//Second video example of the Machine Instruction Cycle://

media type="youtube" key="9vvnHp96mRo?hl=en" height="344" width="425"

__**Additional links:**__ http://www.it.jcu.edu.au/Subjects/cp1300/resources/lectnotes/system/fde.html (A more detailed explanation) Machine Instruction Cycle (Interactive Flash animation from www.ib-computing.com)

Written by: Jocbe Edited by: Lucie Magister Last updated: 05. November 2014

Sources:
 * "Instruction Cycle." Wikipedia. 28 August 2010. Wikimedia.org. 2 September 2010. https://secure.wikimedia.org/wikipedia/en/wiki/Instruction_cycle
 * Jones, Richard. Computer Science Java Enabled. Victoria : IBID Press, 2004.
 * "Machine Cycle Definition." The Linux Information Project (LINFO). N.p., 15 May 2006. Web. 05 Nov. 2014. .
 * "Opcode." Wikipedia. Wikimedia Foundation, 14 Oct. 2014. Web. 05 Nov. 2014. .
 * "Operand." Wikipedia. Wikimedia Foundation, 11 May 2014. Web. 05 Nov. 2014. .
 * "What Is Machine Cycle?" Computer Hope. N.p., n.d. Web. 05 Nov. 2014. <http://www.computerhope.com/jargon/m/machcycl.htm>.
 * "Word (computer Architecture)." Wikipedia. Wikimedia Foundation, 31 Oct. 2014. Web. 05 Nov. 2014. <http://en.wikipedia.org/wiki/Word_(computer_architecture)>.