Saturday, October 11, 2008

Topic of the WEEK

Direct Mapping

This is the simplest among the three techniques. Its simplicity
stems from the fact that it places an incoming main memory block into a specific
fixed cache block location. The placement is done based on a fixed relation between
the incoming block number, i, the cache block number, j, and the number of cache
blocks, N:
j = i mod N

According to the direct-mapping technique the MMU interprets the address issued
by the processor by dividing the address into three fields as shown in Figure below:






The lengths, in bits, of each of the fields in Figure are:
1. Word field = log2 B, where B is the size of the block in words.
2. Block field = log2 N, where N is the size of the cache in blocks.
3. Tag field = log2 (M/N), where M is the size of the main memory in blocks.
4. The number of bits in the main memory address = log2 (B x M)
It should be noted that the total number of bits as computed by the first three
equations should add up to the length of the main memory address. This can be
used as a check for the correctness of your computation.

(extracted from book:FUNDAMENTALS OF COMPUTER ORGANIZATION AND ARCHITECTURE by Mostafa Abd-El-Barr & Hesham El-Rewini )

1 comment: