Page 352 - Embedded Microprocessor Systems Real World Design
P. 352
A microcontroller may have an internal program store, like our example, but many proces-
sors provide the program counter outputs on an external address bus so the control store
can be outside of the microprocessor IC.
In addition to internal registers, a real microprocessor typically has a means to produce
an address that allow^ an external register bank, or memory, to be accessed. This address
bus usually is shared with the program counter address bus. Our simple example could
simulate this by defining an output register as an address register and another output
register as a data register. The machine would write a value to the address register, then
write the desired data to a data register. A data register clock also would have to be pro-
vided, so the external memory knows when a write has occurred. If the output registers
are 8 bits wide, this would permit access to an external memory of 256 locations. A real
microprocessor typically can access a much larger external memory and allows the address
to be part of the instruction. This is called an immediate address, similar to the immediate
data field we looked at earlier. In our simple machine, this probably would be the part of
the control store bits that hold the branch address. Obviously, in this case, a branch instruc-
tion could not be an immediate instruction and vice versa. It is up to the external memory
device to decode the &bit address and determine to which specific register (or location)
to write.
A real microprocessor often can perform indirect operations, where the address of exter-
nal memory or the external control store is derived from an internal register. These reg-
isters often are incremented or decremented automatically as part of the instruction.
The ability to branch to an address contained in a register. In our simple machine, this
would require another path from one of the register banks back to the program counter
inputs.
The ability to link two registers together for some operations. Two &bit registers may be
linked to make a 16-bit-wide memory address register. Typically, increment and decrement
operations operate on the register as a single l6bit value.
More complex microprocessors have other, more sophisticated features, but this covers
the basic components that go into a modern microprocessor or microcontroller.
A More Complex Microprocessor
Figure D.7 shows a block diagram of another, more complex, microprocessor that incorpo-
rates some of the preceding features. In this diagram, we have a microprocessor integrated
circuit (IC) that contains an ALU, register bank, accumulator register, timing logic, instruc-
tion register, indirect address register, address mux, data mux, and program counter. Outside
the microprocessor itself we have two devices: an external control store and an external
memory.
The ALU is like the ALU in our simple machine. It performs arithmetic and logical
functions on the values at the inputs. This is a 16-bit machine, with a 16-bit-wide ALU. The
output of the ALU drives a register bank with four registers. Results of ALU operations can
be clocked into any register of the bank, and any register in the bank can be used as one of
the operands in ALU operations.
Appendix D 333