Part 1. Pipelining
AlwaysClean is a Laundromat that has three operations: wash, dry, and iron. It takes 30 minutes to wash one load, 40 minutes to dry one load, and 20 minutes to iron one load.
- How much time will it take to perform 30 loads sequentially, without pipelining?
- How much time will it take with pipelining? Fully explain your calculation. Hint: Draw a diagram to help you analyze the timing.
- Identify a non-computer process that uses pipelining.
Part 2 Memory Location
Suppose A, X, Y, and Z are four computer memory locations that hold different values. Write a simple machine language program to compute A = X + Y – Z.
The computer has two registers (R1 and R2) dedicated to arithmetic operations and only the following operations:
LOAD R, M | copy the value from memory location M (M is one of A, X, Y, or Z) into register R (R is either R1 or R2) |
STORE R, M | copy the value from register R into memory location M |
ADD | add the values of R1 and R2 together and store the result in R1 |
SUB | subtract the value of R2 from R1 and store the result in R1 |
SWAP | exchange the values stored in R1 and R2 |
HALT | stop program execution |
Write a sequence of instructions using only these operations to perform the computation and then stop program execution. Explain your reasoning.