Vocademy

Part 7: Memory

The three primary functions of a computer's central processing unit are to retrieve data from memory, manipulate that data, and then store that data back into memory. Computer memory is any mechanism that can store information that the CPU can access.

ROM

Historians recognize the Jacquard Loom as the earliest forerunner of the digital computer. Information was stored as holes punched in heavy paper cards. It had no mechanism to punch holes in cards, so it could only retrieve information from the cards. Therefore, the punched cards were a form of read-only memory (ROM).

The ENIAC computer had movable cabinets called data tables with banks of rotary switches. Technicians stored data via these data tables by setting the switches. ENIAC could not change the switches, making the data tables another form of read-only memory.

Modern read-only memory consists of integrated circuits with information manufactured into the chips during fabrication. Early user-programmable read-only memory (PROM) had a matrix of connections that could be selectively burned open to store information. As such, technicians used the term "burning ROM" for storing information in such chips (the origin of the term "burning" for storing information in EPROM and on CD-R, DVD-R, and BD-R media). The next development was erasable, programmable ROM (EPROM), which could be erased by exposure to ultraviolet light (EPROM is recognizable by a quartz window in the package exposing the chip).



Intel's first EPROM, the 1702, which holds 256 kiB of data. The chip is visible through the quartz window.

The final development in ROM memory is electrically erasable programmable read-only memory (EEPROM). The most common form of this memory used in computers is flash memory (also known as non-volatile RAM). Unlike early computers, where upgrading the ROM meant replacing the ROM chips, modern computers can upgrade the ROM (usually called the BIOS) by running a ROM upgrade program.

ROM contains programming and data that is expected never to change. This is used to start the computer, after which programming and data are stored in the random-access memory (RAM). ROM is rarely used once the operating system is loaded.[1] Some peripherals, like video cards and SCSI disk controllers, contain ROM. The computer follows instructions contained in that ROM when it starts up.

In early computers (those using Von Neumann architecture), all internal memory was arranged into one address space. Think of it like a stack of numbered shoeboxes where the lowest numbered box (number zero) is at the bottom and the highest numbered box (let's say number 65,535) is at the top. Each shoebox contains a piece of paper with one byte (eight bits) of memory. To access a byte of memory, the CPU presents the shoebox number (the address) to the memory circuitry, which opens the corresponding shoebox and presents the data contained therein to the CPU. The computer's ROM is typically wired in at the highest addresses. The very highest addresses contain numbers that tell the computer at what address to start processing instructions when the computer starts. Therefore, when a computer starts, it retrieves the address of the startup code from the last bytes of the address space, goes to the address specified there, and executes instructions. These instructions must be somewhere else in the ROM because the RAM is empty at this time.

ROM on peripheral boards is mapped into address space reserved for that purpose at addresses lower than the BIOS ROM described above.

Sequential memory

Modern ROM is a type of random-access memory, meaning any byte of memory can be accessed directly by presenting the byte's address to the memory circuitry. ROM is never called random-access memory because that name is reserved for the volatile memory (memory that loses its information when the power is removed) that stores working programs and data.

The first ROM, the punched cards of the Jacquard Loom, was sequential memory; the cards had to be read one after the other. A particular card could not be accessed without first passing the preceding cards past the reading mechanism.

Computers went through several generations of sequential memory. The first was punched paper tape or plastic film stock (this was a type of write-once-read-mostly [WORM] memory). Later, computers used magnetic tape for the same purpose. The data on magnetic tape can be changed. However, if data is added to the middle of the tape, other data must be moved out of the way. The quickest way of doing that was to copy the entire tape to another, inserting the new data in the process.

Drum and disk memory

An early type of semi-sequential memory was drum memory. With drum memory, a cylinder of non-ferrous metal is coated with the same type of material as magnetic tape. Multiple read/write heads spaced along the rotating drum create magnetic tracks of data. The data on the drum is more easily moved around than that stored on tape, but drum memory holds much less data.


The drum memory unit from the BESK computer built in Sweden.

 

Drum memory has been obsolete since the early days of computers, but many computers use a symbol resembling a data drum to represent mass data storage.

Activity indicators on an Asus laptop computer. Disk activity is represented with a drum memory icon.

 

Disk memory quickly evolved from drum memory. Data disks may be made from a flexible material like that used for magnetic tape (floppy disks) or consist of non-ferrous metal or glass disks coated with magnetic material (hard disks). Disk memory is covered in detail elsewhere.

The CPU cannot read instructions directly from sequential, drum, or disk memory. Any programs must be loaded into RAM before the computer can execute the instructions.

RAM

Random Access Memory (RAM) is the working memory of a computer. This is where programs must reside. The CPU cannot execute instructions unless they are in RAM. Data directly manipulated by the CPU is also held in RAM. This is as opposed to the hard disk (or other mass storage), where programs and data are stored when not in use.

Looking back at the shoebox model used above, RAM usually starts at the lowest-numbered address. Early PCs could only use 640 kiB of RAM. This was a limitation of the software and hardware design, not a limit of the CPU. Addresses between the top of RAM and the start of ROM could have Peripheral ROM (mounted on video or SCSI disk controller cards, for example) or be empty.

Using the 8088 processor, the original IBM PC could only access 1 MiB of memory addresses, with only the first 640 kiB available for RAM. The PC manufactures developed several schemes to increase the available RAM. The first was expanded memory, where a hardware driver mapped in 16 kiB bocks from an expanded memory board to empty addresses between RAM and ROM. Next was extended memory, where later CPUs could access addresses above the 1 MiB limit. However, in keeping new systems backward compatible with older systems, the CPU had to use a new operational mode (protected mode) to access this memory. After several years, backward compatibility was abandoned, and protected mode is the only mode PCs use today (except for the initial start-up process).

Memory controller

The memory controller handles the RAM refresh[2] and acts as a go-between from the CPU to the RAM. On some newer CPUs, the memory controller is part of the CPU die (along with the Northbridge).

RAM chips and modules

On early motherboards, the RAM chips are plugged directly into sockets on the motherboard. This was unreliable as the chips would "creep" out of the sockets as the motherboard and sockets expanded and contracted with temperature. The next generation of RAM came on separate circuit boards (RAM modules), which plugged into sockets that held the modules firmly in place with a clip.

SIPPs

The first generation of RAM module was called a Single-Inline Pin Package (SIPP). These had several memory chips on a circuit board with 30 pins on the edge. There weren't much better than RAM chips on the motherboard as the pins tended to break easily.

SIMMs

The next generation, the Single Inline Memory Module (SIMM), was essentially a SIPP without the pins, just edge connectors on the circuit board. Early SIMMs had 30 pins (the edge connectors are usually called pins even though no pins are present) and an 8-bit-wide data bus. The 80286 CPU had a 16-bit wide data bus. This required that 8-bit SIMMs be used in groups of two (two-SIMM memory banks). The 80386 CPU had a 32-bit wide data bus. This required that 8-bit SIMMs be used in banks of four. The second generation of SIMM had 72 pins and a 32-bit-wide data bus. This matched the 32-bit-wide data bus of the 80386 CPU and only required one SIMM per RAM bank.

To install a SIMM, put the connector side of the module into the socket at an angle, then move it until it clicks into place in a vertical position. Two clips hold the SIMM in place. To remove the SIMM, you move these clips out of the way and allow the SIMM to fall over. Then, you can remove the SIMM from the socket.


30-pin SIMM and empty sockets.

DIMMs

When the Pentium processor was released, the 128-pin Dual Inline Memory Module (DIMM) was developed to go with it. DIMMs have a 64-bit-wide data bus matched tp the 64-bit-wide data bus of modern CPUs.



Top to bottom, DIP, 8-bit SIPP, 8-bit SIMM, 32-bit SIMM
PC-133 DIMM, DDR DIMM

There is no obvious difference between a SIMM and a DIMM. Both have rows of connectors on one edge of the module circuit board (on both sides of the board). On a SIMM, the connectors on one side of the board connect to the connectors on the other side of the board. On a DIMM, the connectors on one side of the board are separate from the connectors on the other side of the board. DIMMs also insert vertically (straight down) into the socket, and two plastic latches hold the module in place. To remove a DIMM, push back on these latches (away from the ends of the socket), and the latches will lift the module vertically out of the socket.

SODIMMs

Small Outline DIMMs (SODIMMs) are used for portable computers and small form factor desktop motherboards. SODIMMs plug into sockets much like the old SIMMS; they are put in at an angle and then pushed into two latches that hold the module into the socket.


A SODIMM

The Memory Sockets

As computers became faster, faster and faster RAM was developed with them. Each generation of motherboard takes a particular generation of RAM module. These are not interchangeable; you cannot put DDR RAM into a motherboard made for SDRAM or vice versa, nor can you put DDR2 RAM into a motherboard made for DDR RAM or vice versa. RAM modules have one or more slots cut into the edge connector.
DIMM Sockets

Inserting a SODIMM[3]

Each generation/type of RAM has these slots cut in different places. This acts as a key that prevents the wrong module from being plugged into a particular socket. Don't try to force a RAM module into the wrong socket. They won't fit, and you will damage either the RAM module or the motherboard.

—————————
1This applies to PCs. Some computers, embedded systems, etc., have the entire operating code in ROM
2The dynamic RAM used for the main working memory loses its data in about 100 miliseconds. Therefore, it must be refreshed within that time to keep the data valid.
3Image credit: https://embarcados.com.br/prototipagem-rapida-com-nanoshields/
Vocademy