Memory Units in Digital Systems
A memory unit is a collection of storage cells together with the associated circuitry necessary to transfer information in and out of storage. Memory stores binary information in groups of bits called words. A word in memory is a fixed-length sequence of bits, and the size of a word is often determined by the architecture of the system.
Memory Words and Bytes
A memory word is a group of binary digits (0s and 1s) that can represent a number, an instruction code, one or more alphanumeric characters, or any other binary-coded information. A common group of eight bits is called a byte. Most computer memories use words whose number of bits is a multiple of 8. For example:
- A 16-bit word contains 2 bytes.
- A 32-bit word contains 4 bytes.
The capacity of memory in commercial computers is typically stated as the total number of bytes that can be stored.
Memory Structure and Addressing
The internal structure of a memory unit is defined by:
- The number of words it contains.
- The number of bits in each word.
Special input lines called address lines select a particular word. Each word in memory is assigned an identification number, called an address, starting from 0 and continuing sequentially up to , where is the number of address lines. The selection of a specific word inside the memory is done by applying the -bit binary address to the address lines. A decoder inside the memory accepts this address and opens the paths needed to select the bits of the specified word.
Memory sizes are often referred to using standard prefixes:
- K (kilo): (1024) words.
- M (mega): words.
- G (giga): words.
For example:
- 64K = words.
- 2M = words.
- 4G = words.
Types of Memory
Two major types of memories are used in computer systems:
- Random-Access Memory (RAM)
- Read-Only Memory (ROM)
Random-Access Memory (RAM)
In random-access memory (RAM), the memory cells can be accessed for information transfer from any desired location, hence the term "random access." The process of locating a word in memory is the same regardless of its physical location, and the time required is constant.
Communication and Operations in RAM
Communication between a memory and its environment is achieved through:
- Data input lines: For the information to be stored in memory.
- Data output lines: For the information coming out of memory.
- Address selection lines: To specify a particular word among the available words inside the memory.
- Control lines: To specify the direction of transfer.
The two primary operations that a RAM can perform are:
- Write operation: Specifies a transfer-in operation.
- Read operation: Specifies a transfer-out operation.
Steps for Writing to RAM
To store a new word in RAM:
- Apply the binary address of the desired word to the address lines.
- Apply the data bits to be stored into the data input lines.
- Activate the write control signal.
The memory unit will store the bits present on the input data lines into the word specified by the address lines.
Steps for Reading from RAM
To read a stored word from RAM:
- Apply the binary address of the desired word to the address lines.
- Activate the read control signal.
The memory unit will transfer the bits from the word selected by the address to the output data lines. The content of the selected word does not change after being read.
Read-Only Memory (ROM)
A read-only memory (ROM) is a type of memory that only supports read operations; it does not have a write capability. The binary information stored in a ROM is made permanent during the manufacturing process and cannot be altered.
Structure and Operation of ROM
An ROM is an array of binary cells organized into words of bits each. It has address input lines to select one of the words of memory, and output lines, one for each bit of the word. An integrated circuit ROM may also have one or more enable inputs for expanding a number of packages into a ROM with larger capacity.
Unlike RAM, a ROM does not need a read-control line since the output lines automatically provide the bits of the word selected by the address value. A ROM is classified as a combinational circuit because its outputs are a direct function of the present inputs (the address lines). Internally, a ROM is constructed with decoders and a set of OR gates, with no need for storage capabilities as in RAM.
Applications of ROM
ROMs are used in digital systems for:
- Storing fixed programs that are not to be altered.
- Storing tables of constants that are not subject to change.
- Designing control units for digital computers, known as microprogrammed control units, where ROMs store coded information that represents the sequence of internal control variables needed for various operations in the computer.
Types of ROMs
There are three primary types of ROMs based on their programmability:
-
Mask Programmed ROM: The paths are programmed by the semiconductor company during the final fabrication process, according to a truth table provided by the customer. This method is cost-effective for large quantities but expensive for small quantities due to custom masking fees.
-
Programmable Read-Only Memory (PROM): PROM units contain all the fuses intact, giving all 1's in the bits of the stored words. Users can program PROMs by blowing fuses through output terminals for each address, turning specific fuses into 0s. Special instruments called PROM programmers facilitate this procedure. The programming is a hardware process and is irreversible.
-
Erasable Programmable Read-Only Memory (EPROM): EPROMs can be erased and reprogrammed. Exposure to ultraviolet light for a given period of time discharges the internal gates, resetting the EPROM to its initial state. Electrically Erasable Programmable Read-Only Memory (EEPROM) is a variant that can be erased with electrical signals instead of ultraviolet light, allowing for easier reprogramming.
The detailed understanding of these memory types and their functionalities is crucial for the design and optimization of digital systems and computer architectures.