Random Access Memory
Last updated
Last updated
It's time to gather our knowledge of digital memory and create the ultimate storage unit: Random Access Memory or RAM for short. You might heard of things like "my computer ran out of RAM" or "xxx app drained my RAM real quick". These illustrate how important RAM is to the function of our computer. The reason why we rely on RAM so much is because it's blazing fast and the location of the memory doesn't not influence access speed, hence the name "random access memory". An additional magic is that no matter how much stuff our RAM stores, the access time is constant. So a RAM with 10 gigabytes is just as fast as one with 10 megabyte even though the first one stores 1000 times more stuff than the second. Before we move on to explore RAM more, you should watch Computerphile's clear explainations of RAM first:
After watching the two videos, let's start by creating RAM with 2 flip flops:
It's your turn to implement the above in Sim. Here's the header:
If you get stuck, click on "See Hints".
If you completed the ram2
, you may start to realize that we already built parts of it before. The way we connect the address
to the clk
signals of the two flip flops is just a regular dmux
. The way we connect the two q
s of the two flip flops to the final output is just a regular mux
. Now with the same header, try implement ram2
again using dmux
and mux
.
If you get stuck, click on "See Hints".
Now that you know how to address 2 flip flops in a RAM, we can easily expand it into 8 flip flops:
If you get stuck, click on "See Hints".
Combine 8 RAM8 to form RAM64.
Combine 8 RAM64 to form RAM512.
Combine 8 RAM512 to form RAM4K.
Combine 4 RAM4K to form RAM16K. Not 8 this time, but 4.
🎉 Congrats! You have created the memory unit of our computer!