Question

Assume the program counter (PC) is initially equal to n. Assume that the word length of...

Assume the program counter (PC) is initially equal to n. Assume that the word length of the processor is 1.

a)      How many fetches are required to make PC equal to m if there are no branch instructions between n and m?

b)      What is the content of the instruction register (IR) when the PC’s value is n+k? Justify your answer.

Why we are not using a hundred pipeline stages if anoperation can be divided up into a hundred steps, even if we can keep the pipeline full?

Assume an operation can be divided into 1, 6, or 24 pipeline stages with no overhead and the pipeline can be kept full.

a. What degree of pipelining would provide the optimal throughput?

b. What is the throughput relative to the un-pipelined version?

What is a pipeline hazard?

Write the assembly language instructions for the following statement d = a - (b + c). Assume d is stored in R0, a in R1, b in R2 and c in R3. Use a minimal number of assembly statements and a minimal number of registers. Remember that instructions are of the following format : Instruction R1, R2, R3 where R1 and R2 are source registers and R3 is a destination register.

How long (in bits) are register ID in a system, which has 16 registers ?

What is altered in CPU when using Branching instructions?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Part a:

Initially the PC is equal to n.

When 1st instruction gets fetched, PC increments by 1 as the word length of the processor is given as 1.

So, PC = PC + 1

i.e PC = n + 1

Now, when 2nd instruction is to be fetched PC again increments by 1 and the new PC value will be n+2.

In other words we can say that for ith instruction to be fetched, the value of PC will be n + i.

So, to get PC = m,

number of instructions to be fetched = current value of PC - initial value of PC

i.e number of instructions to be fetched = m - n

Part b:

As we have seen in part a, initially when the value of PC is initialized to n and the first instruction is to be fetched, the value of PC when the instruction is getting fetched increments by 1 and the instruction that is fetched is nth instruction.

So, in general we can say that the content of the instruction register (IR) will always the instruction previous to the current value of PC.

So, when PC = n + k, the content of instruction register (IR) = PC -1

i.e content of instruction register (IR) = n + k -1.

