Module 5: Basic Processing Unit: I) Fundamental Concepts of Processor
Module 5: Basic Processing Unit: I) Fundamental Concepts of Processor
Module 5: Basic Processing Unit: I) Fundamental Concepts of Processor
Processor uses program counter (PC) to store the address of the next instruction, to be fetched for the
execution, after fetching the instruction the contents of the PC is updated to point next instruction in the
sequence .whenever branch instruction is encountered processor will store different value into the PC.
IR[[PC]]
2) Increment PC by 4.
PC [PC] +4
The first 2 steps are referred to as Fetch Phase. Step 3 is referred to as Execution Phase.
NOTE :
when a instruction occupies more than one word then step 1 and step 2 must be repeated as many
times as necessary to fetch the complete instruction.
To study these operations in detail we need to understand internal organization of the Processor.
Basic organization structure of the processor consist of single processor bus, we are using single
processor bus(internal bus) to interconnect internal components of the processor such as Control Unit,
Registers, Arithmetic Logic unit as shown in the below figure 5.1. we can also interconnect external
devices such as memory and I/O devices to the processor using external bus.
Data & address lines of the external memory-bus is connected to the internal processor-bus via MDR &
MAR respectively. (MDR Memory Data Register, MAR Memory Address Register).
▪ MDR has 2 inputs and 2 outputs. Data may be loaded into MDR either from memory-bus
(external) or from processor-bus (internal).
▪ Instruction Decoder & Control Unit is responsible for issuing the control-signals to all the units
inside the processor and implementing the actions specified by the Instruction (loaded in the
IR).
▪ Register R0 through R(n-1) are the Processor Registers.
The programmer can access these registers for general-purpose use. Only processor can access these 3
registers Y, Z & Temp for temporary storage during program-execution,the programmer cannot access
these 3 registers.
▪ ALU takes two operand as input, one Operand A as input gets from the output of the
multiplexer (MUX) and another Operand B as input gets from the operand directly from the
processor-bus and performs the arithmetic and logical type of operation specified in a
instruction.
• There are 2 options provided for operand A as input of the ALU i.e, Multiplexer MUX selects one of
the 2 inputs either output of Register Y or constant-value 4( which is used to increment PC content).
Disadvantage of Single Bus Organization : Only one data item can be transferred over the bus in a
clock cycle, so needs many number of steps.
Solution: Provide multiple internal-paths. Multiple paths allow several data-transfers to take place in
Parallel within in one clock cycle.
1) REGISTER TRANSFERS
Whenever processor wants to execute a instruction it required 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.
▪ R1in=1 data on processor bus is loaded into R1 Register
▪ R1out=1 content of Register R1 is placed on processor bus.
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 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.
The sequence of operations to add content of Register R1 and R2 and storing result in Register R3
[R3][R1]+[R2] is as follows.
• The signals are activated for the duration of the clock cycle corresponding to that step. All other
Signals are inactive.
It consist of four control signals: MDRin and MDRout control the connection to the internal bus, and
MDRin E and MDRoutE control the connection to the external bus.
During memory Read and Write operations, the timing of internal processor operations must be
coordinated with response of the addressed device on the memory bus.
1) R1out, MARin, Read desired address is loaded into MAR & Read command is issued
2) MDRinE, WMFC load MDR from memory bus & Wait for MFC response from memory
3) MDRout, R2in load R2 from MDR
where WMFC=control signal that causes processor's control circuitry to wait for arrival of MFC signal
NOTE:
Each action or step can be completed in only one clock cycle, except step2 which requires one or
more clock cycles, depending on the speed of the addressed device.
Consider the instruction Add (R3),R1 which adds the contents of a memory-location pointed by R3
to register R1. Executing this instruction requires the following actions:
Processor uses these are the sequence of control steps required to perform addition of two given
operands using single bus architecture.
Step 4: Contents of R3 are loaded into MAR & a memory read signal is issued.
Step 6 : When Read operation is completed, memory-operand is available in MDR, and the addition is
performed.
Step 7: Sum is stored in Z, then transferred to R1.The End signal causes a new instruction
fetch cycle to begin by returning to step1.
NOTE: step no 1 to 3 represents fetch phase , it is common to all the instructions .
Step no 4 to 7 represents execution phase.
The offset X used in a branch instruction is usually the difference between the branch target - address and
the address immediately following the branch instruction. (For example, if the branch instruction is at
location 2000 and branch target-address is 2050, then the value of X must be 46, since the PC will be
containing the address 2004 after fetching the instruction at location 2050).
In case of conditional branch, we need to check the status of the condition-codes before loading a
new value into the PC.
Example : 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.
Register File: All the general purpose registers are combined into a single block called as a Register File.
It has 3 ports , Two output-ports allow the contents of 2 different registers to be simultaneously placed
on buses A & B, and 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 and Result is transferred to
destination over bus C.
NOTE: Step number 1 to 3 Represents Fetch Phase and Step number 4 represents Execution Phase ,in
Multiple Bus Organization Execution Phase needs only one control step to complete the
Execution of the instruction
Advantage of Multiple Bus Organization:
It provides multiple paths to transfer data over the bus hence it reduces number of instruction
Execution steps so ultimately processor reduces number of clock cycles needed to execute an a
Instruction.
1) Hardwired control
2) Microprogrammed control.
1) Hardwired control
In this method processor can generate the control-signals using step counter and Decoder/Encoder
circuit .
Step-Decoder : provides a separate signal line for each step or time slot in the control sequence.
Instruction Decoder: The output of the instruction decoder consist of a separate line for each machine
instruction .
• It decodes the instruction loaded in the IR.
• If IR is an 8 bit register, then instruction decoder generates 28(256 lines); one for each
instruction.
• It consists of a separate output-lines INS1 through INSm for each machine instruction.
• According to code in the IR, one of the output-lines INS1 through INSm is set to 1, and all
other lines are set to 0.
In this diagram we are using two special type of control signals to control the execution of each
instruction
1) RUN Control Signal
2) RESET Control Signal
When RUN=1, counter is incremented by 1 at the end of every clock cycle. When RUN=0, counter stops
counting.
After execution of each instruction, end signal is generated. End signal resets step counter, Sequence of
operations carried out by this machine is determined by wiring of logic circuits, hence
the name “hardwired”.
control store(CS): The microroutines for all instructions in the instruction-set of a computer are stored in
The control unit can generate the control signals for any instruction by sequentially reading the control
words of the corresponding micro routine from the control store.
Whenever processor wants to execute an instruction, it fetches the instruction from the memory and loads
into Instruction register for the execution and these instruction address is stored into starting address
generator circuit and in turn it is loaded into micro program counter.
Processor uses content of the micro program counter address of the desired instruction and reads the
control words sequentially from the control store .
The content of the micro program counter is incremented automatically by the clock to fetch next
successive micro instruction in the program.
It cannot handle the situation when the control unit is required to check the status of the condition codes
or external inputs to choose between alternative courses of action . i.e it cannot handle Branching
Instruction.
Solution:
μPC is incremented every time a new microinstruction is fetched from microprogram memory except
in following situations:
1) When a new instruction is loaded into IR, μPC is loaded with starting-address of microroutine
for that instruction.
1) Assigning individual bits to each control-signal results in long microinstructions because the number
of required signals is usually large.
2) Available bit-space is poorly used because only a few bits are set to 1 in any given microinstruction.
2 It is Faster It is slower
3 Control Functions are implemented using Control Functions are implemented using Software
Hardware
4 Difficult to Handle Large or Complex Easy to Handle Large or Complex instruction set
instruction set
5 Not flexible to accommodate new system More flexible to accommodate new system
specifications or new instructions. specifications or new instructions.