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. How many bits are required for addressing the main memory? How many bits are needed to represent the TAG, SET and WORD fields? CO & Architecture gate1990 descriptive co-and-architecture cache-memory + – Misbah Ghaya 39.1k views answer comment Share Follow Print See all 4 Comments 4 4 Comments reply commenter commenter commented Aug 14, 2019 reply Follow flag "four block sets" phrase can be interpreted as four-block sets: Each set has 4 blocks. four block-sets: Number of sets are four. How can one know the correct interpretation? 6 6 replyShare Chandrabhan Vishwa 1 commented Nov 4, 2023 reply Follow flag @commenter commenterfour block sets means each set has four block 0 0 replyShare Ashfaque alam commented Dec 7, 2023 reply Follow flag here in question some thing need to notice :- 1) here word is of 8bit as they have written in question. means 1word=1bytes 2)here each set contain 4 block --------------------------------------------------------------------------------------------------------------------------------------------------------- question 1) here main memory contain no of block =>16384=>2^14 and each block size is 256 word which is 256 bytes means main memory size is 2^14*2^4=>2^22 so totol 22 bit required for adressing ------------------------------------------------------------------------------------------------------------------------------------------- for question 2) totol 22 bit for main memory and if direct associative then division will happen like this => 7||7||8 now if each set contain 4 block then from direct mapped index no 2 bit will shift toward tag bit so final adress division wil be like this =>9||5||8 0 0 replyShare Sharadamani_K_N commented Dec 28, 2025 reply Follow flag 1) 22-bits 1 1 replyShare Please log in or register to add a comment.
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) Size of main memory $=2^{14}\times 2^8=4MB$ ( $22-\text{bits}$ required for addressing the main memory). 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}$$ kirti singh answered Nov 23, 2016 • edited Aug 12, 2019 by Satbir kirti singh comment Share Follow See all 14 Comments 14 14 Comments reply Show 11 previous comments bts1jimin commented Oct 5, 2018 reply Follow flag How is main memory size 2^14 0 0 replyShare Devshree Dubey commented Oct 6, 2018 reply Follow flag @bts1jimin,If you could see in the question it is clearly mentioned above 16,384 can be written as 2^14. That's how we derive the size as 2^14. Take like this:- 1024*16=2^10*2^4. I hope this now helps u. If haven't understood still,please comment. Yeah. :) 0 0 replyShare AnuraagP commented Dec 8, 2018 reply Follow flag @kirti singh Word field will have 8bits cuz block size is 2^8 words , not for cache memory having 128 blocks. 1 1 replyShare Please log in or register to add a comment.
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 fieldRemaining= 22-(5+8) = 9 . So 9 bits for Tag. Utkarsh_Bhadauria answered Sep 20, 2025 Utkarsh_Bhadauria comment Share Follow 0 reply Please log in or register to add a comment.
2 2 votes helping is a good thing! goku4199 answered Oct 5, 2025 goku4199 comment Share Follow See 1 comment 1 1 comment reply jacknroll commented Dec 15, 2025 reply Follow flag sharing is caring 0 0 replyShare Please log in or register to add a comment.