Computer Science 9608 (Notes) Chapter: 1.4 Processor fundamentals

Topic: 1.4.2 The fetch-execute cycle The process by which a computer: 1. Fetches a program instruction from its memory, 2. determines what instruction wants to do, 3. And execute those actions. This cycle is repeated continuously by the central processing unit (CPU), from boot up to shut down. In modern computers this means completing the cycle billions of times in a second! Without it, nothing would be able to be calculated. Registers involved The circuits used in the CPU during the cycle are: Program Counter (PC) - an incrementing counter that keeps track of the memory address of which instruction is to be executed next... Memory Address Register (MAR) - the address in main memory that is currently being read or written Memory Data Register (MDR) - a two-way register that holds data fetched from memory (and data ready for the CPU to process) or data waiting to be stored in memory Current Instruction register (CIR) - a temporary buffer for the instruction that has just been fetched from memory Control Unit (CU) - decodes the program instruction in the CIR, selecting machine resources such as a data source register and a particular arithmetic operation, and coordinates activation of those resources Arithmetic logic unit (ALU) - performs mathematical and logical operations

Page 1 of 4

Computer Science 9608 (Notes) Chapter: 1.4 Processor fundamentals

Topic: 1.4.2 The fetch-execute cycle Register transfer notation To describe the cycle we can use register notation. This is a very simple way of noting all the steps involved. In all cases where you see brackets e.g. [PC], this means that the contents of the thing inside the brackets are loaded. In the case of the first line, the contents of the program counter are loaded into the Memory Address Register.

(Increment the PC for next cycle at the same time) MBR is also called MDR Decoded then executed Detailed description of Fetch-Decode-Execute Cycle To better understand what is going on at each stage we'll now look at a detailed description:

1. The contents of the Program Counter, the address of the next instruction to be executed, is placed into the Memory Address Register

Page 2 of 4

Computer Science 9608 (Notes) Chapter: 1.4 Processor fundamentals

Topic: 1.4.2 The fetch-execute cycle 2. The address is sent from the MAR along the address bus to the Main Memory. The instruction at that address is found and returned along the data bus to the Memory Buffer Register also called Memory Data Register (MDR). At the same time the contents of the Program Counter is increased by 1, to reference the next instruction to be executed.

. 3. The MBR (MDR) loads the Current Instruction Register with the instruction to be executed.

4. The instruction is decoded and executed using the ALU if necessary.

The Cycle starts again!

Page 3 of 4

Computer Science 9608 (Notes) Chapter: 1.4 Processor fundamentals

Topic: 1.4.2 The fetch-execute cycle An interrupt is a signal to the processor emitted by hardware or software indicating an event that needs immediate attention. An interrupt alerts the processor to a high-priority condition requiring the interruption of the current code the processor is executing. How Interrupts work: 1. Instruction Fetched 2. Current Inst. is executed 3. Interrupt presence is checked in queue 4. If there is an interrupt then check priority with current program 5. If Interrupt's priority is high then save current program's data in registers to STACK in RAM and load new program (Interrupt handler) by writing new program's 1st instruction address in PC. a. Serve the Interrupt b. Load the data back from STACK in RAM c. Resume previous program. 6. Any more instruction of the current program? a. If yes then go to step 1. b. else end. What happens in the CPU when an Interrupt is generated during a fetch execute cycle: We have said that 'An interrupt is a signal for the CPU to stop what it is doing and instead carry out the interrupt task, once the task is complete, the CPU goes back to what it was doing'. But what is meant by 'back to what it was doing'? To appreciate this, you need to understand a little about what goes on inside a CPU. A CPU contains a number of 'registers'. A register is a small section of on-chip memory having a specific purpose. Registers range from 8 bits wide on an 8 bit CPU to 64 bits and beyond. Registers in the CPU hold all of the data currently being handled. These include The current instruction being executed (Instruction Register), The location in primary memory of the next instruction (Program Counter) A number of general purpose registers holding current data The registers are updated by each tick of the system clock so at any instant in time, they hold specific values. When an interrupt comes along, all the register values are copied to a special data structure or memory area called the 'stack' which is in primary memory. And they stay in the stack whilst the CPU starts executing the interrupt service routine (ISR). Once the routine is over, the registers are loaded back with their original values from the stack and can continue with what they were doing before the interrupt came along. This jumping of instructions from current CPU operations to the ISR and then back again is called 'context switching'

Page 4 of 4

1.4.2 The fetch-execute cycle.pdf

Memory Address Register (MAR) - the address in main memory that is currently being read or. written. Memory Data Register (MDR) - a two-way register that ...

407KB Sizes 8 Downloads 236 Views

Recommend Documents

