92fd83a4aa
- Cache average access time for write-back policy - HDD average access time using RPM and head-seek time
11 lines
363 B
Python
Executable File
11 lines
363 B
Python
Executable File
#!/bin/python
|
|
|
|
perchit = float(input("PERCENT HIT? "))
|
|
percw = float(input("PERCENT WRITE? "))
|
|
cacher = int(input("CACHE READ TIME? "))
|
|
cachew = int(input("CACHE WRITE TIME? "))
|
|
memr = int(input("MEM READ TIME? "))
|
|
memw = int(input("MEM WRITE TIME? "))
|
|
|
|
print(perchit*percw*cachew + perchit*(1-percw)*cacher + (1-perchit)*percw*memw + (1-perchit)*(1-percw)*memr)
|