題目一
假設有一個五階的管線結構:IF(Instruction fetch)、ID(Instruction decode and register file read)、EXE(Execution or address calculation)、MEM (Memory access)、WB (Write back),該結構除了LW和SW到記憶體存取需2週期,以及BNZ需多1週期外,其餘運算(operation)皆為1個週期;該管線結構並没有前饋(forwarding)。有以下程式碼在管線中執行: