Both RAM and ROM memories are organized in the same way, as an ordered collection of words. A word is the smallest unit of memory that is read or written, and is usually a multiple of 2, such as 8 bits, 16 bits, 32 bits, or 64 bits. In the past, 36-bit memories and 60-bit memories were used on a few famous computers, such as the DEC PDP and the CDC Cyber. But as the 8-bit unit gained popularity, it came to be called a byte and a memory whose smallest addressable unit is the byte is called byte-addressable. Most computers today are byte-addressable, whereas the older computers were word-addressable. We shall use the term word in the following discussion in order to be totally generic about memory schemes.
Each word of a memory has a numerical address, starting at 0. The term random access refers to the fact that any word can be retrieved or changed in the same amount of time, regardless of its address. This is different from tape drives where the first word could be accessed immediately if the tape were rewound, but the last word would take a long time. Both RAM and ROM memories share this random access property, so their names are sort of misleading. We will refer to the central RAM of a computer as its main memory.
Memory words are accessed by specifying the address and an operation. The address is stored in a special register called the MAR, or Memory Address Register. Another register, the MBR, or Memory Buffer Register, is used to hold the contents of the memory cell. The operation is either read or write, and another control wire called memory active is used to tell the memory if it is to read or write.
Fig. 5.7.1. shows schematically how the MBR and MAR are connected to the memory words.
The MBR is always the same size as one cell of memory. If each cell is 8 bits wide, then the MBR is 8 bits.
The MAR bears a more subtle relationship to memory. Since it holds the address of the cells, its bit width is log2n where n is the number of cells in the memory. Thus, if there were 1024 cells, numbered from 0 to 1023, the MAR would need to be 10 bits wide. Thus, the MAR and MBR are often of different sizes, and bear no relationship to each other. The number of cells in a memory is almost always a power of 2 because of this addressing mechanism.