程序代写代做代考 chain clock CSE/EEE230 Spring 2020 Exam 3

CSE/EEE230 Spring 2020 Exam 3
The following questions should be answered in full. You will be graded on the correctness and the completeness of your answers.
Save your work as a .pdf file. Only .pdf files will be accepted. Start your file with your full name and class ID. Upload your file using the link on Canvas. Be sure to label your answers with the question number and letter (such as 3.b).
I expect that all of you to be professional and will work independently. All work with be automatically checked for plagiarism. All students with a high percentage of plagiarism will receive a 0 on the exam and will be reported for an academic violation, whether you are the copier or the source, no matter the chain of copying.
Questions
1. 10 points C0E80000 represents a single-precision floating point number (IEEE-754 single-precision). 2 points each
What is the
a. Sign bit 1 (negative)
b. Exponent before biasing (in binary) 00000010 (2)
c. Exponent after biasing (in binary) 10000001 (129)
d. Fraction (in binary) 11010000000000000000000
e. Value in decimal -7.25
2. 5 points What is the value in $t0 after the following if $f5 holds the value 10.5? Give your answer in decimal. Why does this happen?
cvt.w.s $f4, $f5 mfc1 $t0, $f4
Answer 10 (3 points)
Answer In is truncated to an integer (2 points)
3. 20 points
a. How many clock cycles are required to execute a program with 1010 instructions in 15 seconds on a computer with a clock rate of 2.5 GHz? Show your work 5 points
15s = CC / 2.5 GHz
3.75 x 1010 clock cycles
b. How many instructions are executed if a program executes in 10 seconds on processor with a CPI of 2.5 and a clock cycle time of 0.5 ns? Show your work. 5 points
10s = 2.5 x I x 0.5ns I = 8 x 109

¡®
c. Assuming negligible delays except: memory (400ps), ALU and adders (300ps), register file access (200ps). For the single-cycle CPU, how long will the following code take to execute? Support your answer. 5 points
lw $t1, 4($t2) add $t1, $t1, $t1 sw $t1, 4($t2)
clock cycle time = 400 + 200 + 300 + 400 + 200 = 1500ps 3 instructions @ 1500 ps = 4500ps
d. Assuming negligible delays except: memory (400ps), ALU and adders (300ps), register file access (200ps). How long will the following code take to execute on the 5 stage pipelining model? Support your answer. 5 points
lw $t1, 4($t2) add $t1, $t1, $t1 sw $t1, 4($t2)
Clock cycle time = 400 ps
7 cycles @ 400ps = 2800 ps
4. (25 points) Use the single cycle diagram to answer the following. 2.5 points each
a. The shift left 2 is required for which instruction(s)? beq
b. If RegDst = 1 for the lw instruction, what will happen? Wrong register is loaded
c. Are the registers always read? Why? Always read, result used later
d. Why are there adders in addition to the ALU? Can¡¯t the ALU all do the work? ALU is busy in
the single cycle
e. Is the sign extend always done or is it only for some instructions? Always done
f. If RegDst = 1 for an r-type instruction, what will be the result? There is no problem
g. What is the CPI for the single cycle? 1
h. What is the and gate used for? Branch instruction
i. What is the input to determine the control? opcode
j. What does RegDest determine? Which register is written to
5. (25 points) Use the pipeline diagram to answer the following. 2.5 points each
a. In what stage is the control determined? ID
b. In what stage is RegWrite used? WB
c. What are the internal registers used for? Carry information from one stage to the nest
d. If there are no stalls (delays), how many clock cycles are required for each instruction? 5 cycles
e. If there are a large number of instructions, what is the CPI for the pipeline model? 1
f. Pipelining decreases the execution time for a single instruction. True or false? false
g. On the resource diagram, what does the shading on the left of a symbol indicate? write
h. Does pipelining improve latency or throughput? Why? Throughput as instructions are
executed currently
i. What type of hazards can occur? Structure, data and control
j. Why is the control not the same for all stages? Some control lines are needed for each stage

7. (15 points) Use the following code for this problem.
a.
Give the addressing mode of each instruction. 5 points
Add register Bne pc-relative Addi immediate Lw base
J pseudo direct
Answer the questions about the code above. 10 points
1. What is the value of the label ¡°top¡±? 0x00400104
2. What is the 26 bit value in the j instruction? Give your answer in hexadecimal. 0x0100041
3. What is the value of the PC when the bne instruction is executed? 0x00400108
4. What value is added to the PC if the bne instruction branch is taken? 8
5. What is the immediate value in the 16 bit field of the bne instruction? 2
Address
0x00400100
add
$t0, $t1, $t2
top:
bne
$s1, $s2, end
addi
$s1, $s1, -1
lw
$s2, 12($t0)
end:
j
top
b.