number and size of comaparators and multiplexers required

What are the number and size of comaparators and multiplexers in

a)Direct mapping

b) Associative mapping

c) k-way Set associative mapping.

It would be good if you can explain their functioning too.

4Comments
Parimal Andhalkar @parimal_andhalkar 15 Jan 2016 10:05 am

a)Direct mapping : 

Size of comparator = number of bits in TAG field.

Size of MUX = number of lines in cache to 1.

Number of MUX = Number of bits in TAG field

b) Associative mapping

Size of comparator = number of bits in TAG field.

Number of comparator = Number of lines in cache

MUX may be used to implement OR logic

c) k-way Set associative mapping

Size of comparator = number of bits in TAG field.

Size of MUX = number of sets in cache to 1.

Number of comparator = k

lucky @luckysunda 15 Jan 2016 10:11 am

what about the number os MUX in associative and set associative??

Parimal Andhalkar @parimal_andhalkar 15 Jan 2016 10:25 am

number of mux = number of bits in TAG field

lucky @luckysunda 15 Jan 2016 12:13 pm

okay..thanks