Section 8.3 CPU Interaction with Memory
The connections between the CPU and Memory are shown in Figure 1.2.1 in Section 1.2. In this section we discuss how the CPU interacts with memory. The I/O system will be discussed in subsequent chapters.
As an example of how data can be stored in memory, let us imagine that we have some data in one of the CPU registers. Storing this data in memory is effected by setting the states of a group of bits in memory to match those in the CPU register. The control unit can be programmed to do this by
placing the memory address on the address bus,
placing a copy of the register bit states on the data bus, and then
placing a “write” signal on the control bus.
For example, if the eight bits in memory at address \(\hex{0x7efff174}\) are in the state:
the r0
register in the CPU is in the state:
and the control unit is programmed to store one byte from r0
at location \(\hex{0x7efff174}\text{,}\) the control unit then
places \(\hex{0x7efff174}\) on the address bus,
places \(\hex{0xcd}\) on the data bus, and then
places a “write” signal on the control bus.
This causes the bits at memory location \(\hex{0x7efff174}\) to be changed to the state:
Important! When the state of any bit in memory or in a register is changed, any previous state or states are lost forever. There is no way to “undo” this state change or to determine how the bit got in its current state.