142.pdf
The town has some of the very oldest and biggest ... capital refers to the connections between individuals – social networks, of reciprocity ... Displaying 142.pdf.

142.pdf
Page 1 of 27. 1. Women Business Ventures in Swedish University. Incubators: Gender and the commercialization of university. research*. Diamanto Politis ...

Rahman 142.pdf
Page 2 of 4. Page 3 of 4. Rahman 142.pdf. Rahman 142.pdf. Open. Extract. Open with. Sign In. Main menu. Displaying Rahman 142.pdf. Page 1 of 4.

142-150.pdf
Men's Hammer Throw 82.77 BLR - Tichon Ivan Daegu (KOR) 30 August, 2003. Men's Javelin Throw 87.42 GBR - Backley Steven Sheffield (GBR) 28 July, 1991.

man-142\pattern-making-software.pdf
Whoops! There was a problem loading this page. man-142\pattern-making-software.pdf. man-142\pattern-making-software.pdf. Open. Extract. Open with. Sign In.

142. Jalo tangiangnami Tuhan.pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. 142. Jalo ...

man-142\3g-iphone-applications.pdf
Download. Connect more apps... Try one of the apps below to open or edit this item. man-142\3g-iphone-applications.pdf. man-142\3g-iphone-applications.pdf.

man-142\skull-kid-the-computer-game.pdf
... Donald Trump's plans for...*. Asked before SOTU address. Favor Oppose. Immigration 61% 39%. Jobs and the. economy 77% 23%. Handling North. Korea 61% 39%. Infrastructure, roads,. and bridges 80% 20%. 3. Whoops! There was a problem loading this pag

ufc 142: aldo vs. mendes.pdf
Barcelona vmilan live ufc 142 aldo vs mendes live pay per view. Josealdo vschad mendes ii. odds. Josealdo vschad mendes fullfighteasports ufc 2014.

man-142\mcpl-library-hours.pdf
Sign in. Loading… Whoops! There was a problem loading more pages. Retrying... Whoops! There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. man-142\mcpl-library

man-142\halfords-12f-instructions.pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item.

man-142\tyco-amp-netconnect.pdf
Connect more apps... Try one of the apps below to open or edit this item. man-142\tyco-amp-netconnect.pdf. man-142\tyco-amp-netconnect.pdf. Open. Extract.

man-142\skillsoft-books24x7.pdf
Download. Connect more apps... Try one of the apps below to open or edit this item. man-142\skillsoft-books24x7.pdf. man-142\skillsoft-books24x7.pdf. Open.

man-142\anum-kisah-lucah.pdf
Page 2 of 5. ANUM KISAH LUCAH PDF. Anum Kisah Lucah. In undergoing this life, lots of people constantly aim to do and also get the. most effective. New understanding, experience, lesson, and also every little thing that could. improve the life will b

man-142\malayali-mula-photos.pdf
Page 1 of 1. Page 1 of 1. man-142\malayali-mula-photos.pdf. man-142\malayali-mula-photos.pdf. Open. Extract. Open with. Sign In. Main menu. Displaying ...

man-142\skillsoft-iphone.pdf
Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. man-142\skillsoft-iphone.pdf. man-142\skillsoft-iphone.pdf. Open.

man-142\business-model-foundry.pdf
Connect more apps... Try one of the apps below to open or edit this item. man-142\business-model-foundry.pdf. man-142\business-model-foundry.pdf. Open.

142. Jalo tangiangnami Tuhan.pdf
Jalo tangiangnami Tuhan; total 1 halaman www.ultopultop.wordpress.com email: [email protected]. Page 1 of 1. 142. Jalo tangiangnami Tuhan.pdf.

man-142\amp-cat6-jacks.pdf
Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. man-142\amp-cat6-jacks.pdf. man-142\amp-cat6-jacks.pdf. Open.

man-142\white-noise-machine.pdf
Connect more apps... Try one of the apps below to open or edit this item. man-142\white-noise-machine.pdf. man-142\white-noise-machine.pdf. Open. Extract.

DEPARTMENT ORDER NO. 142 .pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. DEPARTMENT ORDER NO. 142 .pdf. DEPARTMENT ORDER NO. 142 .pdf. Open. Extract. Open with. Sign In. Main menu.

ocsb-ont-ppm-142-expulsions.pdf
Page 2 of 15. Ministry of Education Policy/Program. Memorandum. Page 2 No. 142. With respect to programs for expelled students, research3. has demonstrated that positive outcomes for. students are related to specific program elements that are tailore

man-142\general-electric-universal-remote.pdf
man-142\general-electric-universal-remote.pdf. man-142\general-electric-universal-remote.pdf. Open. Extract. Open with. Sign In. Main menu.