The Gateway to Computer Science Excellence
+3 votes
297 views

How many total bits are required for a direct-mapped cache with $128$ KB of data and $1$ word block size, assuming a $32$-bit address and $1$ word size of $4$ bytes?

  1. $2$ Mbits
  2. $1.7$ Mbits
  3. $2.5$ Mbits
  4. $1.5$ Mbits
in CO and Architecture by Boss (25.1k points)
edited by | 297 views
+1

Is this question even correctly asked?

@Satbir

0
Because options containing the size of memory but the question is asked differently.

2 Answers

+1 vote

$\underline{\textbf{Answer:}\Rightarrow}\;\mathbf{2.5Mb}$

$\underline{\textbf{Explanation:}\Rightarrow}$

Data cache $=128\;\text{KB}$

Block Size $= 1\;\mathrm W = 4\;\text{Bytes}$

Main Memory address $=32$

Tag-bits (15) Index-bits(15) Block Offset(2)


 

$\therefore $ Number of cache lines $=\dfrac{\text{Cache Memory Size}}{\text{Block Size}} = \dfrac{128\;\mathbf{ KB}}{4\;\text{Bytes}} = \dfrac{2^{17}}{2^2}= 2^{15}$

Now,

$\text{Tag Memory Size} = \text{Number of lines in cache memory} \times \text{Tag space in the line} =2^{15}\times 15 \;\text{bit}$

$\text{Total Cache Size} = \text{Tag Memory size + Data Memory size } =\left (2^{15} \times 15\;\text{bit}\right ) + \left ( 128\times 2^{10}\;\text{KB} \right )= 1.5 \text{Mb}$

by Boss (19.4k points)
edited by
0

@Satbir

Check this answer.

In made easy key its given 1.5Mb but I am getting 2.5Mb.

0
Didn't got this part 17 * $2^{17}$ KB?
0
Number of bits required for $128$ KB.
0

@ankitgupta.1729

Bhai please check this answer.

I am getting it different from made easy.

0

@`JEET

isn't word defined as the smallest addressable unit?

why are you assuming it as byte addressable?

0
But bro size of one word is clearly given. Hence, I can convert it to Byte addressable form as well.

Though, it will be referred to as word addressable only, while referring it.
0

please check this - 

Total bits = #lines * bits associated with every line.

Total bits = $2^{15}*(15+32)$ = $2^{15}*47$ = $2^{15}*32*1.46$ = $1.46Mb$ $\sim$ $1.5Mb$

0 votes

Answer: d) 1.5 Mbits

Cache size = 128KB

Block size = 4B

 #lines = 32K

Physical address size = 32 bits

Tag | Line | Block

 15  |  15   |   2

Tag memory = 15 * $2^{15}$ b

Cache memory = 128 * $2^{10}$ B

Total memory = 32*15 + 128*8 Kb = 1504 Kb = 1.5 Mb 

by Boss (10.8k points)
0
How you got $2^{10}$?
0
Because of 128KB
0
It is $2^{17}$, right?
0
Yes. Where is the confusion?
0
Bro answer is 2.5 Mb.
0

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,834 questions
57,825 answers
199,497 comments
108,308 users