Question

In: Physics

Assume you have a superscalar CPU with in-order issue and in-order instructions that uses 8 registers...

Assume you have a superscalar CPU with in-order issue and in-order instructions that uses 8 registers (R0-R7). The usual rules include: up to two instructions can be issued in one cycle; instructions have to complete in the order they are issued; an instruction attempting to write to a register that is being read by any incomplete instruction cannot be issued until the incomplete instruction completes; any instruction attempting to read a register that is being written to by any incomplete instruction cannot be issued until the incomplete instruction retires; no new instructions can be issued in a cycle when instructions are retiring; multiplication/division instructions takes 3 cycles to complete while addition/subtraction instructions take only 2 cycles. Suppose you need to run the following four instructions:

1.      R3 = R1 * R2

2.      R1 = R4 + R5

3.      R5 = R2 + R8

4.      R6 = R1 * R4

Cycle

Instruction #

Decoded

Issued

Retired

1

1

R3 = R1 * R2

1

How many cycles will the CPU take if out-of-order instruction issue and execution is allowed. Use a scoreboard as shown above to illustrate your answer.

Cycle

Instruction #

Decoded

Issued

Retired

1

1

R3 = R1 * R2

1

Solutions

Expert Solution

Let us make the take for the above order of instructions

Cycle Instruction# Decoded Issued Retired
1 1 R3=R1*R2 1 3 cycles
4 2 R1=R4+R5 1 2 cycles
6 3 R5=R2+R8 1 2 cycles
8 4 R6=R1*R4 1 3 cycles

Therefore, cycle 8 + 3 cycles to Retired = 11 cycles is the usual sequence of this order.

If our of order sequence is given,there are two possibilities:

a) the instructions cannot repeat

b) the instructions can repeat

In the case a) above,we will be observing that there are there are going to be same number of cycles of operations but a different cycle of instruction. This meant that we will need same instructions and hence the total sequence will cycle to 11 as well.

In case b) above, we will be observing a whole new order, where we cannot tell exactly which instruction will be replaced by the repetition of which instruction and how many times. However, there is surely information as to what the possibility might be for the number of cycles. If we inspect just one among the addition and one among the multiplication,we could guess the same for the other addition and the multiplication operation. This simplifies our task for discovering the sets of tables for the cycles. However, it is also necessary where we replace the instruction that matters as well.

Cycle Instruction # Decoded Issued Retired
1 1 R3=R1*R2 1 3 cycles
4 1 R3=R1*R2 2 3 cycles
7 3 R5=R2+R8 1 2 cycles
9 4 R6=R1*R4 1 3 cycles

Hence for 3 multiplications and one addition, it takes 9+3=12 cycles

Cycle Instruction # Decoded Issued Retired
1 1 R3=R1*R2 1 3 cycles
4 1 R3=R1*R2 2 3 cycles
7 1 R3=R1*R2 3 3 cycles
10 4 R6=R1*R4 1 3 cycles

Hence for 4 multiplications, it takes 10+3=13 cycles

Thus we see that another possibility of 3 additions+1 multiplication and 4 additions are left over

Cycle Instruction# Decoded Issued Retired
1 2 R1=R4+R5 1 2 cycles
3 2 R1=R4+R5 2 2 cycles
5 3 R5=R2+R8 1 2 cycles
7 4 R6=R1*R4 1 3 cycles

Thus for 3 additions and 1 multiplication operation, we have 7+3=10 cycles of operation

Cycle Instruction # Decoded Issued Retired
1 2 R1=R4+R5 1 2 cycles
3 2 R1=R4+R5 2 2 cycles
5 3 R5=R2+R8 1 2 cycles
7 2 R1=R4+R5 3 2 cycles

Thus for 4 additions,we have 7+2=9 cycles of operation.

So we can clearly tell that an out-of-order instruction can yield an operation of 9,10,12 or 13 cycles whatever possibility of instruction sequence is passed to decode in the ALU of the superscalar CPU.


Related Solutions

