Basic Computer Organization - Part 03
Basic Computer Organization - Part 03
To actually run the code, the processor then needs to retrieve instructions one by one
from memory so it can run them. This process consists of three stages: fetching the
instruction, decoding the instruction, and executing the instruction - these three steps
are known as the machine cycle. A processor spends all of its time in this cycle,
endlessly retrieving the next instruction, decoding it, and running it.
• Fetch
In the fetch cycle, the control unit looks at the program counter register (PC) to
get the memory address of the next instruction. It then requests this instruction
from main memory and places it in the instruction register (IR).
Page 2 of 8
• Decode
Here, the control unit checks the instruction that is now stored within the
instruction register (IR). It looks at the instruction - which is just a sequence of
0s and 1s and decides what needs to be done. Does the instruction say to add two
numbers? Does it say to load a value from memory? Where in memory? The
control unit interprets the binary instruction to answer questions like these.
• Execute
Now the control unit sends the signals that tell the ALU, memory, and other
components signals to cause them to perform the correct work.
The ALU is a digital circuit that provides arithmetic and logic operations. It is the
fundamental building block of the central processing unit of a computer. A modern CPU
has a very powerful ALU and it is complex in design. In addition to ALU modern CPU
contains a control unit and a set of registers. Most of the operations are performed by
one or more ALU’s, which load data from the input register. Registers are a small
amount of storage available to the CPU. These registers can be accessed very fast. The
control unit tells ALU what operation to perform on the available data. After
calculation/manipulation, the ALU stores the output in an output register.
Page 3 of 8
The CPU can be divided into two sections: the data section and the control section. The
DATA section is also known as the data path.BUS:In early computers “BUS” were
parallel electrical wires with multiple hardware connections. Therefore, a bus is a
communication system that transfers data between components inside a computer, or
between computers. It includes hardware components like wires, optical fibres, etc and
software, including communication protocols. The Registers, ALU, and the
interconnecting BUS are collectively referred to as data paths.
The bus can be dedicated, i.e., it can be used for a single purpose or it can be
multiplexed, i.e., it can be used for multiple purposes. When we would have different
kinds of buses, different types of bus organizations will take place.
Control Unit
Control Unit is the part of the computer’s central processing unit (CPU), which directs
the operation of the processor. It was included as part of the Von Neumann Architecture
by John von Neumann. It is the responsibility of the Control Unit to tell the computer’s
memory, arithmetic/logic unit and input and output devices how to respond to the
instructions that have been sent to the processor. It fetches internal instructions of the
programs from the main memory to the processor instruction register, and based on this
register contents, the control unit generates a control signal that supervises the execution
of these instructions.
A control unit works by receiving input information to which it converts into control
signals, which are then sent to the central processor. The computer’s processor then tells
the attached hardware what operations to perform. The functions that a control unit
performs are dependent on the type of CPU because the architecture of CPU varies from
manufacturer to manufacturer. Examples of devices that require a CU are:
Page 4 of 8
1. It coordinates the sequence of data movements into, out of, and between a
processor’s many sub-units.
2. It interprets instructions.
3. It controls data flow inside the processor.
4. It receives external instructions or commands to which it converts to sequence
of control signals.
5. It controls many execution units(i.e. ALU, data buffers and registers) contained
within a CPU.
6. It also handles multiple tasks, such as fetching, decoding, execution handling and
storing results.
There are two types of control units: Hardwired control unit and Microprogrammable
control unit.
In the Hardwired control unit, the control signals that are important for
instruction execution control are generated by specially designed hardware
logical circuits, in which we can not modify the signal generation method
without physical change of the circuit structure. The operation code of an
instruction contains the basic data for control signal generation. In the
instruction decoder, the operation code is decoded. The instruction decoder
Page 5 of 8
constitutes a set of many decoders that decode different fields of the instruction
opcode.
As a result, few output lines going out from the instruction decoder obtains active
signal values. These output lines are connected to the inputs of the matrix that
generates control signals for executive units of the computer. This matrix
implements logical combinations of the decoded signals from the instruction
opcode with the outputs from the matrix that generates signals representing
consecutive control unit states and with signals coming from the outside of the
processor, e.g. interrupt signals. The matrices are built in a similar way as a
programmable logic arrays.
A number of signals generated by the control signal generator matrix are sent
back to inputs of the next control state generator matrix. This matrix combines
these signals with the timing signals, which are generated by the timing unit based
on the rectangular patterns usually supplied by the quartz generator. When a new
instruction arrives at the control unit, the control units is in the initial state of new
instruction fetching. Instruction decoding allows the control unit enters the first
state relating execution of the new instruction, which lasts as long as the timing
signals and other input signals as flags and state information of the computer
Page 6 of 8
remain unaltered. A change of any of the earlier mentioned signals stimulates the
change of the control unit state.
This causes that a new respective input is generated for the control signal
generator matrix. When an external signal appears, (e.g. an interrupt) the control
unit takes entry into a next control state that is the state concerned with the
reaction to this external signal (e.g. interrupt processing). The values of flags and
state variables of the computer are used to select suitable states for the instruction
execution cycle.
The last states in the cycle are control states that commence fetching the next
instruction of the program: sending the program counter content to the main
memory address buffer register and next, reading the instruction word to the
instruction register of computer. When the ongoing instruction is the stop
instruction that ends program execution, the control unit enters an operating
system state, in which it waits for a next user directive.
The fundamental difference between these unit structures and the structure of
the hardwired control unit is the existence of the control store that is used for
storing words containing encoded control signals mandatory for instruction
execution.
In this, the instruction opcode from the instruction register is sent to the
control store address register. Based on this address, the first
microinstruction of a microprogram that interprets execution of this
instruction is read to the microinstruction register. This microinstruction
contains in its operation part encoded control signals, normally as few bit
fields. In a set microinstruction field decoders, the fields are decoded. The
microinstruction also contains the address of the next microinstruction of
the given instruction microprogram and a control field used to control
activities of the microinstruction address generator.
Page 7 of 8
In this, in a control unit with a two-level control store, besides the control
memory for microinstructions, a nano-instruction memory is included. In
such a control unit, microinstructions do not contain encoded control
signals. The operation part of microinstructions contains the address of
the word in the nano-instruction memory, which contains encoded
control signals. The nano-instruction memory contains all combinations
of control signals that appear in microprograms that interpret the
complete instruction set of a given computer, written once in the form of
nano-instructions.
Page 8 of 8