Question about Ticks, Tocks, Sequential Logic, and the CPU compare file

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

Question about Ticks, Tocks, Sequential Logic, and the CPU compare file

intelli78
Let's look at the first 5 lines of the CPU compare file:

|time| inM  |  instruction   |reset| outM  |writeM |addre| pc  |DRegiste|
|0+  |     0|0011000000111001|  0  |*******|   0   |    0|    0|      0 |
|1   |     0|0011000000111001|  0  |*******|   0   |12345|    1|      0 |
|1+  |     0|1110110000010000|  0  |*******|   0   |12345|    1|  12345 |
|2   |     0|1110110000010000|  0  |*******|   0   |12345|    2|  12345 |

The D Register is a sequential chip, right? So why isn't its value 0 at t=1+, and only 12345 at t=2? I thought that logic only propagated on the tock.

I must be misunderstanding something, but I'm not sure what. Can anyone explain?
Reply | Threaded
Open this post in threaded view
|

Re: Question about Ticks, Tocks, Sequential Logic, and the CPU compare file

ybakos
In Hack, values latch on the rising edge of the clock cycle, which you will probably feel as the "tick".

The important thing about sequential chips is that values latch and then propogate in a manner that is separated by a full clock cycle.

Reply | Threaded
Open this post in threaded view
|

Re: Question about Ticks, Tocks, Sequential Logic, and the CPU compare file

intelli78
Thank you for the reply. I had misunderstood the sticky in this forum, but you've cleared it up. :)