Computer Organization: Lec #10: Cache Memory Bnar Mustafa
Computer Organization: Lec #10: Cache Memory Bnar Mustafa
Bnar Mustafa
[email protected]
Spring 2022
2
• When the processor needs to read or write a location in main
memory, it first checks for a corresponding entry in the cache:
• Cache hit:- when the data and address buffers are disabled and the
communication is only between processor and cache with no
system bus traffic { data was found on cache then deliver from
cache to processor}
• Cache miss:- the desired address is loaded onto the system bus
and the data are returned through the data buffer to both the cache
and the processor.
Example:
• If the cache hold 64 k byte =216 byte, and the data transferred between
main memory and the cache in blocks of 4 byte each, this means that the
cache organized as 16k=214 line of 4 byte each.
• The main memory consist of 16 M bytes, with each byte directly
addressable by 24- bit (224=16M byte), thus for mapping purpose we can
consider main memory to consist of 4M blocks of 4 byte each.
13
Using last example by direct mapping
2- Associative Mapping
• In this type the designer must overcome the disadvantages of
direct mapping by permitting each main memory block need to
be loaded to any line of the cache, in this case, the cache control
logic interprets a memory address simply as a tag and a word
field.
Virtual memory
• Virtual memory is not a storage unit, its a technique. In virtual memory, even
such programs which have a larger size than the main memory are allowed to
be executed.
• Virtual Memory increases the capacity of main memory.
Computer Organization - Bnar Mustafa 21
Good luck