Docsity

10 Problems on Computer Systems Architecture - Final Exam | CS 365, Exams of Computer Architecture and Organization

Partial preview of the text

Download 10 Problems on Computer Systems Architecture - Final Exam | CS 365 and more Exams Computer Architecture and Organization in PDF only on Docsity!

CS365 Final Examination

Section 002, Fall 2005

Print Your Name:

GMU ID:

STOP! Do NOT turn to the next page until

further instructions.

 Print your initials on the upper right corner of every

page.

 You have 120 minutes to earn up to 360 points

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

Set

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

ALU

Write Enables

A B

P

C

R

F

I

R

M

D

R

C

R

W

Multiplexer Controls

1 2 RF

P

C

MA M

D

0

Use

Z R

R

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