Brief Solution to Assignment - Computer Architecture Principles | CDA 5155, Assignments of Electrical and Electronics Engineering

Material Type: Assignment; Professor: Mishra; Class: COMPU ARCHITECT PRIN; Subject: COMPUTER DESIGN/ARCHITECTURE; University: University of Florida; Term: Fall 2008;

Typology: Assignments

Pre 2010

Uploaded on 03/11/2009

koofers-user-2ta
koofers-user-2ta 🇺🇸

9 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Homework 4
CDA 5155: Fall 2008
Due Date: 12/04/2008 11:59 PM (UF EDGE Students: 12/11/2008 11:59 PM)
Primary TA: Weixun Wang
Brief Solution
You are not allowed to take or give help in completing this assignment. Submit the PDF version of
the submission in e-Learning website before the deadline. Please include the sentence in bold on
top of your submission: I have neither given nor received any unauthorized aid on this
assignment”.
Problem 1
1. [5] 2 + 1 + 2 * (N – 1) = 2N + 1
The first access of X by each processor results in a cache miss, i.e. the first two instructions in
iteration 1. In the third instruction, P2 generates an invalidation because of which P1 suffers a
miss in the fourth instruction. In the next (N – 1) iterations, P1 generates an invalidation because
of which P2 suffers a miss and then P2 generates an invalidation because of which P1 suffers a
miss.
2. [5] 2
The first access of X by each processor results in a cache miss. In all subsequent iterations, no
more cache miss will occur due to broadcasting. Therefore, number of misses is 2.
Problem 2
1. [5]
Lock: LOAD R2, 0(R1)
BNEZ R2, Lock
ADDUI R2, R0, #1
EXCH R2, 0(R1)
BNEZ R2, Lock
Spin on regular lock (LD) is a read operation on the block. It does not need invalidate other copies
of the block in other processor’s caches.
2. [5]
Lock: LL R2, 0(R1)
BNEZ R2, Lock
ADDUI R2, R0, #1
SC R2, 0(R1)
BNEZ R2, Lock
pf3

Partial preview of the text

Download Brief Solution to Assignment - Computer Architecture Principles | CDA 5155 and more Assignments Electrical and Electronics Engineering in PDF only on Docsity!

Homework 4

CDA 5155: Fall 2008

Due Date: 12/04/2008 11:59 PM (UF EDGE Students: 12/11/2008 11:59 PM)

Primary TA: Weixun Wang

Brief Solution

You are not allowed to take or give help in completing this assignment. Submit the PDF version of the submission in e-Learning website before the deadline. Please include the sentence in bold on top of your submission: “ I have neither given nor received any unauthorized aid on this assignment ”.

Problem 1

  1. [5] 2 + 1 + 2 * (N – 1) = 2N + 1 The first access of X by each processor results in a cache miss, i.e. the first two instructions in iteration 1. In the third instruction, P2 generates an invalidation because of which P1 suffers a miss in the fourth instruction. In the next (N – 1) iterations, P1 generates an invalidation because of which P2 suffers a miss and then P2 generates an invalidation because of which P1 suffers a miss.
  2. [5] 2 The first access of X by each processor results in a cache miss. In all subsequent iterations, no more cache miss will occur due to broadcasting. Therefore, number of misses is 2.

Problem 2

  1. [5] Lock: LOAD R2, 0(R1) BNEZ R2, Lock ADDUI R2, R0, # EXCH R2, 0(R1) BNEZ R2, Lock

Spin on regular lock (LD) is a read operation on the block. It does not need invalidate other copies of the block in other processor’s caches.

  1. [5] Lock: LL R2, 0(R1) BNEZ R2, Lock ADDUI R2, R0, # SC R2, 0(R1) BNEZ R2, Lock

3. [5]

(a) spinlock using EXCH Transaction P0 P1 P2 P

(1) Write-invalidate M[0(R1)]; M[0(R1)] in EX-state

Invalidate M[0(R1)] Invalidate M[0(R1)] Invalidate M[0(R1)]

(2) M[0(R1)]=0 in SH LD M[0(R1)] M[0(R1)]=0 in SH

LD M[0(R1)]

M[0(R1)]=0 in SH

LD M[0(R1)]

M[0(R1)]=0 in SH

(3) Inv. M[0(R1)] EXCH R2, 0(R1) M[0(R1)]=1 in EX

Inv. M[0(R1)] Inv. M[0(R1)]

(4) Inv. M[0(R1)] EXCH R2, 0(R1) M[0(R1)]=1 in EX

(5) Inv. M[0(R1)] EXCH R2, 0(R1) M[0(R1)]=1 in EX

(6) LD M[0(R1)] M[0(R1)]=1 in SH

LD M[0(R1)]

M[0(R1)]=1 in SH

(7)