One of the characteristics of RAM is that it loses its value on power-off. But we have many applications where we need memory which doesn't lose its value on power-off. For example, when you turn on your computer, it loads MOST of the operating system in from disk, but some amount of program has to be resident in the computer right from the beginning to control the loading in from disk! Also, computer technology is often used in situations without disks, such as cash registers, vending machines, etc, which in many cases deserve to be called computers, but cannot load software from disk so it has to reside in the computer already at power-on.
You will have heard the term ROM (read-only memory). ROMs are chips which are very much like RAM chips so long as you only try to read them, but their contents cannot be changed or erased. The only way to change the contents of a ROM is to modify or replace the physical chip. The memory contents are hardwired. One way to build a ROM would be to take our basic memory design, with the address decoder and the array of registers, but instead of having registers, just have all the bits tied to logic 1s and 0s as appropriate.
If you're trying to build a cash register with some built-in software, you don't want to have to have custom-designed chips just to hold the software, especially if you're releasing upgrades a few times a year. The same goes even for the smaller amount of ROM in general purpose computers. In fact, these days you want to avoid custom-made chips in most situations.
There is a kind of memory component called a PROM ('p' for programmable) which addresses some of these concerns. It is like a cross between a ROM and a PLA; remember the programmable logic array with the blowable fuses. You can blow certain fuses to configure the values of the PROM at all the various addresses.
Still, every time you change the contents (e.g. every time you release a software upgrade), you have to buy a new bunch of PROMs. The next step is the EPROM ('e' for erasable), in which the bits are represented not by blown fuses but rather by the depletion of electric charges in certain materials inside the chip. As far as programming the chip works, the effect is very similar; however, in the case of the EPROM, it is possible to unprogram it. An EPROM chip looks a little unusual in that it has a sticker on the top. If you remove the sticker, there is a little quartz window, and if you shine a strong ultraviolet light into it for 15 minutes, all the charges at the junctions are restored and it's like a new chip again, ready to be programmed again.
A related type of memory component in this series is an EEPROM ("electrically erasable"), which is basically equivalent to a RAM chip except it's thousands of times slower, and it retains its value without power. One common use of EEPROMs in home computers is to store configuration data. These days, all home computers have hard disks and so we store most configuration data there. However, in a computer with multiple hard disks, the selection of which hard disk to boot from cannot be stored on disk because this is circular. EEPROMs are used for this sort of thing and also to store passwords required before you're allowed to boot a computer, and other data which is for one reason or another difficult or impossible to be reading from the disk.
"Flash memory" is a newer technology which is functionally very similar to EEPROM, except that it is considerably faster. It is used in devices such as digital cameras and MP3 players which have secondary storage (sometimes of considerable size) which is not disks. In fact, flash memory is faster than disks (although more expensive per gigabyte and arguably less reliable) and some personal computers are starting to be built around flash memory instead of disks.
We also use flash memory or EEPROM in many places where we used to use EPROMs, because this allows us to modify the contents so as to perform an upgrade in software. If you've applied a "flash BIOS upgrade" on your home computer, this is what I'm talking about here. In the older days, such upgrades required replacing PROM or EPROM chips.
The CPU can put an address in a special-purpose register known as the memory address register (MAR), and then use a control connection to the main memory to say "I want to do a memory read". Then the memory unit decodes that address and ties the appropriate word of memory into the bus back to the CPU. This data comes back to the memory data register (MDR) inside the CPU, and either the CPU knows how long this process takes or there is another control signal from the memory to the CPU saying that the data is now ready. At this point the CPU knows that the MDR contents have stabilized so it can use them. Everything has to be synchronized by the system clock, and generally we have one step per clock cycle, or some similar rule.
To write to memory, the CPU has to load the MAR with the address and the MDR with the data. Then it asserts a different control line which says "I want to do a memory write". The memory unit decodes the address, but instead of connecting the word's output to the MDR, it connects the word's input to the MDR, and asserts the "load" line on the flip-flops for that word. Again, the CPU either knows how long this process takes or there is another control signal from the memory to the CPU saying that it's done. The CPU doesn't have to wait for the memory write to complete before it can do anything else, but it does have to leave the MAR and MDR intact until the operation is complete.
This line back to the CPU saying that the operation is complete is sometimes called memory function complete (MFC).
To summarize: