Docsity

Sample Final Exam Problems | Advanced Computer Architecture | ECE 6100, Exams of Computer Architecture and Organization

Toggle sidebar
bg1
ECE 6100 Advanced Computer Architecture Sample Final Exam Problems
1
Problem 1 (3 parts, 20points) Pipelining Speedup
Suppose a program running on a RISC machine performs 16,000,000 instructions during its
execution. The total time it takes to execute an instruction is 200 ns, independent of the clock
cycle time. The total amount of work that needs to be performed on each instruction is infinitely
divisible, so there may be any number of pipeline stages.
1a) [6 points] Complete the table below by computing the stage time, total execution time, and
speedup (relative to the non-pipelined case) for the different pipelining depths. Ignore all
hazards (i.e., assume ideal pipelining for this part). Neglect stage time increases caused by
pipeline register delays, etc., for this part.
Pipeline Depth Stage time Total Execution Time Pipeline Speedup
1 200 ns 3.2 sec 1
2
4
8
1b) [6 points] Now suppose pipelining register delays and processor control overhead adds 10
ns to the latency of each pipeline stage. (So, for example, if there are four pipeline stages, each
instruction will have an execution latency of 240 ns and the pipelined machine produces 1
instruction every 60 ns.) What is the maximum speedup that can be obtained through
pipelining? Assume there are no hazards (ideal pipelining).
Maximum Speedup: __________________________________________________
pf3
pf4
pf5

Partial preview of the text

Download Sample Final Exam Problems | Advanced Computer Architecture | ECE 6100 and more Exams Computer Architecture and Organization in PDF only on Docsity!

Problem 1 (3 parts, 20points) Pipelining Speedup

Suppose a program running on a RISC machine performs 16,000,000 instructions during its execution. The total time it takes to execute an instruction is 200 ns, independent of the clock cycle time. The total amount of work that needs to be performed on each instruction is infinitely divisible, so there may be any number of pipeline stages.

1a) [6 points] Complete the table below by computing the stage time, total execution time, and speedup (relative to the non-pipelined case) for the different pipelining depths. Ignore all hazards (i.e., assume ideal pipelining for this part). Neglect stage time increases caused by pipeline register delays, etc., for this part.

Pipeline Depth Stage time Total Execution Time Pipeline Speedup 1 200 ns 3.2 sec 1

2

4

8

1b) [6 points] Now suppose pipelining register delays and processor control overhead adds 10 ns to the latency of each pipeline stage. (So, for example, if there are four pipeline stages, each instruction will have an execution latency of 240 ns and the pipelined machine produces 1 instruction every 60 ns.) What is the maximum speedup that can be obtained through pipelining? Assume there are no hazards (ideal pipelining).

Maximum Speedup: __________________________________________________

1c) [8 points] Now take into account stalls caused by hazards in the pipeline. Complete the table below using the average stall cycles per instruction listed for each pipeline depth. Ignore stage time increases caused by pipeline register delays, control overhead, etc., for this part.

Pipeline Depth Average # Stall Cycles/Instruction

Stage Time Total Execution Time Pipeline Speedup

1 0.0 200 ns 3.2 sec 1

2 0.

Problem 3 (2 parts, 15 points) The Hazards of Multi-cycle Functional Units

Consider the following program fragment executing on a basic 5-stage DLX pipeline with all stages taking 1 cycle, except the Execute stage, which takes a variable number of cycles, depending on the functional unit used:

Functional unit Number of EX cycles Integer ALU 1 Floating Point Add 5 Floating Point Load/Store 2 Floating Point Multiply 3

Assume registers are written in the first half of the clock cycle and read in the second half.

3a) [9 points] Suppose the instructions enter the pipeline in order, with a new instruction starting on each cycle. (That is, assume there is no hazard detection mechanism being used and no stalls are introduced to avoid hazards.) Determine which data hazards occur in executing this program fragment. Indicate the hazards as in the following example: if there is a WAR (anti- dependence) hazard between instructions 3 and 4, involving register F8, and 3 precedes 4, put โ€œ3(F8)โ€ in the WAR column to the right of instruction 4. An instruction may cause more than one hazard. Assume there are no instructions previous to instruction 1.

Instruction RAW (true) WAR (anti) WAW (output) 1: SUBF F1, F2, F 2: ADDF F1, F4, F 3: MULTF F6, F3, F 4: SF 100(R1), F 5: LF F1, 0(R1) 6: ADDF F2, F1, F

3b) [6 points] In this part, assume there is no forwarding hardware. If the instructions are executed in order, determine how many stall cycles are required for each instruction (i.e., how many bubbles must be inserted BEFORE each instruction to avoid all data hazards).

Instruction Number of Stalls

1: SUBF F1, F2, F

2: ADDF F1, F4, F

3: MULTF F6, F3, F

4: SF 100(R1), F

5: LF F1, 0(R1)

6: ADDF F2, F1, F

Problem 4 (4 parts, 20 points) Disk Technology

Suppose we have a magnetic disk with the following parameters.

Controller overhead 3 ms Average seek time 10 ms Rotation rate 5400 revolutions/minute Transfer rate 2.88 MB/second

sectors per track 32 sectors/track

Sector size 1 KByte

4a) [5 points] What is the average time to read or write a single sector? (show work)

ms

4b) [5 points] What is the average time to read or write 16 KB in 16 consecutive sectors in the same cylinder? (show work)

ms

4c) [5 points] What is the average time to read or write an entire track (32 consecutive Kbytes)? Assume sectors can be read or written in any order. (show work)

ms

4d) [5 points] Now suppose we have an array of 8 of these magnetic disks. The disks are synchronized so that the arms on all the disks are always over the same track and the same sector within the track. The data is striped across the disks in the array so that 8 consecutive sectors can be read in parallel. What is the average time to read or write 16 consecutive KB in the disk array system? (show work)

ms