1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Lyrx [107]
3 years ago
10

Computers spend most of their time in loops, so multiple loop itera- tions are great places to speculatively find more work to k

eep CPU resources busy. Nothing is ever easy, though: the compiler emitted only one copy of that loop's code, so even though multiple iterations are handling distinct data, they will appear to use the same registers. To keep multiple iterations' register usages from colliding, we rename their registers. Figure 3.49 shows example code that we would like our hardware to rename. A compiler could have simply unrolled the loop and used different registers to avoid conflicts, but if we expect our hard- ware to unroll the loop, it must also do the register renaming. How? Assume your hardware has a pool of temporary registers (call them T registers, and assume that there are 64 of them, TO through T63) that it can substitute for those registers des- ignated by the compiler. This rename hardware is indexed by the src (source) register designation, and the value in the table is the T register of the last destina- tion that targeted that register. (Think of these table values as producers, and the src registers are the consumers; it doesn't much matter where the producer puts its result as long as its consumers can find it.) Consider the code sequence in Fig ure 3.49. Every time you see a destination register in the code, substitute the next available T, beginning with T9. Then update all the src registers accordingly, so that true data dependences are maintained. Show the resulting code. (Hint: See Figure 3.50.)
Computers and Technology
1 answer:
fredd [130]3 years ago
7 0

Answer / Explanation:

From the provided Hint in Figure 3.50 and also The baseline performance ( in cycles, per loop iteration) of the code sequence in Figure 2.35 shows that  if no new instruction’s execution could be initiated until the previous instruction’s execution had completed, is 40.

Now, you might ask that how did I come up with that number?

Each instruction requires one clock cycle of execution (a clock cycle in which that instruction, and only that instruction, is occupying the execution units; since every instruction must execute, the loop will take at least that many clock cycles). To that base number, we add the extra latency cycles. Don’t forget the branch shadow cycle.

Therefore, the resulting code would be:

Loop:      LD F2,0(Rx) 1 + 4

               DIVD F8,F2,F01 + 12

               MULTD F2,F6,F2 1 + 5

               LDF4,0(Ry) 1 + 4

               ADDD F4,F0,F4 1 + 1

              ADDD F10,F8,F2 1 + 1

              ADDI Rx,Rx,#8 1

              ADDIRy,Ry,#81

              SDF4,0(Ry) 1 + 1

              SUB R20,R4,Rx 1

              BNZ R20,Loop 1 + 1

Cycle per loop iter 40

You might be interested in
An online supermarket wants to update its item rates during the sales season. They want to show the earlier rates too but with a
cupoosta [38]
Cheaper elements gives a strike through appearence
7 0
3 years ago
Read 2 more answers
Write a program that generates 1,000 random integers between 0 and 9 and displays the count for each number. (Hint: Use a list o
masya89 [10]

Answer:

import random

count0, count1, count2, count3,

count4, count5, count6, count7,

count8, count9, i = [0 for _ in range(11)]

while i < 1000:

   number = random.randint(0,9)

   if number == 0:

       count0 = count0 + 1

   if number == 1:

       count1 = count1 + 1

   if number == 2:

       count2 = count2 + 1

   if number == 3:

       count3 = count3 + 1

   if number == 4:

       count4 = count4 + 1

   if number == 0:

       count5 = count5 + 1

   if number == 6:

       count6 = count6 + 1

   if number == 7:

       count7 = count7 + 1

   if number == 0:

       count8 = count8 + 1

   if number == 9:

       count9 = count9 + 1

   

   i = i+1

print("0's: "+ str(count0) + "\n"+ "1's: "+ str(count1) + "\n"+

"2's: "+ str(count2) + "\n"+ "3's: "+ str(count3) + "\n"+

"4's: "+ str(count4) + "\n"+ "5's: "+ str(count5) + "\n"+

"6's: "+ str(count6) + "\n"+ "7's: "+ str(count7) + "\n"+

"8's: "+ str(count8) + "\n"+ "9's: "+ str(count9) + "\n")

Explanation:

- Initialize variables to hold the count for each number

- Initialize <em>i</em> to control the while loop

- Inside the while loop, check for the numbers and increment the count values when matched.

- Print the result

5 0
2 years ago
How to Ctrl + shift + F4 but in a HP laptop?​
ludmilkaskok [199]

Answer:

Hit the X Button Located on the top right corner or hit Control, Alt, Delete

Explanation:

Hitting the X button will make you exit the whole cite, or hitting Control, Alt, Delet, will make you go to the task bar, in which you can go to the bottom right of that screen and it should say end task

3 0
2 years ago
Read 2 more answers
In 1940, the FCC reserved a set of frequencies in the lower range of the FM radio spectrum for _____ purposes as part of its reg
Monica [59]

Answer:

education purposes

Explanation:

Education institutes make some programs like School of the Air and College of the Air, forums, and discussion tables, in 1940 the FCC reserved a range of the FM radio spectrum for education purposes.

Although FM was unpopular when the FCC moved the FM bandwidth to a higher set of frequencies, and people and consumer stations had to buy new equipment.

5 0
3 years ago
Explain the term criteria when building a query.
Olegator [25]

Answer:

A criteria in query is used to compare to query field values so as to determine whether to include the record that contains each value.

Explanation:

A criteria in query is used to compare to query field values so as to determine whether to include the record that contains each value. Query criteria is used to limit the result from a query retrieving only specific items.

Only when an item matches all the criteria can it be shown as a query results. Query criterias can be simple making use of basic operators and constants while some may be complex, and use functions, special operators,.

5 0
3 years ago
Other questions:
  • Suppose you have two arrays of ints, arr1 and arr2, each containing ints that are sorted in ascending order. Write a static meth
    7·1 answer
  • What is the definition of framerate?
    7·1 answer
  • Janelle went to update the last name for one of her group contacts. She double-clicked on the contact, changed the last name, an
    12·2 answers
  • How hot is to hot for my computer?
    11·2 answers
  • Which of the following is NOT a destination?
    12·2 answers
  • When the atmosphere has too much carbon dioxide in it, the oceans absorb some of it to achieve a new balance. This is an example
    9·2 answers
  • Write a program whose input is two integers and whose output is the two integers swapped. Ex: If the input is: 38 then the outpu
    11·1 answer
  • can you still receive messages on messenger from a person when you deleted the conversation with them? (But not blocked them)
    14·2 answers
  • Write a program to calculate sum of first ten natural numbers​
    13·1 answer
  • While conducting routine maintenance, you discover a network server that needs to
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!