把简化掉的东西加回来
运行下面这段程序,填写它打印出来的结果。
STAGES = 5
FLUSH = 3
def pipelined(n):
return n + STAGES - 1
def wrong_guesses(pattern):
last = -1
wrong = 0
for t in pattern:
if last == -1 or t != last:
wrong = wrong + 1
last = t
return wrong
base = pipelined(16)
branch = 16 * FLUSH
cache_miss = 16 * 4
print(str(base) + "/" + str(base + branch) + "/"
+ str(base + branch + cache_miss))
全部评论