一段代码的完整账
运行下面这段程序,填写它打印出来的结果。
STAGES = 5
def one_by_one(n):
return n * STAGES
def pipelined(n):
return n + STAGES - 1
n = 8
hazards = 2
stall = 2
wrong = 3
flush = 3
base = pipelined(n)
extra = hazards * stall + wrong * flush
print(str(base) + "/" + str(extra) + "/" + str(base + extra))
全部评论