How to calculate index and tag fields lengths for a cpu cache?
You seem to have a 32-bit address space.

To address one of 8 bytes you need a 3-bit address, so 29 bits remain to address the block.

To address one of 16 bytes you need a 4-bit address, so 28 bits remain to address the block.