PC & Memory

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

PC & Memory

kalu
The PC output is connected to ROM input and ROM output is connected to instruction. Then why getting previous instruction in tick phase of clock for the same value of PC.
Reply | Threaded
Open this post in threaded view
|

Re: PC & Memory

WBahn
Administrator
This post was updated on .
I wish the authors kept the whole tick-tock thing as secret sauce -- or, if not, went to the effort to make it map to what you would expect to see in a real system, which means that they would have to describe that real system in more detail than they do.

For purposes of implementing the simulator, they chose to break each clock cycle into two smaller events so that they fetch values from register and memory locations and then calculate the values that will be written to register and memory locations.

One way to think of it -- though it's not a perfect match to what they are doing in the simulator -- is that they are capturing the state of the signals twice per clock cycle -- once at the rising edge of the clock and once at the falling edge. One captures the values of the sequential components, which change with the rising clock edge, while the other captures the values associated with all of the combinatorial operations that will then be loaded into the registers on the next rising clock edge.