Preview

02 - Fetch Execute Decode Cycle

 1. Ever wondered how your brain is involved in executing an instruction? For instance, if someone says "Pass the salt"....what happens?
Voxel-man-brain.jpg

  The instruction is executed and then it is decoded and fetched

  The instruction is decoded, and then it is fetched

  The instruction is executed immediately

  The instruction is first fetched (received), decoded (made sense of) and then executed.

 2. The fetch-decode-execute cycle is the sequence of steps that the CPU follows to process instructions. This is also sometimes called the ...

  brain cycle

  computer cycle

  michelin star cycle

  instruction cycle

 3. Here is a diagram (Source: BBC Bitesize) of the Fetch Decode Execute cycle. Out of the following options, what happens first?
fde.png

  The processor checks the program counter to see which instruction to run next

  The program counter gives an address value in the memory of where the next instruction is

  The instruction is immediately decoded and executed

  The processor fetches the instruction value from this memory location

 4. The next steps that occur in the Fetch Decode Execute cycle are shown in the excerpt below. Can you fill in the blanks?
The program counter gives an address value in the memory of where 
the next instruction is.

The processor fetches the instruction value from this memory 
location.

Once the instruction has been fetched, it needs to be decoded and 
executed. For example, this could involve taking one value, putting 
it into the ALU, then taking a different value from a register and 
adding the two together.

Once this is complete, the processor _________________________________
_____________________________________________________________________

This cycle is repeated until the program ends.

  goes back to the CU (Control Unit) to find the next instruction

  goes back to execute an instruction

  goes to the ALU to check to see if there are any more calculations to perform

  goes back to the program counter to find the next instruction

 5. The three stages of the FDE cycle are 'Fetch', 'Decode' and 'Execute'. What happens in the fetch stage?
#1. In the fetch stage, the ALU provides a pointer to the program
counter. The program counter then executes the instruction directly
by sending instructions via the data and address bus. 


#2. In the fetch stage, the program counter provides the memory
address of the next instruction. This is transferred through the 
address bus to the memory and the instruction is transferred to the
instruction register of the CPU through the data bus.

  #1 is correct

  Both #1 and #2 could be correct

  Neither are correct

  #2 is correct

 6. What happens in the decode stage of the FDE cycle?

  The decoder held in the program counter dissolves the instruction in order to understand its true meaning

  The decoder in the ALU executes the instruction

  The decoder in the control unit works out what the instruction means (decodes the instruction)

  The decoder sends the instruction to the program counter to be counted

 7. What happens in the 'execute' part of the FDE cycle?

  The control unit instructs the ALU to perform the computations required and the result is stored in one of the registers

  The control unit decides whether or not to execute the instruction by counting the number of bits the data has

  The registers register and execute the instruction and then send it to the program counter to be executed

  The ALU executes the instruction and sends it to the printer

 8. Why is the fetch decode execute cycle called a cycle?
fde2.png

  Because it looks a little like a bicycle and hence its name

  Because a cycle refers to something that cannot repeat itself

  Because the cycle is repeated over and over as each instruction in the program is executed and complete

  Because it cycles around at millions of bits per second and this is the whir you hear when you switch on your PC

 9. Describe the role of the 'program counter' in the fetch decode execute cycle.

  This is a register that executes each instruction as it deals with programming

  This is a register that programs the CPU

  This is a register in the CPU which contains the memory address of the next instruction to be processed

  This is a register that decodes the instructions as they come in

 10. The program counter stores the memory address of the next instruction to be fetched. What happens when that address has been used?

  The program counter switches off automatically until it is manually switched on

  The program counter transforms into the ALU

  The progam counter explodes and no longer functions correctly

  The program counter is incremented by 1 so it now has the address of the next instruction

 11. When a program is being executed, the CPU implements the fetch – decode – execute cycle, which recurs over and over again until arriving at the STOP instruction. Read the excerpt below - what happens in step 4?
1-------------------	
The PC contains the address of the memory location that has the next instruction which has 
    to be fetched	

2--------------------
This address is then copied from the PC to the MAR via the address bus

3--------------------	
The contents (instruction) at the memory location (address) contained in MAR are then 
    copied into the MDR

4--------------------	
____________________________________________________________________________?	
    

5--------------------	
The value in the PC is then incremented by 1 so that it now points to the next instruction 
     which has to be fetched. 

6--------------------	
The instruction is finally decoded and then executed by sending out signals (via control bus) to the various components of the computer	The instruction is decoded and then executed

7--------------------	
Repeat

  The contents (instruction) in the MAR is then copied and placed into the ALU

  The contents (instruction) in the CIR is then copied and placed into the MDR

  The contents (instruction) in the MDR is then copied and placed into the CIR

  The contents (instruction) in the CPU is then copied and placed into the Program Counter

 12. The program counter .....

  contains the program itself

  contains the data that needs to be next executed

  contains the bits and bytes to be programmed

  contains the address of the next instruction

 13. Why does point #5 have to be done?
1-------------------	
The PC contains the address of the memory location that has the next instruction which has 
    to be fetched	

2--------------------
This address is then copied from the PC to the MAR via the address bus

3--------------------	
The contents (instruction) at the memory location (address) contained in MAR are then 
    copied into the MDR

4--------------------	
____________________________________________________________________________?	
    

5--------------------	
The value in the PC is then incremented by 1

6--------------------	
The instruction is finally decoded and then executed by sending out signals (via control bus)
to the various components of the computer	The instruction is decoded and then executed

7--------------------	
Repeat

  so that it points to the first instruction again

  so that +1 is added to tell the ALU what to do

  so that it points to the next instruction which has to be fetched.

  so that it keeps up with the CPU clock

 14. Read the excerpt and fill in the blanks. (The same word fills in the blank throughout this simple description of the FDE cycle)
If the first instruction to be carried out in a program in RAM was in memory 
location 2435 (see the diagram above), the operating system puts 2435 into the ______________.


When the CPU is ready to run the program, it looks in the_________________ sees 2435 
and fetches whatever is at that location. 

Automatically, once 2435 has been fetched, the _____________________increases by one, 
to 2436. 

When the CPU has finished fetching, decoding 
and executing the instruction, it simply goes back to the __________________, looks at the 
address in there and repeats the above process, increasing the ________________ by one 
every time an instruction has been fetched. This is a very simple but effective way for 
the CPU to know what to do next. 

Note that the CPU can do all of this really quickly - literally billions of times a second!

  accumulator

  ALU

  program counter

  RAM

 15. Analyse the diagram of the Fetch Decode execute cycle below. You may want to draw it out yourself. The decoding in this cycle is done by:
800px-Comp_fetch_execute_cycle.png

  The CPU's Accumulator

  The CPU's ALU

  The CPU's Control Unit (CU)

  The CPU's RAM

 16. It is worth noting that not all instructions are executed within the accumulator, there are other registers that can be used

  True

  False

 17. The 'decode' in the FDE cycle is referring to security and encryption of all data.

  FALSE

  TRUE

 18. If the instruction was to ADD two bits of data (9 and 5) to each other, the decode step will:

  decodes the data itself (i.e break it up into a sequence of binary numbers and store it in the ALU)

  All of the above

  ensure the processor is operating in encrypted mode (i.e secure mode)

  translates the instruction so the processor understands what to do (i.e add first number to the second)

 19. The Main function of the Control Unit is to fetch program instructions ?..

  from the Cache and execute them in parallel

  from the Hard drive and decode them sequentially

  from memory, to decode them and execute them serially

  None of the above

 20. The clock plays an important role: it sends a signal to all computer components and synchronises all operations

  FALSE

  TRUE