- EX stage is the Instruction Execution stage
- Purpose:
- Perform the operation in the assembler instruction
- Operation:
- Use the type of instruction to select
between the PC1 and A input:
- If the instruction is a branch instruction, select PC1
as input 1 of the ALU.
- For all other types of instruction (ALU, load or store)
select register A as input 1 of the ALU.
- Use the operand type of instruction to select
between the B and IR1 input:
- If the instruction in IR(EX) specifies a
constant operand (e.g., "ADD R1, 5, R2",
the operand 5 is a constant),
then select IR1 as input 2 of the ALU.
- Otherwise, select B as input 2 of the ALU.
- If the instruction is an ALU instruction,
then the ALU opcode portion of the instruction
to select the operation of the ALU
Otherwise (instruction is load, store or branch),
select the ADD function
- Result of the ALU is stored in registers ALUo (ALU output)
and DMAR (Data Memory Address Register)
NOTE: Both DMAR and PC (in IF stage) is tied to the address bus.
So we must use tri-state-buffers with these registers
to prevent burn-out.
- Value of the B-register is copied into
SMDR (Store Memory Data Register)
to prepare for the store operation.
|