Instruction Execution - week 7 Flashcards

(19 cards)

1
Q

What are the three main phases of the machine cycle?

A

Fetch, Decode, and Execute.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What happens in the Fetch phase

A

The CPU brings the instruction from store to the instruction register.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What happens in the Decode phase?

A

The instruction is interpreted (decoded) to determine what operation is to be performed and how the operands are to be accessed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What happens in the Execute phase

A

Decoding the instruction, accessing the operands (if any) and carrying out the operation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which phase is the same for all instructions and why?

A

The Fetch phase is the same for all instructions because every instruction must first be retrieved from memory in exactly the same way.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Which phase varies from instruction to instruction?

A

The Execution phase varies, depending upon the operation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How is a program stored in memory?

A

A program is a sequence of instructions stored in store/memory/RAM.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the two parts of an instruction?

A

An Operation and an Operand.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does the Operand part specify?

A

It specifies what the operation acts on (e.g. a value, a register, or a memory address).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the control lines used for?

A

To carry control signals such as read and write between CPU and memory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Which two registers are inside the Control Unit in the final model for instruction access?

A

IR and PC.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How does the Control Unit access an instruction?

A

The Program Counter (PC) holds the address of the next instruction

The Control Unit sends that address to memory

Memory returns the instruction stored at that address

The instruction is read into the Instruction Register (IR)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the role of the store in this model?

A

The store holds instructions and data and is accessed via read/write data operations.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

List the four bullet points for “To carry out an instruction”.

A

it must first be fetched from store to the control unit.

then interpreted (or decoded) to determine what operation is to be performed and how the operands are to be accessed.

the operands must be fetched from store to the ALU

the operation upon them must be executed, using control signals supplied by the control unit.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the “instruction cycle”

A

Fetch phase: bringing the instruction from store to the instruction register.

Execution phase: decoding the instruction, accessing the operands (if any) and carrying out the operation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What does PC do at the start of a fetch phase

A

“At the start of a fetch phase, PC points to the next instruction to be executed.”

17
Q

What are the 4 stages of the fetch phase

A
  1. Contents of the PC are placed in the MA: (this sets the store location of the next instruction.)
  2. Contents of the cell at the address in MA are placed in the MB: (this gets the contents of the cell)
  3. Contents of the MB are placed in the IR: (the instruction is now ready for decoding.)
  4. Increment PC: (so that the next instruction in sequence will be accessed next.)
18
Q

Describe the stages of execution

A

The address part of the instruction is copied to the MA

The contents of the memory location at that address are copied into MB

The Control Unit performs the required operation

The result is stored in a register or memory location.

19
Q

What does ADD R0, (20) mean

A

Add the contents of location (address) 20 to register R0.