Final Exam, CSCI 312, Fall 2015
- Make sure you answer each question completely and thoughtfully.
- Please make sure your answers are clearly labeled with the question number.
- Please write neatly and make any diagrams as neat as you can. If I can't read it, it is wrong.
- Detail in answers should correspond to the level of the class.
- Point values are listed by each question.
- Machine and Assembly Language
- [1 point] What is machine language
- [1 point] What is assembly language
- [2 points] In classes such as CSCI 125, the instructor frequently states that "Every instruction in assembly language corresponds to an instruction in machine language." Is this true? Why or why not, and give examples.
- Hardware to support Recursion
- [4 points] Describe the instructions and hardware required to support recursion.
- Pipeline Overview
The elements of a MIPS have the following latencies
IF | ID/WB | EX | MEM |
120ps | 40ps | 110ps | 130ps |
- [2 points] Find the cycle time for a single cycle clock.
- [2 points] How much time will this machine require to execute a program with 2x108 instructions?
- [2 points] Find the cycle time for a the clock in a five stage pipeline.
- [2 points] How much time will this machine require to execute a program with 2x108 instructions, assume no data or control hazards?
- Pipeline Hazards
- [6 points] Name and define each of the three types of hazards discussed.
- [2 points] Why do control hazards occur.
- [2 points] How can a compiler mitigate control hazards.
- Data Hazards
- [4 points] Give an example of code which produces a load hazard. Explain (with a timing diagram and written explanation) your example.
- [2 points] Why is it not possible to avoid this hazard with data forwarding.
- Hazard Computation
Assume the latencies from question 3. Further assume an instruction mix as follows:
ALU | Branch | Jump | Load | Store |
45% | 15% | 10% | 20% | 10% |
- [4 points] Assuming all branch and jump instructions incur a two cycle penalty, 50% of the loads incur a two cycle penalty and 40% of ALU instructions incur a 1 cycle penalty, compute the cpi for the machine.
- [4 points] Assume data forwarding eliminates all ALU penalties, that the 20% of loads incur a single cycle penalty and 30% of branches and jumps incur a one cycle penalty. Compute the cpi for this machine.
- [4 Points] Explain how extending a pipeline to include more stages can create problems.
- [6 Points] Programming in assembly language has become more difficult in modern ISAs. Give and explain two examples of how this is true. Explain why this is acceptable.