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.