Add a comment
Know the answer?
Add Answer to:
Assume the program counter (PC) is initially equal to n. Assume that the word length of...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Page 4 3. Pipeline is an instruction-level parallel processing techni microprocessor systems. The instruction throughput can be dramaticallu increased by this key technique. However, there are so...

    Page 4 3. Pipeline is an instruction-level parallel processing techni microprocessor systems. The instruction throughput can be dramaticallu increased by this key technique. However, there are so called hazard problems. (a) Branch instruction will introduce problems to a pipelined instruction execution. Explain how this may happen in a DLX machine, and state ONE strategy that can be used to resolve the problem (6 marks) (b) Data hazards occur in instruction execution in a pipelined machine. () What is meant by...

  • computer analysis

    Questions1.  The function L is defined as L(1) = 2,L(2) = 1,L(3) = 3,L(4) = 4 and for n ≥ 4,L(n + 1) = L(n) + L(n − 1) + L(n − 2)L(n − 3)i.e., the (n + 1)-th value is given by the sum of the n-th, n − 1-th and n − 2-th values divided by the n − 3-th value.(a)  Write an assembly program for computing the k-th value L(k), where k is an integer bigger than...

  • (60 points) The following instructions are executed on the 5-stage MIPS pipelined datapath. add r...

    Computer architecture help: (60 points) The following instructions are executed on the 5-stage MIPS pipelined datapath. add r5,r2, r1 lw r3, 4(r5) lw r2, 0(r2) or r3, r5, r3 sw r3, 0(r5) (a) (20 points) List the data hazards in the above code. For each data hazard identified, clearly mark the source and the destination. For example you can say, there is a data hazard from instruction X to instruction Y on register Z. (b) (20 points) Assume there is...

  • The latencies of individual stages in five-stage MIPS (Microprocessor without Interlocked Pipeline Stages) Architecture are given...

    The latencies of individual stages in five-stage MIPS (Microprocessor without Interlocked Pipeline Stages) Architecture are given below. Instruction Instruction Fetch Register Read Arithmetic Logic Unit (ALU) Memory Access Register Write Latency 200ps 100ps 200ps 300ps 100ps a. (10 pts) What is the clock cycle time in a pipelined and non-pipelined processor? Pipelined version : ______________ Non-pipelined version : ______________ b. The classic five-stage pipeline MIPS architecture is used to execute the code fragments. Assume the followings: Register write is done...

  • The Fibonacci sequence F is defined as F(1) = F(2) = 1 and for n>= 2,...

    The Fibonacci sequence F is defined as F(1) = F(2) = 1 and for n>= 2, F(n + 1) = F(n) + F(n − 1) i.e., the (n + 1)th value is given by the sum of the nth value and the (n − 1)th value. 1. Write an assembly program typical of RISC machines for computing the kth value F(k), where k is a natural number greater than 2 loaded from a memory location M, and storing the result...

  • Assembly code time

    Consider the following assembly language code:I0: add $R4,$R1,$R0                             //ADD R4 = R1 + R0;I1: lw $R1,100($R3)                             //LDW R1 = MEM[R3 + 100];I2: lw $R9,4,($R1)                                // LDW R9 = MEM[R1 + 4];I3: add $R3,$R4,$R9                             //ADD R3 = R4 + R9;I4: lw $R1,0($R3)                                 //LDW R1 = MEM[R3 + 0];I5: sub $R3,$R1,$R4                             //SUB R3 = R1 - R4;I6: and $R9,$R9,$R7                             //AND R9 = R9 & R7;I7: sw $R2,100($R4)                             //STW MEM[R4 + 100] = R2;I8: and $R4,$R2,$R1                             //AND R4 = R2 & R1;I9: add...

  • Ch04.2. [3 points] Consider the following assembly language code: I0: ADD R4 R1RO I1: SUB R9R3 R4...

    Ch04.2. [3 points] Consider the following assembly language code: I0: ADD R4 R1RO I1: SUB R9R3 R4; I2: ADD R4 - R5+R6 I3: LDW R2MEMIR3100]; 14: LDW R2 = MEM [R2 + 0]; 15: STW MEM [R4 + 100] = R3 ; I6: AND R2R2 & R1; 17: BEQ R9R1, Target; I8: AND R9 R9&R1 Consider a pipeline with forwarding, hazard detection, and 1 delay slot for branches. The pipeline is the typical 5-stage IF, ID, EX, MEM, WB MIPS...

  • 9. How are Program Counter (PC), BL, BR and LR related in Procedure? Explain. 10. Assume...

    9. How are Program Counter (PC), BL, BR and LR related in Procedure? Explain. 10. Assume that register X9 had its all bits initially 0, then the following instructions are executed: NOVK X9, 255, LSLO MOVZ X9, 255, LSL 32 ADDI, X9,X9, #255 What would be the contents of X9 after execution of the above instruction? Present the result of X9 in Hexadecimal format.

  • Could you please help me doing this? Slide #14: Slide #15 The question: ARM Assembly Language...

    Could you please help me doing this? Slide #14: Slide #15 The question: ARM Assembly Language label mnemonic operand1, operand2, operand3 comments R2+R1->R3 Loc ADD R3, R2 R1 Label is a symbolic reference to this instruction's address in memory. Mnemonic represents the operation to be performed .The number of operands varies, depending on each specific instruction. Some instructions have no operands at all. operand1 is typically the destination register, and operand2 and operand3 are source operands. operand2 is usually a...

  • Implement the following statements using MS430 assembly instructions. You may use more than one, ...

    Implement the following statements using MS430 assembly instructions. You may use more than one, but you should minimize the number of instructions required. You can use both native and emulated instructions. Use hex notation for all numbers 1. (a) Move the word located in register R14 to R15 (b) Increment the word in R6 by 2. (c) Perform a bitwise ANDing of the word located at address 0x0240 with the datum in R15, placing the results in R15. (d) Rotate...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT