Data Structures Through C Language
Data Structures Through C Language
Computer
instruction
• Instruction encodings
• 1 operand NOT R4 R4 R4
Instruction cycle
Interrupts Enabled
Interrupts Disabled
Fetch, decode
Execute Interrupt
START Next
Instruction Instruction cycle
HALT
Control Unit (CU) - decodes the program instruction in the CIR, selecting
machine resources such as a data source register and a particular
arithmetic operation, and coordinates activation of those resources
19
Copyright@ Amity University
Execution in instruction cycle
• The instruction decoder interprets the instruction.
• Clock pulses
• Timing signals
• Control unit
• Hardwired control
• Microprogrammed control
Copyright@ Amity University
Clock Pulses & Timing Signal
The timings for all registers in the
basic computer is controlled by
master clock generator.
• The functions performed by the control unit vary greatly by the internal
architecture of the CPU, since the control unit really implements this
architecture.
• On a regular processor that executes x86 instructions natively the control unit
performs the tasks of fetching, decoding, managing execution and then storing
results. It manages the translation of x86 instructions to RISC micro-
instructions, manages scheduling the micro-instructions between the various
execution units, and juggles the output from these units to make sure they end
up where they are supposed to go.
• On one of these processors the control unit may be broken into other units
(such as a scheduling unit to handle scheduling and a retirement unit to deal
with results coming from the pipeline) due to the complexity of the job it must
perform.
Copyright@ Amity University
Control Unit
• In the micro-programmed
control, the control
information is stored in a
control memory.
• D0T4: DR M[AR]
• D0T5: AC AC ˆ DR, SC 0
– SC – start counter
Copyright@ Amity University
ADD to AC
• D1T4: DR M[AR]
• D1T5: AC AC + DR, SC 0
• D2T4: DR M[AR]
• D2T5: AC DR, SC 0
Copyright@ Amity University
Store AC
• STA: Store AC.
• D4T4: PC AR, SC 0
Copyright@ Amity University
Branch Unconditionally
• BUN: Branch unconditionally.
• D4T4: PC AR, SC 0
2. D5T5: PC AR, SC 0
– D6T4: DR M[AR]
– D6T5: DR DR + 1
PC PC + 1, SC 0
D5T 5 D6T 5
PC AR DR DR + 1
SC 0
D6T 6
M[AR] DR
If (DR = 0)
then (PC PC + 1)
Copyright@ Amity University SC 0
I/O instructions have as one operand the address of a port in the I/O
address space.
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 person (or other system) to communicate with a computer.
For instance, a keyboard or a mouse may be an input device for a computer, while
monitors and printers are considered output devices for a computer. Devices for
communication between computers, such as modems and network cards, typically
serve for both input and output.
Mouse and keyboards take as input physical movement that the human
user outputs and convert it into signals that a computer can understand.
The output from these devices is input for the computer. Similarly, printers
and monitors take as input signals that a computer outputs. They then
convert these signals into representations that human users can see or
read.
The CPU and its supporting circuitry provide memory-mapped I/O that is
used in low-level computer programming in the implementation of device
drivers.
If different data formats are being exchanged, the interface must be able to convert
serial data to parallel form and vice-versa. There must be provision for
generating interrupts and the corresponding type numbers for further processing by
the processor if required.
A computer that uses memory-mapped I/O accesses hardware by reading and writing
to specific memory locations, using the same assembler language instructions that
computer would normally use to access memory.
Copyright@ Amity University
• In the hardwired the control logic is implemented with gates flip
flops, decoders and other digital circuit.
2. An approach that uses one flip flop per state. While expensive in
terms of flip flops, this method simplifies controller unit design
and debugging.
1. The Model 25 was unique among System/360 models in using the top
16k bytes of core storage to hold the control storage for the micro-program.
2. The Model 85 had separate instruction fetch (I-unit) and execution (E-
unit) to provide high performance. The I-unit is hardware controlled. The E-
unit is micro-programmed; the control words are 108 bits wide on a basic
360/85 and wider if an emulator feature is installed.
Copyright@ Amity University
Control memory is a random access memory (RAM) consisting of
addressable storage registers.
Access to control memory data requires less time than to main memory;
this speeds up CPU operation by reducing the number of memory
references for data storage and retrieval.
Addressing words stored in control memory is via the address select logic
for each of the register groups. There can be up to five register groups in
control memory.
These groups select a register for fetching data for programmed CPU
operation or for maintenance console or equivalent display or storage of
data via a maintenance console or equivalent.
Copyright@ Amity University
During programmed CPU operations, these registers are accessed directly by the
CPU logic.
Some of the registers contained in a control memory that operate in the task and
the executive modes include the following:
•Accumulators
•Indexes
•Monitor clock status indicating registers
•Interrupt data registers
Action by operators:
Timer interrupts:
1. Internal Interrupt
2. External interrupt
3. Software Interrupt
Bus
Copyright@ Amity University
General Register Organization
• CPU must have some working space (fast
access and close to CPU)
l2 MUX
lALU
l3 X 8 Decoder
l1)
MUX A selector
(SELA) : to place the
content of R2 into BUS A
l2)
MUX B selector
(SELB) : to place the
content of R3 into BUS B
l3) ALU operation
selector (OPR) : to
provide the arithmetic
addition R2 + R3
l4)Decoder selector
(SELD) : to transfer the
content of the output bus
into R1
Copyright@ Amity University
Thank You