[SOLVED] VE370 Homework 3

24.99 $

Category: Tags: ,

Description

5/5 - (5 votes)

All questions refer to the following figure.

1. Given RISC-V assembly instruction sequence:

        bne x22, x23, Else
        add x19, x20, x21
        beq x0,x0,Exit

Else: lw x19, 0(x20)
Exit: …
Assuming the memory location of the first instruction (bne) is 0x1000F400, what are the values of the following control signals for each of the instructions?

32

Ctrl Signals

Instruction

add beq lw

  1.  Given following assembly instruction:
      and rd, rs1, rs2
    
    1. (1)  Which resources (blocks) perform a useful function for this instruction? (3 points)
    2. (2)  Which resources (blocks) produce no output for this instruction? Which resourcesproduce output that is not used? (7 points)
  2.  Consider the following instruction mix:

R-type I-type (non-lw) Load Store Branch Jump

24% 28% 25% 10% 11% 2%

  1. (1)  What fraction of all instructions use data memory? (3 points)
  2. (2)  What fraction of all instructions use instruction memory? (2 points)
  3. (3)  What fraction of all instructions use the sign extend? (5 points)
  1. (10 points) When silicon chips are fabricated, defects in materials (e.g., silicon) and manufacturing errors can result in defective circuits. A very common defect is for one signal wire to get “broken” and always read a logical 0. This is often called a “stuck-at-0” fault.
    (1) Which instructions fail to operate correctly if the MemToReg wire is stuck at 0? (5points)
    (2) Which instructions fail to operate correctly if the ALUSrc wire is stuck at 0? (5 points)
  2. (30 points) Problems in this exercise assume that the logic blocks used to implement a processor’s datapath have the following latencies:

I-Mem / Register Mux ALU Adder Single Register Register Sign D-Mem File gate Read Setup extend

Control

250 ps

150 ps

25 ps

200 ps

150 ps

5 ps

30 ps

20 ps

50 ps

50 ps

In above table, “Register Read” is the time needed after the rising clock edge for the new register value to appear on the output. This value applies to the PC only. “Register Setup” is the amount of time a register’s data input must be stable before the rising edge of the clock. This value applies to both the PC and Register File.

Branch MemRead MemtoReg

ALUOp

MemWrite ALUSrc RegWrite Zero

ImmGen Output

  1. (1)  What is the latency of an R-type instruction (i.e., how long must the clock period be to ensure that this instruction works correctly)? (5 points)
  2. (2)  What is the latency of lw? (5 points)
  3. (3)  What is the latency of sw? (5 points)
  4. (4)  What is the latency of beq? (5 points)
  5. (5)  What is the latency of an arithmetic, logical, or shift I-type (non-load) instruction? (5points)
  6. (6)  What is the minimum clock period for this CPU? (5 points)

6. (10 points) Modify the single-cycle processor datapath to add a proposed new assembly instruction:

       ss rs1, rs2, immediate  #Store Sum

Operation: Mem[Reg[rs1]]=Reg[rs2]+immediate