-2
$\begingroup$

A computer system uses 32-bit memory addresses and it has a main memory consisting of 1Gbytes. It has a 4K-byte cache organized in the block-set-associative manner, with 4 blocks per set and 64 bytes per block. What are the number of bits in each of the Tag, Set, and Word fields of the memory address ?

A block has 64 bytes hence the $Word/Byte$ field is 6 bits long. With 4*64=256 bytes in a set, there are 4K/256=16 sets, requiring a $Set$ field of 4 bits.

This leaves 30-4-6=20 bits for the $Tag$ field.

$\endgroup$
  • $\begingroup$ We discourage "please check whether my answer is correct" questions, as only "yes/no" answers are possible, which won't help you or future visitors. See here and here. Can you edit your post to ask about a specific conceptual issue you're uncertain about? As a rule of thumb, a good conceptual question should be useful even to someone who isn't looking at the problem you happen to be working on. If you just need someone to check your work, you might seek out a friend, classmate, or teacher. $\endgroup$ – D.W. Mar 26 '18 at 3:26
  • $\begingroup$ I don't even see a question here. $\endgroup$ – David Richerby Mar 26 '18 at 7:04
0
$\begingroup$

A block has 64 bytes hence the $Word/Byte$ field is 6 bits long. With 4*64=256 bytes in a set, there are 4K/256=16 sets, requiring a $Set$ field of 4 bits.

This leaves 30-4-6=20 bits for the $Tag$ field.

$\endgroup$
  • $\begingroup$ The amount of memory is a the max that the CPU can do combined and what the board allows for. Often the board allows for less memory than what the CPU can handle. However, the cache is hardware inside the CPU, that probably doesn't know the board's 1gb limit. So, unless I knew otherwise (like the processor uses 32-bit memory addresses but it (the processor, here not the board or system) is designed for max memory of 1gb), I'd start with 32 instead of 30. $\endgroup$ – Erik Eidt Mar 26 '18 at 16:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.