Top-Level System Design 299
Entitymemis a large array with a simple bus interface to allow reading
and writing to the memory. A memory location is selected forreadby
placing the appropriate address of the location on signaladdr, setting
inputrw(read write) to a‘ 0 ’and putting the value‘ 1 ’on signalsel
(select). The value of the memory location appears on signaldata, and
signalreadyis set to a‘ 1 ’value signaling that the memory information
is available.
To write a location in the memory, the address is placed on signal addr,
set signal rwto a ‘ 1 ’value, set signal selto a ‘ 1 ’value, and put the data
to be written on input data.
The memory is divided into two separate sections. The first section is
the instruction area, and the second is the data area. The instruction area
contains the instructions to be executed, and the second section contains
the data area for the instructions to manipulate. The CPU instructions
start at location 00 and end at location 0D. The data area starts at loca-
tion 10 and ends at location 3F, the end of the array. The instructions
stored in the memory device are a simple algorithm for moving a block of
data from one location to another. This type of program could also be
considered a block copy operation.
Block Copy Operation
A diagram showing how a block copy operation looks is shown in Figure 12-6.
The copy operation starts when the CPU gets a resetsignal. A reset
signal causes the CPU to reset its internal state and start processing
instructions at location 00 of the memory. The first few instructions set
up the appropriate CPU registers so that the block copy operation can
proceed. Register 1 contains the starting address, or the address of the
first element of the memory block to be copied. Register 2 contains the
starting address for the destination of the memory block. Register 6 contains
the ending address of the memory block to be copied.
The first instruction at location 00 loads register 1 with the starting
address of the memory block to be copied. The actual address is contained
in memlocation 01. The value is hexadecimal 10 or 16 decimal. The block
copy program starts the copy operation from location 10. The first instruc-
tion is a double-word instruction. The first word specifies the instruction
opcode and the registers to be used in the instruction. The second word
contains the absolute address to be used in the operation.
The next instruction is at memory location 02. The first instruction
advanced the program counter past location 01 , which contained the