1. Assume we have 8 registers, R0~R7, and we have a pipeline of 6 stages: Instruction...
1. Assume we have 8 registers, R0~R7, and we have a pipeline of 6 stages: Instruction Fetch (IF), Instruction Issue (II), Operands Fetch (OF), Execution (EX), Write Back (WB), and Commitment (CO). Each stage needs exactly 1 cycle to finish its work. Also assume that the pipeline supports forwarding, which means the result of WB can be forwarded to OF. Given the following piece of instructions: R1 = R0 + R2 R3 = R4 + R5 R6 = R1 +...
We have to write an Issue Negligence statement. The instructions- " In writing an issue statement...
We have to write an Issue Negligence statement. The instructions- " In writing an issue statement the question should identify the general legal theory linked to a fact which gives rise to the claim. Remember your reply must address the substantive writing not the format. Suggest improvements along with an explanation of why and then offer the improvement by rewriting the issue of the post. If in fact you see no room for improvement identify the parts of it that...
Example: A 3-address computer has 40 instructions, 16 Registers, and 256KB memory. Assume each instruction has...
Example: A 3-address computer has 40 instructions, 16 Registers, and 256KB memory. Assume each instruction has three operands. Two registers and the third operand is a direct address location of a memory. Find minimum size of PC, MAR, MDR, IR. Solution: OPCODE R1, R2, address OPCODE is 6 bits since 2^6>40 Register field is 4 bits since 2^4 =16 Memory field is 18 bits since 2^18=256K Instruction length =6+4+4+18=32 bits MDR=32 bits IR=32 bits MAR=18 PC=18 Please explain
Assume that the registers have the following values (all in hex) and that CS= 1000, DS...
Assume that the registers have the following values (all in hex) and that CS= 1000, DS = 2000, SS=3000, SI=4000, DI = 5000, BX=6080, BP= 7000, AX=25FF, CX=8791, and DX=1299. Calculate the physical address of the memory where the operand is stored and the contents of the memory locations in each of the addressing examples. a) MOV [SI], AL b) MOV [SI+BX+8], AH c) MOV [BX]+300, DX Now Examine the status of the CF, PF, AF, ZF, and SF if...
n the instructions for this Task C, we're going to assume that you have completed your...
n the instructions for this Task C, we're going to assume that you have completed your script for Task B above; i.e. that you have a working dictionary-based version of the functions (originally named addToRecord(), etc. in Task A) now named addToHistogram(), etc. Let's assume that your dictionary-based function (from Task B above) that creates a histogram is named makeHistogram(). You are going to use your makeHistogram() in the following sub-tasks. In fact, you're welcome to include any function you...
instructions- You have to use Python in order to do this Problem Set. 4 Cobb-Douglas Production...
instructions- You have to use Python in order to do this Problem Set. 4 Cobb-Douglas Production Function Suppose a firm uses the following production function Y = z × K0.3 × N 0.7 d , where Y is output, z is TFP, K is capital, and Nd is labor. 1. Set z = 10, K = 5 and plot the production function over the range Nd ∈ [0, 5] 2. Derive this function w.r.t. Nd.Set z = 10, K =...
Assume that you have a sample of n1=8, with the sample mean Xbar1= 49, and a...
Assume that you have a sample of n1=8, with the sample mean Xbar1= 49, and a sample standard deviation of S1=5, and you have an independant sample of n2=16 from another population with a sample mean of Xbar2 = 33 and a sample standard deviation S2=7. part a what is the value of the pooled variance TSTAT test statistic for testing Ho :  μ1=μ2​? part b In finding the critical​ value, how many degrees of freedom are​ there? part c: Using...
Assume XYZ uses a calendar year for financial reporting. The company is authorized to issue 32,500,000...
Assume XYZ uses a calendar year for financial reporting. The company is authorized to issue 32,500,000 shares of $1 par common stock. Listed below is a summary of XYZ’s common stock activities. 2,600,000 780,000 1,625,000 5,005,000 1-Number of common shares issued and outstanding at December 31, 2014 2-Shares issued as a result of a 30% stock dividend on Sept. 1, 2015 3-Shares issued for cash on June 30, 2016 Number of common shares issued and outstanding at December 31, 2016...
Assume XYZ uses a calendar year for financial reporting. The company is authorized to issue 32,500,000...
Assume XYZ uses a calendar year for financial reporting. The company is authorized to issue 32,500,000 shares of $1 par common stock. Listed below is a summary of XYZ’s common stock activities. 2,600,000 780,000 1,625,000 5,005,000 1-Number of common shares issued and outstanding at December 31, 2014 2-Shares issued as a result of a 30% stock dividend on Sept. 1, 2015 3-Shares issued for cash on June 30, 2016 Number of common shares issued and outstanding at December 31, 2016...
Assume that the registers have the following values all in hex and CS=0700, DS=0B00, SS=0A00, SI=A200,...
Assume that the registers have the following values all in hex and CS=0700, DS=0B00, SS=0A00, SI=A200, DI=2C00, AX=A00B, BX=130C, BP=AF09, CX=F1D5 and DX=1055. Calculate the physical address of memory where the operand is stored and show the contents of memory locations in each of the following addressing examples. a) MOV [BX]-10AH, CH b) MOV [BP][DI]+1CH,DX c) MOV [DI+BP-99FH],BX d) MOV [SI+4BH],BL
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT