22 should be correct answer as we know CPU will generate the address which is divided as
TAG BITS SET OFFSET WORD OFFSET
Now CPU generate the address of 34 bits ..now one word is of 64 bits ...we have one BLOCK of 1KB so number of words present in one block are = (1024*8 ) / 64 = 128 Words ....so if 128 words are there in ONE BLOCK to identify each one of them we need 7 bits SO WORD OFFSET = 7 bits . Now number of lines in cache = cache size / Block size = 256 Kb / 1KB = 256 Lines
So as per problem one set has 8 lines so x set will have 256 lines ...so number of set are = 256/8 = 32 sets
So to identify each one of them we need 5 bits ...so SET OFFSET is 5 bits
SO TAG bits = 34 - (5+7)= 34 - 12 = 22 bits ..