Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In this exercise, we examine in detail how an instruction is executed in a singl

ID: 3695976 • Letter: I

Question

In this exercise, we examine in detail how an instruction is executed in a single-­?cycle
datapath. Problems in this exercise refer to a clock cycle in which the processor fetches the
following instruction word from address 128:

(i) 0001 0100 0110 0010 0000 0000 0001 0100
(ii) 0000 0000 1000 0010 0000 1000 0010 1010


For each instruction, answer the following questions.


(a) What is this instruction in assembly language notation? To figure this out, see
pages A51-­?A80 of your textbook. What are the outputs of the sign-­?extend and the
jump “Shift left 2” unit (near the top of the figure) for this instruction word?
(b) What are the values of the ALU control unit’s inputs for this instruction? You will need the
table at the bottom of page 301 of your textbook.
(c) What is the new PC address after this instruction is executed?

Instruction [25-0] Jump address [31-0] Shift left 2 26 0 Add Add ALU result 0 Shift left 2 RegDst Jump Branch MemRead MemtoReg Instruction [31-26 Control ALUO MemWrite ALUSrc RegWrite Instruction [25-21] Read address register 1 I register 2 Write PC Read Read data 1 Read [15-11register data 2 data Registers Instruction [20-16] Zero ALU ALU result Instruction [31-0] Address Read data M Write 0 Instruction | | | Instruction [15-11 ] | memory> Write Data data memory Instruction [15-0] 6 Sign 32 ALU control extend Instruction [5-0]

Explanation / Answer

Ans;

a)   The instruction performs the load operation. The first 6 bits 100011 (35) represents a load instruction.

·         Then new PC address after the instruction is executed is PC + 4

·         The path followed by the instruction is PC --> Add (PC + 4) --> branch Mux --> jump Mux --> PC

(b)   The instruction performs the branch operation. The first 6 bits 000100 (4) represents a branch instruction. Then new PC address varies depending on the values of the rs and rt fields. That means,

·         If $1 and $3 are equal,the new PC value is PC + 4 + 4 x 12

·         If is $1 and $3 are not equal, the new PC value will be PC + 4

·         The path followed by the instruction is PC --> Add (PC + 4) --> branch Mux, or

·         PC --> Add (PC + 4) --> Add (adds offset) --> branch Mux --> jump Mux --> PC

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote