





Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!






Question 1: (10pt) Give the -10 in 5-bit 2’s complement
Answer: 10110
Multiplicant
Initial Product
Product after 1st^ shift
Product after 2nd shift
Product after 3rd shift
Product after 4th shift
Product after 5th shift
Question 2: (30pt) Execute the following multiplication by shift and add
0 1 0 0 1
0 0 0 0 0 0 1 0 1 1
0 0 1 0 0 1 0 1 0 1
0 0 1 1 0 1 1 0 1 0
0
0 0 1 1 0 0 0 1 1 0
0
0 1 0 0 1
0 1 1 0 1
0 0 1 1 0 1 1 0 1 0 1 1 0 0
0 0 1 1 0 0 0 1 1
Question 4 : (50pt total) Consider a byte-addressable architecture that supports 36 bit addresses A 0 to A 35. Its cache is 32 way associative and has 64 sets. A block contains 256 bytes. Answer the following questions.
4.A (10pt) Give the address bits that give the block number.
A35 to A
4.B (10pt) Calculate the total capacity of the cache in bytes
32 × 64 × 256
64 sets, each set containing 32 block, each block 256 bytes
4.C (15pt) Give the address bits stored in a cache TAG.
A35 to A
First 6 bits in a block # (A13 to A8) used to determine the set #
Remaining bits stored in TAG
4.D (15pt) Give the address bits used to determine the set to store a block.
A13 to A
Addr count
Question 5 : (40pt) Consider a 4-way set associate cache with two sets. The size of a block is 4, and the replacement policy is LRU. Starting from the cache empty, give the contents of the cache after the following sequence of memory references
6.B (30pt) Identify the cycle where you calculate rs-1. Give the control signals for that cycle. (Cycle 5 in my answer)
1 1 1 0 1 1 0 0 0 0 1 0
Write Enables
Multiplexer Controls
0
Use
t
0
Question 7. (30pt) Give the Boolean expression of control UseR0 in the YH16 architecture.
UseR0 = S 2 ′S 1 ′S 0 (I 15 I 14 I 13 ′I 12 ′I 11 ′I 10 ′I 9 ′ + I 15 I 14 I 13 ′I 12 ′I 11 ′I 10 ′I 9 ) (state 1 of BF and BT)
0 1 X X X X X 0 1 X X
Question 8 : (40pt) Assuming the standard MIPS ISA, identify instances of internal forwarding, including ALU and memory forwarding. In the boxes below, fill in a register number in box[ i , j ] if instruction i forward the value of the given register to instruction j. If there is no forwarding, leave the box blank
1 sub r12,r4,r 2 lw r5,0(r12) 3 add r10,r12,r 4 xor r6, r10,r 5 slt r20, r5, r
Question 9 : (30pt) Describe the concept of delayed branches and explain how it helps improve program performance.
The concept of delay branches shift some complexities in handling control hazards to software. With it, the instruction after a conditional branch (the delay slot) is always executed regardless the condition of the branch. It is up to the programmer/complier to find a useful instruction to place in the delay slot, avoiding the pipeline stalling after the branch and hence improving performance.
12 12
5 5
10