RAM and ROM
Introduction
Computer systems come with two types of primary memory, RAM and ROM. Both types are known as primary memory (or primary storage) because the CPU can access them both directly.
Secondary storage
We often compare primary memory to secondary storage. Secondary storage is the term used for long term storage devices like a hard drive, a CD-ROM or a pen drive. The hard drive in a computer, for example, typically stores your operating system, your applications and all of your files, even if the power is switched off and even if you are not using them at the moment. We often think of secondary storage as a suitcase, a place simply used to store large amounts of data. This data isn’t accessed directly by the CPU whilst it is in the suitcase. If the CPU needs to run an application or access a particular file, then a copy of the application or file is moved into RAM first, and then it accesses it from RAM.
RAM (Random Access Memory)
This is the place where the computer stores programs and files it is using at the moment. Remember, all your programs and files are stored on your hard drive (whether you are using them or not) but the ones that are open, that are being used at the moment, have a copy in RAM. That means that the CPU can access them immediately. For this reason, RAM is often also known as the immediate access store. Computers could be designed so that they accessed instructions and data in a program directly from a hard drive. The problem with this approach is that devices like hard drives and other storage devices are very slow compared to RAM. It wouldn't allow computers to perform as quickly as they do.
You can think of RAM as a table with two columns. The second column is used to store instructions in a program and any pieces of data the program needs. There will be lots of these 'storage units' so each of them needs an address and that is what the first column is used for. The CPU uses these addresses to find and save data and instructions.
RAM Address |
Data item in RAM |
1354354 |
0100 1011 1011 0011 |
1354355 |
1100 1111 1011 0001 |
1354356 |
0110 0011 1000 0001 |
1354357 |
0000 1111 1101 1111 |
1354358 |
0110 1111 0000 1011 |
1354359 |
0111 1001 1010 0000 |
1354360 |
1100 0001 1001 1010 |
ROM (Read Only Memory)
ROM is needed when a computer system is powered up.
ROM holds part of a program that starts running when a computer is switched on.This program has two jobs:
- It checks that the computer hardware is all present and working correctly when you power up a computer system. It runs what is known as a 'BIOS' check (Basic Input Output System check)
- Then it helps the computer copy the operating system from the hard drive to RAM, so that the computer can then be used.
Starting up a computer is also known as 'booting up' the computer.
RAM v ROM
There are some key differences between RAM and ROM that should be noted, apart from their typical uses.
-
- RAM is volatile. That means that when you switch the power off, all the contents of RAM are lost. ROM is non-volatile - even if you switch the power off, the programs and data in ROM are not lost. They are there waiting for you to power up the computer again! If your computer starts misbehaving itself, one solution is to switch off the power and boot it up again. What you are doing is to clear out the RAM and reload it all again in a nice, organised fashion.
- You can read from RAM and write data to RAM as well. With ROM, you can only read from it. You can't write anything to ROM. (Actually, it is possible if you know what you are doing. This process is known as 'flashing'. If something goes wrong whilst you are flashing ROM, the equipment can stop working all together!)