2. Consider the following assembly code. Assume that initial values of all registers and memory are...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
2. Consider the following assembly code. Assume that initial values of all registers and memory are zero. Assume a five stage pipelined architecture with the following stages: F= fetch, D = decode, X = execute, M = memory access, W = write back. Also assume that registers are written in the first half of the cycle and read in the second half of the cycle and that branches are resolved during decode. There are two types of simplified branch instructions: 1) “beqz rl" means branch if rl is zero, and 2) "bnez rl" means branch if r1 is not zero. Answer parts a and b on the following two pages. In part a, we assume a processor with forwarding. In part b, we assume a processor without forwarding. a) Assume there is forwarding. Fill in the pipeline timing diagram at the bottom showing the execution of the code given below. The first instruction is filled in for you. Show only the first ten instructions executed. [List the instruction number corresponding to your pipeline diagram in the leftmost column. The numbers above each column are provided to help you count cycles.] Fill in write back cycle of each instruction (continued on next page): Instr. No. Instruction Write back cycle rl,r0,5 r2,100 (r1) r2, L2 (1) addi 4 (2) lw (3) (4) beqz sub r7,r2,r3 r5,13 (r2) r2,r5, r2 r2,L3 (5) L1: lw (6) and (7) bnez r6,r3,r2 r6,L1 r2,r6, rl (8) sub (9) L2: bnez (10) L3: or instruction 1 3 4 5 6. 7 8 10 11 12 13 14 15 16 | 17 18 19 (1) F D M W instruction 20 21 22 |23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 b) Assume there is NO forwarding. Fill in the pipeline timing diagram at the bottom showing the execution of the code given below. The first instruction is filled in for you. Show only the first ten instructions executed. [List the instruction number corresponding to your pipeline diagram in the leftmost column. The numbers above each column are provided to help you count cycles.] Fill in write back cycle of each instruction (continued on next page): Instr. No. Instruction Write back cycle addi rl,r0,5 r2,100 (r1) (1) 4 (2) lw r2, L2 r7,r2, r3 r5,13 (r2) r2,r5,r2 r2,L3 (3) beqz (4) sub (5) L1: lw (6) and (7) bnez r6,r3,r2 r6,L1 (8) sub L2: (9) (10) bnez L3: or r2,r6,rl instruction 1 2 4 7 8 9 10 11 12 13 14 15 16 17 18 19 (1) F D X M W instruction 20 |21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 6 2. Consider the following assembly code. Assume that initial values of all registers and memory are zero. Assume a five stage pipelined architecture with the following stages: F= fetch, D = decode, X = execute, M = memory access, W = write back. Also assume that registers are written in the first half of the cycle and read in the second half of the cycle and that branches are resolved during decode. There are two types of simplified branch instructions: 1) “beqz rl" means branch if rl is zero, and 2) "bnez rl" means branch if r1 is not zero. Answer parts a and b on the following two pages. In part a, we assume a processor with forwarding. In part b, we assume a processor without forwarding. a) Assume there is forwarding. Fill in the pipeline timing diagram at the bottom showing the execution of the code given below. The first instruction is filled in for you. Show only the first ten instructions executed. [List the instruction number corresponding to your pipeline diagram in the leftmost column. The numbers above each column are provided to help you count cycles.] Fill in write back cycle of each instruction (continued on next page): Instr. No. Instruction Write back cycle rl,r0,5 r2,100 (r1) r2, L2 (1) addi 4 (2) lw (3) (4) beqz sub r7,r2,r3 r5,13 (r2) r2,r5, r2 r2,L3 (5) L1: lw (6) and (7) bnez r6,r3,r2 r6,L1 r2,r6, rl (8) sub (9) L2: bnez (10) L3: or instruction 1 3 4 5 6. 7 8 10 11 12 13 14 15 16 | 17 18 19 (1) F D M W instruction 20 21 22 |23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 b) Assume there is NO forwarding. Fill in the pipeline timing diagram at the bottom showing the execution of the code given below. The first instruction is filled in for you. Show only the first ten instructions executed. [List the instruction number corresponding to your pipeline diagram in the leftmost column. The numbers above each column are provided to help you count cycles.] Fill in write back cycle of each instruction (continued on next page): Instr. No. Instruction Write back cycle addi rl,r0,5 r2,100 (r1) (1) 4 (2) lw r2, L2 r7,r2, r3 r5,13 (r2) r2,r5,r2 r2,L3 (3) beqz (4) sub (5) L1: lw (6) and (7) bnez r6,r3,r2 r6,L1 (8) sub L2: (9) (10) bnez L3: or r2,r6,rl instruction 1 2 4 7 8 9 10 11 12 13 14 15 16 17 18 19 (1) F D X M W instruction 20 |21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 6
Expert Answer:
Answer rating: 100% (QA)
The generated pipleine diagram is as follows instruction 0 2 3 4 56 78 9 ... View the full answer
Related Book For
Legal Research Analysis and Writing
ISBN: 978-1133591900
3rd edition
Authors: William H. Putman, Jennifer Albright
Posted Date:
Students also viewed these electrical engineering questions
-
Assume a pipeline with four stages: fetch instruction (FI), decode instruction and calculate addresses (DA), fetch operand (FO), and execute (EX). Draw a diagram similar to Figures 12.10 for a...
-
Writting MIPS Assembly code Assume that a list A (array A) of integer numbers (each integer is 4-bytes) have been stored in memory (in consecutive memory locations). MIPS register $s0 holds the base...
-
convert the following assembly code into a highlevel code or pseudocode cpi r17 0 brbs z l1 brbs n l2 ldi r18,3 rjmp l3 l1 ldi r18, 1 rjmp l3 l2 ldi r18,2 l3 rest of the code
-
The two tugboats each exert a constant force F on the boat such that these forces are always directed perpendicular to the boats centerline. If the boat has a mass m and a radius of gyration k G...
-
Suppose a firm has a retention ratio of 40 percent, net income of $17 million, and 10 million shares outstanding. What would be the dividend per share paid out on the firms stock?
-
"A company would normally include a financial projection in its annual report rather than a financial forecast." Comment on the validity of this statement.
-
On November 9, 2011, Dean Foods a Dallas Texas-based food and beverage company, announced that it would write off \($1.6\) billion, net of tax, in goodwill associated with its Fresh Dairy Direct...
-
Lingenfelter Corporation experienced a fire on December 31, 2017, in which its financial records were partially destroyed. It has been able to salvage some of the records and has ascertained the...
-
Suppose we have calculated X = 0.5 and s = 1 from a simple random sample of size n = 40 drawn from a population with mean . Calculate the p value for testing H0 : = 0 against HA : > 0, and carry out...
-
Suppose there's an appliance store that sells refrigerators. It could set its price high and sell very few refrigerators, or it could set its price low and sell many more refrigerators. The following...
-
discuss the challenges and opportunities in regenerative medicine and tissue engineering using embryonic stem cells, induced pluripotent stem cells, and organoid models, including the ethical...
-
The Larisa Company buys machinery on April 1, Year One, for $40,000 with an expected life of ten years and residual value of $10,000. The double-declining balance method is applied along with the...
-
MARS Ltd acquired a business from BARS Ltd in exchange for land having a fair value of $600 000. At the date of acquisition, MARS took control of identifiable assets with a fair value of $840 000,...
-
What is the last step in creating a template out of a device configuration?
-
What are economic, strategic, and emotional factors that prevent companies from leaving an industry?
-
As a result of a slowdown in operations, Tradewind Stores is offering employees who have been terminated a severance package of $91,000 cash paid today; $91,000 to be paid in one year; and an annuity...
-
Over the years, thousands of scores have been collected for the Wechsler Adult Intelligence Scale. Assume that the distribution of these scores is normal, with = 100 and = 15. (Answer A - J) a. What...
-
In Exercises 105108, evaluate each expression without using a calculator. log(ln e)
-
The client is the chairman of the board of directors of an Ohio corporation. The board of directors has decided to merge the corporation with another Ohio corporation. The client wishes to know if...
-
Discuss and describe in detail the steps you should follow when conducting the legal analysis.
-
Facts: The researcher is analyzing a problem involving the sale of goods on credit in state A. Authority: The following authority has been located concerning the problem: 1. State A's Uniform...
-
A cost sheet and partial finished goods ledger card for Leather Originals, a manufacturer of leather furniture, are provided in the Working Papers. Work independently to complete the following...
-
Krasnoy Tire, a maker of tires for cars, trucks, and tractors, is trying to determine how to account for various factory costs. The costs include the following: a. Wages earned by a factory...
-
Wilmington, Inc., manufactures heating systems. The company maintains a materials ledger for all direct materials. Instructions: 1. Prepare a materials ledger card for T-5 thermostats. The thermostat...
Study smarter with the SolutionInn App