# How does “main memory consisting of 1Gbytes”, and “32 bit memory addresses” mentioned in the question below, relate to each other?

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.

• 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. – D.W. Mar 26 '18 at 3:26
• I don't even see a question here. – David Richerby Mar 26 '18 at 7:04

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.