Professional Documents
Culture Documents
Bahria University, (Karachi Campus) : Department of Software Engineering
Bahria University, (Karachi Campus) : Department of Software Engineering
Bahria University, (Karachi Campus) : Department of Software Engineering
COURSE TITLE: Computer Architecture & Logic Design COURSE CODE: CEN-220
Class: BSE[3]-A/B Shift: Morning
Course Instructor: DR. SYED SAMAR YAZDANI Time Allowed:
Submission Date: 13-01-2022 Max. Marks: 10 Marks
C) We want to write at address 0x1B the value ‘0xB1’. Determine the following:
i) The Set containing the block that was read is number 0 . ii) The tag bit in this block is ___0b 011___.
Notice that the value of the byte at address 0x1B is different in the cache and memory. What indicates this
disparity in the cache? The dirty bit
What would have happened if our write miss policy were “No Write-Allocate” instead? We would write
directly to memory and not cache the block starting at 0x18D) We want to make a read at address 0x01.
Determine the following:
i) The Set containing the block that was read is number _____0______.
ii) The Tag bit in this block is ____0b 000________.
iii) Will this read cause a conflict in the cache? Yes □ No□ iv)
If yes, which block will be evicted? Read made in B Write made in C
E) We want to write at address 0x1C the value ‘0xE9’. Determine the following:
i) The Set containing the block that was read is number _1 _ ii) The tag bit in the block is __0b 011__.
iii) Will this write cause a conflict in the cache? Yes □ No□
iv) If yes, which block will be evicted? Read made in B Write made in C
As a note, your history should look like this:
R(0 × 2a) = M
W(0 × 1b,0 × b1) = M
R(0 × 01) = M
W(0 × 1c,0 × e9) = M
W(0 × 03,0 × ff
) = H.
R(0 × 27) = M .
R(0 × 10) = M
H) The cache, after the 8 executions detailed above should look like this:
The numbers on the right indicate the mode recent use of the cache (where 1 was more
recent).
i) A LRU replacement policy will evict which block on the next cache conflict? LINE 1
ii) What is one benefit of using LRU over Random?
Can you explain why these numbers are the same/different? (If not, try changing the write hit policy and re-
running using the same history above).
Write Back won’t write the new value to memory directly but will instead cache it and mark its block as
dirty. When any dirty block is removed from the cache the memory corresponding to that block will be
updated. Write Through will write any new value to memory directly, thus meaning that no block in the
cache will be dirty and no values in memory need to be updated when flushing the cache.