Chapter 13: Memory Systems
In previous chapters, we examined the operation of a processor, modelling the memory as a set of registers, each of which individually addressable. This simplistic view does not correspond to reality, except in very simple systems, but it allowed us to describe the operation of the processor without taking into account the complexities of the memory system. In particular, any current computer, whether an embedded system, a personal computer, a server or a portable device, uses numerous devices for data storage. These devices belong to two major classes: primary memory and secondary memory.
The primary memory, more frequently known as main memory, built with integrated circuits, has a shorter access time, but is more expensive (per bit), and has a smaller capacity than the secondary memory. Besides that, it does not have the capability to hold data when the system is not powered.
Secondary memory, also known as auxiliary memory, uses devices based on magnetic (disks and magnetic tape) or optical (CD-ROM and DVD) technology and is slower, but has a lower cost per bit, a greater capacity and the possibility of holding stored data even when the computer is not powered. More recently flash memories started to be used in solid-state drives (SSD) to substitute magnetic disks. Secondary memory may be used by the processor when executing programs, through the use of the virtual memory system. The secondary memory is also used to store data in file systems. This organisation of secondary storage will not be studied in this chapter since it implies knowledge of operating systems which goes beyond the scope of an introductory book.
This chapter will analyse the memory system of a computer, starting in Section 13.1 with the organisation of its main memory, which, in some simple systems, is the only form of data storage. More complex systems have additional components, arranged in an hierarchic structure (see Section 13.2) and will be studied in the following sections. In particular in Section 13.3, we will study cache systems, which aim at speeding up access to the primary storage, and Section 13.4 will focus in virtual memory systems, which make possible the transparent use of secondary storage as if it was main memory, by the processor.