Professional Documents
Culture Documents
Opcode Rd Rs 1 S2
8 5 5 1 13
PC Relative Mode
Opcode COND Y
8 5 19
Isha Padhy,CSE Dept, CBIT
3 segment Instruction pipeline
The instruction cycle is divided into 3 segments:-
- (I) Instruction fetch: fetches the instruction from program
memory and decoded, the registers needed for execution are also
selected.
- (A) ALU performs the operation depending on the decoded
instruction. There are 3 operations that can be done by ALU.
a. Data manipulation instruction.
b. Evaluate the effective address for a load or store
instruction(register indirect method)
c. Calculates the branch address for a program control instruction.
PC<-PC+Y
- (E) directs the output of the ALU to any 1 destination(destination
register/data memory/ branch address to PC)
Isha Padhy,CSE Dept, CBIT
Delayed Load
• LOAD : R1<- M[address 1]
LOAD: R2<-M[address 2]
ADD: R3<-R1+R2
STORE: M[address 3]<- R3
• For the above instructions to be pipeline: A segment in cycle 4 is using the
data from R2, but the value of R2 is not a correct value as the data is not
transferred from memory at that time. So to solve this problem we can
insert a no- operation instruction between the 2 conflicting instruction such
that a clock cycle is wasted and thus use of data loaded from memory is
delayed.
Steps:
- Divisor is in B, double length dividend
is stored in A and Q.
-Dividend is shifted to left and divisor
is subtracted by adding 2’s
complement value.
- E gives the relative value of B and A.
-If E=1(A>=B), I is inserted in Qn, shift
left, subtract B(2’s comp of B+1)
-If E=0, Qn=0, add B to restore the
value of B, shift left + subtract B.
SC<-SC+1
Continue the process fromIsha
step-1
Padhy,CSE Dept, CBIT
Floating –point arithmetic operations
• Floating point number register consists of 2 parts:
mantissa m and exponent e --- m*re
• A floating point number that has a 0 in the MSB
of the mantissa is said to have an underflow. To
normalize the number it is necessary to shift the
mantissa to the left and decrement the exponent
until a nonzero digit appears in the 1st position.
Ex .00345*105= .345*103
• Register configuration: same as for fixed point
operation. The difference lies in the way
exponents are handled.