Direct Mapped Cache

In a computer, we divide it into 3 components - processor and memory where instruction transfer happens and the I/O devices.

image.png

Registers that store data and instructions are in the datapath of the processor. This produces very fast memory elements. But due to how fast it is, it is usually expensive and we thus do not have many (only 32).

Recall that if operands are in memory we have to load them to processor (registers), operate on them and store them back to memory.

DRAM

Today, with modern technology, we have the DDR SDRAM - Double Data Rate - Synchronous Dynamic RAM which is the dominant memory technology in the PC market. They deliver memory on the positive and negative edge of a clock (double rate)

image.png

Taking a look at he capacity growth trend, it increase fourfold every 3 years and is still growing, but we still have a problem with the speed.

Let’s take a look at the difference in the improvement of capacity and speed

image.png

everytime you need to access data or instruction from memory, you will need around 50 clock cycles!

SRAM

While DRAM is higher in density, costs less and can store more memory, it has slower access latency of 50-70ns, SRAM is lower density, costs more, can store less data but has faster access latency of 0.5 - 5ns.

DRAM is used in main memory while SRAM is used in flip-flops / cache memory to provide faster access.

image.png

Magnetic Disk