47 47 votes Consider a machine with a byte addressable main memory of $2^{32}$ bytes divided into blocks of size $32$ bytes. Assume that a direct mapped cache having $512$ cache lines is used with this machine. The size of the tag field in bits is _______ CO & Architecture gatecse-2017-set2 co-and-architecture cache-memory numerical-answers + – Madhav 15.4k views answer comment Share Follow Print See all 2 Comments 2 2 Comments reply Hira Thakur commented Jan 2, 2024 reply Follow flag A similar type of question is asked in GATE CSE 2021 Set 1 | Question: 22 3 3 replyShare Raj_Dev_Verma commented Aug 20 reply Follow flag fill 18 in the blanks 0 0 replyShare Please log in or register to add a comment.
Best answer 61 61 votes No. of blocks of main Memory $= \dfrac{2^{32}}{2^5} = 2^{27}$ And there are $512 = 2^9$ lines in Cache Memory. Tag bits tell us to how many blocks does $1$ line in Cache memory points to $1$ cache line points to $ \large \dfrac{2^{27}}{2^9} = 2^{18}$ lines So, $18$ bits are required as TAG bits. mcjoshi answered Feb 14, 2017 • edited Jan 3, 2018 by pavan singh mcjoshi comment Share Follow See all 4 Comments 4 4 Comments reply Anup patel commented Feb 14, 2017 reply Follow flag Here they are asking for Size of tag field. SO , it should be 18*2^9 bit 3 3 replyShare mcjoshi commented Feb 14, 2017 reply Follow flag Tag field means Tag bits and $18*512$ would be size of complete tag memory. 12 12 replyShare anon1 commented Jan 17 reply Follow flag why are we not taking address as 27 bit when it says main memory is divided into blocks of 32 bytes? why does it imply cache block is 32 bytes? 0 0 replyShare Yash_Upadhyay commented Jan 28 reply Follow flag Because the memory is byte addressable not block addressable. 0 0 replyShare Please log in or register to add a comment.
21 21 votes $32 - 9 - 5 = 18$ Arjun answered Feb 14, 2017 Arjun comment Share Follow See all 2 Comments 2 2 Comments reply Akash Papnai commented Nov 22, 2019 reply Follow flag The length of @Arjun Sir answer always varies with the complexity of the question. $:)$ 3 3 replyShare ankit3009 commented Nov 28, 2021 reply Follow flag This answer suits this phrase, “You reap what you sow“. This is the easiest question one can expect in CO for GATE. 2 2 replyShare Please log in or register to add a comment.
12 12 votes Main memory = 32 bits Cache memory = 512 lines = 9 bits + 5 bits for block offset = 14 bits Tag bits = 32 - 14 = 18 bits Prashant. answered Feb 14, 2017 Prashant. comment Share Follow 0 reply Please log in or register to add a comment.
12 12 votes hope it might help....... akash.dinkar12 answered Apr 4, 2017 akash.dinkar12 comment Share Follow 0 reply Please log in or register to add a comment.
4 4 votes In Direct Mapped Cache Tag bits = log(Main Memory size/ cache size) Cache size = No of blocks * Block size = 512*32 = 2^14 Tag bits = log(2^32/2^14) = log(2^18) = 18 bits Suneel Padala answered Feb 8, 2019 Suneel Padala comment Share Follow 0 reply Please log in or register to add a comment.
1 1 vote Answer is 18 bit In the case of direct mapping Tag field is the ratio of main memory and cache memory. Rajesh Panwar answered Nov 27, 2018 Rajesh Panwar comment Share Follow 0 reply Please log in or register to add a comment.