Figure 5.6 Single simulation step
components. If the simulation of the CPU were performed after the others,
then the command issued by the CPU in a given simulation step would be
executed by the other components in the next simulation step.
What format have data stored in the RAM and exchanged through the bus?
The memory of a real computer is organized in words, which are made up
of a varying number of bits, usually multiples of 8 (i.e. bytes). The most
common values are 32 and 64 bits per word; old computers also use 8 and 16
For the sake of the simplicity and clarity, the simulated RAM is structured
as an array of string cells. This solution makes it easier to understand the
evolution of the simulation.
Consequently, the command bus and the data have to be structured as
buffers that hold string values, while the address bus contains an integer
The RAM should be initialized with a given number of cells and with some
content in each cell.
How does the CPU read and write data fromto the RAM?