Results (
Thai) 2:
[Copy]Copied!
How does the control unit really function? We have done some hand waving and
simply assumed everything works as described, with a basic understanding that, for
each instruction, the control unit causes the CPU to execute a sequence of steps correctly.
In reality, there must be control signals to assert lines on various digital components
to make things happen as described (recall the various digital componentsfrom Chapter 3). For example, when we perform an Add instruction in MARIE in
assembly language, we assume the addition takes place because the control signals
for the ALU are set to “add” and the result is put into the AC. The ALU has various
control lines that determine which operation to perform. The question we need to
answer is, “How do these control lines actually become asserted?”
You can take one of two approaches to ensure control lines are set properly.
The first approach is to physically connect all of the control lines to the actual
machine instructions. The instructions are divided up into fields, and different bits
in the instruction are combined through various digital logic components to drive
the control lines. This is called hardwired control, and is illustrated in Figure 4.14.
The control unit is implemented using hardware (with simple NAND gates,
flip-flops, and counters, for example). We need a special digital circuit that uses,
as inputs, the bits from the opcode field in our instructions, bits from the flag (or
status) register, signals from the bus, and signals from the clock. It should produce,
as outputs, the control signals to drive the various components in the computer.
For example, a 4-to-16 decoder could be used to decode the opcode. By
using the contents of the IR register and the status of the ALU, this unit controls
the registers, the ALU operations, all shifters, and bus access.
Being translated, please wait..
