Page 123 - Understanding Automotive Electronics
P. 123
2735 | CH 4 Page 110 Tuesday, March 10, 1998 11:06 AM
4 MICROCOMPUTER INSTRUMENTATION AND CONTROL
accomplished in the register section. The specific operations performed during
the execution of a given step in the program are controlled by electrical signals
from the instruction decoder.
During each program step, an instruction in the form of an 8-bit (or
possibly 16-bit) number is transferred from memory to the instruction register.
This instruction is decoded using logic circuits similar to those presented in
Chapter 3. The result of this decoding process is a set of electrical control
signals that are sent to the specific components of the register section that are
involved in the instruction being executed.
The data upon which the operation is performed is similarly transferred
from memory to the data bus buffer. From this buffer the data is then
transferred to the desired component in the register section for execution of the
operation.
Note that an arithmetic and logic unit (ALU) is included in the register
section of the typical microprocessor is shown in Figure 4.6. This device is a
complex circuit capable of performing the arithmetic and logical operations, as
explained in Chapter 3. Also included in the register section is the accumulator,
which is the register used most frequently to receive the results of arithmetic or
logical operation. In addition, the example microprocessor register section has an
index register, stack pointer register, and program counter register. The program
counter register holds the contents of the program counter and is connected
through the internal address bus to the address buffer register. The address bus for
the example microprocessor has 16 lines, and thereby can directly address 65,536
(i.e., 64K) of memory.
READING INSTRUCTIONS
To understand how the computer performs a branch, one must first
understand how the computer reads program instructions from memory. Recall
that program instructions are stored sequentially (step by step) in memory as
binary numbers, starting at a certain binary address and ending at some higher
address. The computer uses a register called the program counter (Figure 4.4)
to keep track of where it is in the program.
Initialization
The first step in starting To start the computer, a small startup (boot) program that is permanently
up a computer is initial- stored in the computer is run. This program sets all of the CPU registers with
ization. the correct values and clears all information in the computer memory to zeros
before the operations program is loaded. This is called initializing the system.
Then, the operations program is loaded into memory, at which point the
address of the first program instruction is loaded into the program counter. The
first instruction is read from the memory location whose address is contained in
110 UNDERSTANDING AUTOMOTIVE ELECTRONICS