\(3.3.\)Memory Units

1.From 1-bit to register

  the previous unit ended up with a description of how a single bit register works. And it doesn't take a big stretch of imagination to understand that you can take several such one bit register and put them one next to the other. And by doing this, you can create an abstraction of a 16-bit number.

  • The width of the register, in general, is a parameter called \(w\). In some computers it's 16-bit, in other computers it may be 32-bits or 64-bit.
  • The register's state refers to the value which is currently stored in the register.

  let's take a user's perspective of this of this device:

  • How do we read the value of this register? We simply probe the output. Because at any given point of time, the output simply emits the state of the register.
  • How do we write the value of this register? We set in to the new value \(v\), and set load to 1, then the register state becomes 1.
  • And from the next cycle onward, the output of the register will also start emitting this value \(v\). From the next cycle onward, the register will effectively store the value \(v\). And it will keep on storing this value forever until we decide to change this value in the very same manner.

2.RAM

  A RAM can be abstracted as a sequence of n addressable registers, with addresses from 0 to n-1:

  • There's one thing very important to emphasize: at any given point of time, only one register is selected and only one register is working, all the other registers don't take any part in the game.

  Given this fact, we have to say which is the register on which we want to operate, which is the register that we want to read, or which is the register whose value we want to change.

  • To read a particular register, we:

    1. Sent the address to RAM.
    2. Probe the output.
  • To write a particular register, we:

    1. Sent the address to RAM.
    2. Set the value and load.