• retagged by
39,137 views
57 57 votes

A block-set associative cache memory consists of $128$ blocks divided into four block sets. The main memory consists of $16, 384$ blocks and each block contains $256$ eight bit words.

  1. How many bits are required for addressing the main memory?
  2. How many bits are needed to represent the TAG, SET and WORD fields?

3 Answers

Best answer
85 85 votes

For main memory, there are $2^{14}$ blocks and each block size is $2^8$ bytes (A byte is an eight-bit word)

  1. Size of main memory $=2^{14}\times 2^8=4MB$ ( $22-\text{bits}$ required for addressing the main memory).
  2. For WORD field, we require $8-\text{bits}$, as each block contains $2^8 $ words.

As there are $4$ blocks in $1$ set, $32$ sets will be needed for $128$ blocks. Thus SET field requires $5- \text{bits}$.

Then, TAG field requires $22-(5+8)= 9- \text{bits}$

$$\begin{array}{|c|c|c|} \hline \text {9-bits (for tag)} &  \text{5- bits (for set)}& \text{8-bits (for word)} \\\hline  \end{array}$$

• edited by
4 4 votes

1.

Main memory addressing is always at the byte level (or word level depending on architecture), not at block level.

  • Each byte (or smallest addressable unit = word in some systems) has a unique memory address.

 So, Size of main memory= $2^{14}$*$2^{8}$=$2^{22}$ . Hence, required 22 bits for addressing main memory.

2.

128 Cache blocks and 4 Block sets . Hence 32 sets . So 5 bits for rep set.

Block contains 256 B (given in que that each block contains 256 eight bit words.) . So 8 bits for rep Block offset. i.e, Word field

Remaining= 22-(5+8) = 9 . So 9 bits for Tag.

Answer:
Position:
Show:

Related questions

32 32 votes
2 answers 2 answers
10.7k
10.7k views
Misbah Ghaya asked Nov 19, 2016
10,746 views
The number of rooted binary trees with $n$ nodes is,Equal to the number of ways of multiplying $(n+1)$ matrices.Equal to the number of ways of arranging $n$ out of $2 n$ ...
5 5 votes
3 3 answers
4.0k
4.0k views
Misbah Ghaya asked Nov 23, 2016
3,966 views
State whether the following statements are TRUE or FALSE with reason:Transferring data in blocks from the main memory to the cache memory enables an interleaved main memo...
17 17 votes
3 answers 3 answers
5.2k
5.2k views
Misbah Ghaya asked Nov 24, 2016
5,189 views
A single bus CPU consists of four general purpose register, namely, $R0, \ldots, R3, \text{ALU}, \text{MAR}, \text{MDR}, \text{PC}, \text{SP}$ and $\text{IR}$ (Instructio...
18 18 votes
7 7 answers
6.0k
6.0k views
Misbah Ghaya asked Nov 23, 2016
6,004 views
State whether the following statements are TRUE or FALSE with reason:The flags are affected when conditional CALL or JUMP instructions are executed.