





Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!






October 23, 2007
On my honor, I have neither given nor received unauthorized aid on this examination.
Signature: ______________________________
Problem 1 2 3 4 5 6 7 8 9 Total Points 7 8 26 9 14 5 17 3 11 100 Received
1. Introduction Indicate True/False for the following comments. No explanation is required.
i. [1 pt] The relationship of design and verification complexity growth is linear (X-axis is design complexity, and Y-axis is verification complexity).
True
ii. [1 pt] The loss due to delayed market entry of a product in linearly related to the time delay in entering the market.
False
iii. [1 pt] Adding more designers reduces the design development time.
False / True
iv. [1 pt] Design and verification complexity is increasing exponentially over time.
True
v. [1 pt] Number of application-specific (embedded) processors in the market today is smaller than the number of general-purpose (desktop) processors.
False
vi. [1 pt] The latency improvement rate is almost identical to the bandwidth improvement rate.
False
vii. [1 pt] Power = Energy x Time
False
2. Measuring and Reporting Performance
i. [5 pts] Suppose a program runs in 100 seconds on an enhanced machine. The enhanced machine uses a new multiplier that is 4 times faster compared to the multiplier in the original machine. The multiplication operations take 40 seconds in the enhanced machine (i.e., 40% of the overall time in the enhanced machine). Show how Amdhal’s law (directly or indirectly) can be used to compute the execution time of the program in the original machine?
For original machine: Execution Time of Non-enhanced part is same as the enhanced machine: (100-40)=60 seconds; For multiplier part, it is 4 times slower: Execution Time of multiplier: 4*40=160 seconds;
Total Execution Tile of the program in the original machine: 60+160=220 seconds
iii. [2 pts] What are the hexadecimal values of all misaligned 2-byte data that can be read from the given 32-bit word when stored in big-endian byte order?
ONE 34 56
iv. [2 pts] What are the hexadecimal values of all misaligned 2-byte data that can be read from the given 32-bit word when stored in little-endian byte order?
ONE 56 34
c) An architecture supports 64 registers, and immediate values between 0 and 1023. Assume that the architecture has 32-bit instruction encoding where destination is always register, and both source1 and source2 can be either register or immediate values.
i. [2 pts] What is the maximum number of operation (opcodes) supported by this architecture?
Dest 64 registers 6 bits Src1 10 bits or 6 bits + 1 bit for identification 11 bits Src2 11 bits 16 opcodes (4 bits left)
ii. [2 pts] Suggest a reasonable modification with minimal impact (respects all the constraints in some manner) to this architecture to increase the number of operations (opcodes).
Src1 supports immediate value up to 6 bits Dest 6 bits Src1 6 + 1 bits Src2 11 bits
iii. [2 pts] What would be the maximum number of operations (opcodes) under your suggested modification?
256 opcodes (8 bits)
d) [4 pts] Complete the entries of the table by choosing only one of the three symbols (S1, S2 or S3). Each column should have exactly one S1, one S2 and one S3 symbol. Each entry represents how good or bad an architecture is in terms of the corresponding feature. For example, register-register architecture is good (S1) from code generation point of view.
S1 implies good, simple, small or no variation, S2 implies moderate, S3 implies bad, complex, or large variation
Architecture Type Code Size^ Instruction Encoding^ # of cycles / instruction^ Code Generation Memory-memory S1 S3 S3 S Register-register S3 S1 S1 S Register-memory S2 S2 S2 S
e) [2+1 pts] What are the characteristics of an orthogonal instruction-set design and who benefits from it?
Independence of Register Addressing Mode Operations
Any one of it can use any combination of the other …..
Compiler benefits from it since it easier to generate efficient code.
4. Pipeline Exceptions
i. [3 pts] Define precise and imprecise exceptions.
Precise exceptions: Exceptions are maintained in correct program order i.e., when an exception occur all instructions before the exception-causing instruction will be allowed to complete and all the ones behind (including this one) will be killed from the pipeline.
Imprecise exceptions: When exceptions are not handled in program order e.g., out-of-order exceptions.
ii. [4 pts] Discuss one advantage and one disadvantage for precise and imprecise exceptions.
Advantage: precise – Correct program order
Disadvantage: precise – Costly (low performance), out-of-order execution is not possible.
Advantage: imprecise – Higher performance
Disadvantage: imprecise – May lead to incorrect output/behavior during out-of-order execution.
iii. [2 pts] Suggest one hardware technique to address the disadvantage of the imprecise exception.
Out-of-order exceptions can be handled using in-order graduation/completion buffer (ROB) and exceptions are serviced only during completion.
6. Limits of Instruction-Level Parallelism Assume a perfect (ideal) processor with infinite buffers for storing instructions, infinite registers for storing
values as well as perfect register renaming, infinite issue, perfect caches, perfect branch/jump predictors, and perfect memory alias analysis.
i) [1 pt] What is the best possible ILP that can be achieved using SPEC benchmarks on this perfect processor? In other words, suggest an upper bound such as infinite, 5000, 500, 50 etc.
150
ii) [2+2 pts] Explain your answer for the previous question using quantitative (based on practical considerations such as number of comparisons/computations) as well as qualitative reasons (such as program behavior considerations). For example, if you answered 5000, explain why ILP can not be ‘infinite’ (or vice versa) using both quantitative and qualitative reasons.
Quantitative Infinite issue buffer requires O(n^2) comparisons to just detect any RAW dependency before issuing i.e. it is not possible to do so many comparisons in a clock cycle for issuing one instruction. So the problem of issuing infinite instructions is out of question.
Qualitative RAW is a property of the program. There is no way we can eliminate it which limits the number of instructions that can be issued simultaneously.
7. Branches and Predictors
i. [3 pts] Branch-target buffers (BTB) are used in decode stage (2 cycle penalty if the branch is in buffer and mispredicted; 2 cycle penalty if it is not in buffer and taken; 0 penalty otherwise). Determine the total branch penalty for a BTB based on following observations: a. Prediction accuracy is 80% for the instructions in the buffer. b. Hit rate in the buffer is 90% for branches predicted taken.
Probability (branch in buffer, but actually not taken)=0.90.2=0.18; Probability (branch not in buffer, but actually taken)=0. Penalty=(0.18+0.1)2=0.**
ii. [4 pts] Consider a simple processor with 4 stages: fetch, decode, execute and writeback. Assume that the branch frequencies (as percentages of all instructions) are as follows: conditional branches 20%, and unconditional branches 5%. Furthermore assume that 70% of the conditional branches are taken. Moreover, assume that the unconditional branches are resolved at the decode stage and the conditional branches are resolved at the execute stage. Compute the percentage of pipeline speedup loss due to control hazards.
Control flow type frequency Stalls Conditional (taken) 20%70=14% 2 Conditional (not taken) 20%30%=6% 1 unconditional 5% 1 Pipeline stalls=15%+214%+16%=0. Pipeline speedup=4(1/1.39)=2. Loss=(4-2.88)/4=28%*
iii. [10 pts] Assume a (2,2) correlated branch predictor is used to predict the branch outcomes of the following nested loop for both branches to control i and j loops. Assume that the initial state for all 2-bit predictors of all 4 possible correlations are “weakly-taken” (counter value = 2) and the initial state for the 2-bit correlation is “not-taken” and “not-taken”. Note that, two separate predictors are used for the branches to control i and j loops. Simulate the branch predictions using (2,2) predictors and complete the following entries. for (i=1; i<3; i++) // assume a single branch is used to convert this “for” loop for (j=1; j<3; j++) // assume a single branch is used to convert this “for” loop a[i,j] = b[i,j] + c[i,j]
Iteration i=1^ i=1,j=1^ i=1,j=2^ i=1,j=3^ i=2^ i=2,j=1^ i=2,j=2^ i=2,j=3^ i= Correlation NT-NT NT-NT NT-NT NT-NT NT-T T-NT NT-NT NT-NT NT-T Counter 2 2 1 0 1 1 0 0 0 Outcome NT NT NT T NT NT NT T T Predict T T NT NT T T NT NT NT
There are other possible solutions based on assumptions.
8. [3 pts] Dynamic Scheduling Complete the following table by entering only T (for Tomasulo) or S (for Scoreboard) when that particular dynamic scheduling algorithm is most suitable for the processor architecture. No data forwarding S Best possible performance T Memory references can’t be resolved statically (^) T Small number of programmer-visible registers (^) T Least possible area (transistors) S Too many parallel functional units **T
Converting control dependency to data dependency if
x= cond x: A x’: B
Since reduces control dependency, ILP increases, branch/penalty reduced