The issues boils down to something I call "signal delivery order". When the power changes on a wire, it trickles down the circuit, propagating it's effect down the path. The way this works in my implementation goes something like this:
So the signal is delivered to each component in a specific order, namely the order in which they were connected to the wire.
In the Stepper, there are a bunch of Memory circuits, and 2 wires that toggle the 's' inputs for them. In my signal-delivering algorithm, sometimes a signal gets delivered to the 'i' input before the one destined to the 's' input, and that causes the wrong value to output by 'o'.
In most cases the delivery order doesn't seem to be important, but in the Stepper it turns out it really is. I had to work around this by cheating a bit and forcing these specific signals to be delivered first.
In the end I have a functional Stepper, which can be hooked to a Clock. I also created a Harness, which is like a minimalist motherboard that has all the components of the computer, except for the Instruction circuits, which are not yet implemented. Here is an example of how it is used, using the "Something Useful Revisited" example from the book, pages 103-106:
This will output the (admittedly not so exciting) output:
I also contacted John Clark Scott, the author of "But How Do It Know?" with some questions about the CPU desigg. He was very gracious and answered my questions promptly. Thanks John!



No comments:
Post a Comment