• edited by
10,264 views
44 44 votes

Consider a computer with a $4$-ways set-associative mapped cache of the following character­istics: a total of $1\;\text{MB}$ of main memory, a word size of $1\;\text{byte}$, a block size of $128$ words and a cache size of $8\;\text{KB}$.

While accessing the memory location $\text{0C795H}$ by the CPU, the contents of the TAG field of the corresponding cache line is:

  1. $000011000$
  2. $110001111$
  3. $00011000$
  4. $110010101$

4 Answers

Best answer
32 32 votes

As shown in https://gateoverflow.in/3403/gate2008-it_80

We have $16$ sets in cache and correspondingly $16$ regions in physical memory to which each set is mapped.
Now, $\text{WORD}$ bit size is $7$ as we need $7$ bits to address $128$ possible words in a cache block.
So, the lowest $7$ bits of $\text{0C795H}$ will be used for this giving us the remaining bits as $\text{0000 1100 0111 1}$

Of these bits, the lower $4$ are used for addressing the $16$ possible sets, giving us the tag bits$: 0000\, 1100\, 0$ in (A) choice.

• edited by
2 2 votes
20 bit physical address will be divided into

9-tag, 4-set 7-word

so answer will be A
2 2 votes

TAG will take= 9 bits


SET will need 4 bits and


WORD will need 7 bits of the cache memory location


(using the above conclusion as derived in previous question)
The memory location 0C795H can be written as 0000 1100 0111 1001 0101


Thus TAG= 9 bits = 0000 1100 0


SET =4 bits =111 1


WORD = 7 bits =001 0101


Therefore, the matching option is option A.

Answer:
Position:
Show:

Related questions

30 30 votes
2 answers 2 answers
10.2k
10.2k views
Ishrat Jahan asked Oct 29, 2014
10,232 views
Consider a computer with a $4$-ways set-associative mapped cache of the following character­istics: a total of $1 \ MB$ of main memory, a word size of $1$ byte, a block s...
63 63 votes
6 answers 6 answers
23.4k
23.4k views
Ishrat Jahan asked Oct 28, 2014
23,380 views
A non pipelined single cycle processor operating at $100\;\text{MHz}$ is converted into a synchro­nous pipelined processor with five stages requiring $2.5\;\text{nsec}, 1...
69 69 votes
9 answers 9 answers
29.6k
29.6k views
Ishrat Jahan asked Oct 28, 2014
29,640 views
Consider a CPU where all the instructions require $7$ clock cycles to complete execution. There are $140$ instructions in the instruction set. It is found that $125$ cont...
56 56 votes
10 answers 10 answers
16.4k
16.4k views
Ishrat Jahan asked Oct 28, 2014
16,411 views
Assume that EA = (X)+ is the effective address equal to the contents of location X, with X incremented by one word length after the effective address is calculated; EA = ...