•jgz Sn,Tag
This instruction jumps to address Tag (this can be a valid address tag in the program) only if the content of Sn is greater than zero. Of course the comparison needed is made in the ALU. (execution cycle), and the PC update happens in the MEM stage (as with the jnez instruction).

•jmp Tag
This is called an unconditional jump. This instruction jumps to Tag (a valid address tag in the program). The PC is updated immediately at the IF step of the instruction (in contrast to conditional jumps) since there is no decision needed to be made.

• div Sn, Sk, Sl
This instruction devides the content of Sk with the content of Sl and stores the result in Sn. The pipelining of this instruction is similar to add, mul, sub but now we have division in the ALU.

a. Supposing that in the beginning of the execution of the program below S2 and S5 have value 50, give me the state of the machine during the execution of this program (register file, program counter and your assumptions for the memory contents when needed) for the first 2 executions of the loop. (Hint: I don’t want the pipelining here. Just show the changes in the register file, program counter and the memory after each instruction. Assume time = 0 before every instruction has been executed, time = 1 after the execution of the first instruction, etc. You can choose the values that are included in the memory addresses that are being read)

Start ld S1, 100(S2)
ld S3, 200(S2)
sub S4, S1, S3
sub S2, S2, 1
jgz S4, Division

Back jnez S2, Start
jmp Exit Division div S4, 1, S4
st S4,500(S5)
sub S5,S5,1
jmp Back

b. What does this program do? I don’t want you to write down all the snapshots but
just describe the result of the whole execution in 4 − 5 lines

c. Show the pipelining of the program without forwarding, until the first instruction of the second repetition. Assume that the numbers are such that the jump to Division
(jgz S4, Division ) is always happening. How many cycles does the program need in total (after 50 executions). How much faster is pipelined execution than not pipelined execution?

d. The same with c but now assume that the jump to Division is never happening.

e. Show the pipelining of the program with all possible forwardings. How many cycles does the program take now? How much faster is pipelined execution with forwarding than pipelined execution without forwarding? Assume that the jump to division is always happening.

f. The same with e but now assume that the jump to Division is never happening.

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

a. Assume memory location 100(S2) = 10 and 200(S2) = 4
Time 0, S2 and S5 = 50
Time 1, LD S1, 100(S2), S1 = 10, S2 = S5 = 50
Time 2, LD S3, 200(S2), S1= 10, S3=4, S2=S5=50
Time 3, sub S4, S1, S3, S1 = 10, S2=S5=50, S3 = 4, S4 = 6
Time 4, sub S2, S2, S1, S1=10, S2 = 49, S3 = 4, S4 = 6, S5=50
Time 5, jgz S4, Divison, no changes to memory or registers...

By purchasing this solution you'll be able to access the following files:

50% discount

$20.00 $10.00
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Systems Architecture Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Upload a file
Continue without uploading

We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats