Information Technology Reference
In-Depth Information
3.4
Random-Access Machines
The
random-access machine
(RAM) models the essential features of the traditional serial
computer. The RAM is modeled by two synchronous interconnected FSMs, a central process-
ing unit (CPU) and a random-access memory. (See Fig.
3.17
.) The CPU has a small number
of storage locations called
registers
whereas the random-access memory has a large number.
All operations performed by the CPU are performed on data stored in its registers. This is done
for efficiency; no increase in functionality is obtained by allowing operations on data stored in
memory locations as well.
3.4.1 The RAM Architecture
The CPU implements a
fetch-and-execute cycle
in which it alternately reads an instruction
from a program stored in the random-access memory (the
stored-program concept
)andex-
ecutes it. Instructions are read and executed from consecutive locations in the random-access
memory unless a
jump instruction
is executed, in which case an instruction from a non-
consecutive location is executed next.
A CPU typically has five basic kinds of instruction: a) arithmetic and logical instructions of
the kind described in Sections
2.5.1
,
2.7
,
2.9
,and
2.10
, b) memory load and store instructions
for moving data between memory locations and registers, c) jump instructions for breaking
out of the current program sequence, d) input and output (I/O) instructions, and e) a halt
instruction.
The basic random-access memory has an output word (
out wrd
) and three input words,
an address (
addr
), a data word (
in wrd
), and a command (
cmd
). The command specifies
one of three actions, a) read from a memory location, b) write to a memory location, or c)
do nothing. Reading from address
addr
deposits the value of the word at this location into
out wrd
whereas writing to
addr
replaces the word at this address with the value of
in wrd
.
Random-Access Memory
b
m
−
1
CPU
m
−
2
cmd
Decode
ALU
out wrd
reg
a
reg
b
in wrd
1
0
prog ctr
addr
Figure 3.17
The random-access machine has a central processing unit (CPU) and a random-
access memory unit.
Search WWH ::
Custom Search