Co Unit2 Part1
Co Unit2 Part1
In this lesson, you will learn about Execution of instructions by a processor, the functional units
of a processor and how they are interconnected, hardware for generating control signals and
microprogrammed control and fixed point and floating-point arithmetic for ALU operation
such as adder and subtractor circuits, high-speed adders based on carry-lookahead logic
circuits, the Booth algorithm for multiplication of signed numbers, logic circuits for division
and arithmetic operations on floating-point numbers conforming to the IEEE standard
CONTENTS:
1. Fundamental Concepts
2. Computer Arithmetic
Introduction
REGISTER TRANSFERS
Instruction execution involves a sequence of steps in which data are transferred from
one register to another. For each register, two control-signals are used: Riin & Riout. These
are called Gating Signals. Riin=1 = data on bus is loaded into Ri. Riout=1 as content of Ri is
placed on bus. Riout=0, makes bus can be used for transferring data from other registers.For
example, Move R1, R2; This transfers the contents of register R1 to register R2. This can be
accomplished as follows:
1) Enable the output of registers R1 by setting R1out to 1 (Figure 7.2). This places the contents
of R1 on processor-bus.
2) Enable the input of register R2 by setting R2out to 1. This loads data from processor-bus
into register R4.
All operations and data transfers within the processor take place within time-periods
defined by the processor-clock. The control-signals that govern a particular transfer are
asserted at the start of the clock cycle.
CONTROL-SIGNALS OF MDR
The MDR register has 4 control-signals (Figure). MDRin & MDRout control the
connection to the internal processor data bus & MDRinE & MDRoutE control the connection to
the memory Data bus. MAR register has 2 control-signals. MARin controls the connection to
the internal processor address bus & MARout controls the connection to the memory
address bus.
FETCHING A WORD FROM MEMORY
To fetch instruction/data from memory, processor transfers required address to MAR.
At the same time, processor issues Read signal on control-lines of memory-bus. When
requested-data are received from memory, they are stored in MDR. From MDR, they are
transferred to other registers. The response time of each memory access varies (based on cache
miss, memory-mapped I/O). To accommodate this, MFC is used. (MFC makes Memory
Function Completed). MFC is a signal sent from addressed-device to the processor. MFC
informs the processor that the requested operation has been completed by addressed-device.
Consider the instruction Move (R1),R2. The sequence of steps is (Figure): R1out,
MARin, Read ;desired address is loaded into MAR & Read command is issued. MDRinE,
WMFC; load MDR from memory-bus & Wait for MFC response from memory. MDRout,
R2in; load R2 from MDR where WMFC=control-signal that causes processor's control.
circuitry to wait for arrival of MFC signal.
Storing a Word in Memory
Consider the instruction Move R2,(R1). This requires the following sequence: R1out,
MARin; desired address is loaded into MAR. R2out, MDRin, Write; data to be written are
loaded into MDR & Write command is issued. MDRoutE, WMFC ;load data into memory
location pointed by R1 from MDR.
BRANCHING INSTRUCTIONS
Control sequence for an unconditional branch instruction is as follows: Instruction
execution proceeds as follows:
Step 1-3: The processing starts & the fetch phase ends in step3.
Step 4: The offset-value is extracted from IR by instruction-decoding circuit. Since the
updated value of PC is already available in register Y, the offset X is gated onto the bus, and
an addition operation is performed.
Step 5: The result, which is the branch-address, is loaded into the PC.
The branch instruction loads the branch target address in PC so that PC will fetch the
next instruction from the branch target address. The branch target address is usually obtained
by adding the offset in the contents of PC. The offset X is usually the difference between the
branch target-address and the address immediately following the branch instruction.
In case of conditional branch, we have to check the status of the condition-codes
before loading a new value into the PC. e.g.: Offset-field-of-IRout, Add, Zin, If N=0 then End
If N=0, processor returns to step 1 immediately after step 4. If N=1, step 5 is performed to
load a new value into PC.
As shown in figure, three buses can be used to connect registers and the ALU of the
processor. All general-purpose registers are grouped into a single block called the Register
File. Register-file has 3 ports:
1) Two output-ports allow the contents of 2 different registers to be simultaneously placed on
buses A & B.
2) Third input-port allows data on bus C to be loaded into a third register during the same
clock-cycle.
Buses A and B are used to transfer source-operands to A & B inputs of ALU. The
result is transferred to destination over bus C. Incrementer Unit is used to increment PC by 4.
Instruction execution proceeds as follows:
Step 1: Contents of PC are passed through ALU using R=B control-signal & loaded into MAR
to start memory Read operation. At the same time, PC is incremented by 4.
Step2: Processor waits for MFC signal from memory.
Step3: Processor loads requested-data into MDR, and then transfers them to IR.
Step4: The instruction is decoded and add operation takes place in a single step.
COMPLETE PROCESSOR
This has separate processing-units to deal with integer data and floating-point data.
Integer unit has to process integer data. (Figure). Floating unit has to process floating point