Module 3 Notes
Module 3 Notes
Module 3 Notes
There are primarily two different approaches for designing a control unit:
A. In hardwired control unit, the control units use fixed logic circuits to
interpret instructions and generate control signals from them. A controller
that uses this approach can operate at high speed; however, it has little
flexibility, and the complexity of the instruction set it can implement is
limited. The hardwired approach has become less popular as computers have
evolved.
Here,
the
fixed
combinational circuits namely the encoder and decoder generate the necessary control
signals as shown above.
1.The decoder decodes the instructions that are loaded in the IR (Instruction
Register).Accordingly the number of output lines of the decoder depends on the size
of the IR. For example if the IR is 10 bit then the number of output lines of the
decoder will have 210 or 1024 lines one for each possible instruction.
2.According to the code in the IR only one of the possible 1024 lines will be set to 1,
all the others will be 0 only.
3.The counter is used to keep track of the control steps. Each state or count of this
counter corresponds to one control step. The step decoder provides a separate signal
line for each step, or time slot in a control sequence.
4.The encoder takes inputs from instruction decoder, step decoder, external inputs
and condition codes as shown in the diagram. The required control signals are thus
determined by the following:
6.The input signals to the encoder block in Figure are combined to generate the
individual control signals Y in, PC OUT Add, End, and so on. The output of the control
unit is responsible for indicating the function that needs to be performed (like
addition), selection of the storage units and for selection of data path/data route.
7.If the logic function below is responsible for the generation of the END control
signal End = T7. Add + T6.BR + (T5.N + T4. N¯). BRN + ...
The logic circuit for the above function is shown in Figure 6.
This circuit alone can be used for implementing the End control signal in a hardwired
control unit.
Control Word:A control word is a word whose individual bits represent various
control signals.
A control unit whose binary control variables are stored in memory is known as a
microprogrammed control unit.
In Microprogrammed Control, the control information is stored in the control memory and is
programmed to initiate the required sequence of micro-operations.
By creating a definite collection of signals at each system clock beat, a controller generates the
instructions to be executed. Each of these output signals causes a single micro-operation, such
as register transfer. As a result, defined micro-operations that can be preserved in memory are
formed from the sets of control signals.
Each bit in the microinstruction is connected to a single control signal. The control signal is
active when its bit is set. The control signal becomes inactive when it is cleared. The internal
control memory can store a sequence of these microinstructions. A microprogram-controlled
computer's control unit is a computer within a computer.
Example of micro-instruction:
MAR←R3
Hardwired control unit generates the control Microprogrammed control unit generates
signals needed for the processor using logic the control signals with the help of micro
circuits instructions stored in control memory
Hardwired control unit is faster when compared This is slower than the other as micro
to microprogrammed control unit as the instructions are used for generating
required control signals are generated with the signals here
help of hardwares
Difficult to modify as the control signals that Easy to modify as the modification need
need to be generated are hard wired to be done only at the instruction level
Less costlier than hardwired control as
More costlier as everything has to be realized in
only micro instructions are used for
terms of logic gates
generating control signals
It cannot handle complex instructions as the
It can handle complex instructions
circuit design for it becomes complex
Only limited number of instructions are used Control signals for many instructions can
due to the hardware implementation be generated
Used in computer that makes use of
Used in computer that makes use of Reduced
Complex Instruction Set
Instruction Set Computers(RISC)
Computers(CISC)
A pipeline is the mechanism a RISC processor uses to execute instructions. Using a pipeline
speeds up execution by fetching the next instruction while other instructions are being
decoded and executed.
Fig 1
Execute processes the instruction and writes the result back to a register.
Figure 2. illustrates the pipeline using a simple example. It shows a sequence of three
instructions being fetched, decoded, and executed by the processor. Each instruction takes a
single cycle to complete after the pipeline is filled.
Fig 2
The three instructions are placed into the pipeline sequentially. In the first cycle the core fetches the
ADD instruction from memory. In the second cycle the core fetches the SUB instruction and
decodes the ADD instruction. In the third cycle, both the SUB and ADD instructions are moved
along the pipeline. The ADD instruction is executed, the SUB instruction is decoded, and the CMP
instruction is fetched. This procedure is called filling the pipeline. The pipeline allows the core to
execute an instruction every cycle.
As the pipeline length increases, the amount of work done at each stage is
reduced, which allows the processor to attain a higher operating frequency. This
in turn increases the performance.
Module II
1. I/O Module
I/O Operation
I/O operation are accomplished through a wide assortment of external devices that provide a means
of exchanging the data between the external environment and the computer. Inputs are the signals or
data received by the system and outputs are the signals or data sent from it. The term can also be
used as part of an action; to "perform I/O" is to perform an input or output operation. I/O devices
are used by a human (or other system) to communicate with a computer. For instance, a keyboard or
mouse is an input device for a computer, while monitors and printers are output devices. In
computer architecture, the combination of the CPU and main memory, to which the CPU can read
or write directly using individual instructions, is considered the brain of a computer. Any transfer of
information to or from the CPU/memory combo, for example by reading data from a disk drive, is
considered I/O. An I/O interface is required whenever the I/O device is driven by the processor. The
interface must have necessary logic to interpret the device address generated by the processor. An
external device attaches to the computer by a link to an I/O module as shown in the Figure 1.
The link is used to exchange control, status, and data between the I/O module and the external
device. As shown in the figure with an I/O module. The module actually consists of a few function,
which are:
Control and timing
Processor communication
Device Communication
Data buffering
Error detection
Since I/O operation deals with the exchanges of data between the memory and the external devices
either in the direction to the memory (READ) or in the direction from the memory (WRITE). But
the problem arise on how the processor will manage the flow of data to and from the external
devices in term of transfer speed, processor idle time, complexity and etc.
1. Programmed I/O
With programmed I/O, data are exchanged between the processor and the I/O module. The
processor executes a program that gives it direct control of the I/O operation, including
sensing device status, sending a read or write command, and transferring the data. When the
processor issues a command to the I/O module, it must wait until the I/O operation is
complete.
When the processor wishes read or send a block of data, it issues a command to the DMA
module by sending some information to DMA module. The information includes:
- read or write command, sending through read and write control lines.
- number of words to be read or written, communicated on the data lines and stored in the
data count register.
- starting location in memory to read from or write to, communicated on data lines and stored
in the address register.
- address of the I/O device involved, communicated on the data lines.
1. Evolution of microprocessors