CPU – first tick output - PC & ARegister in Screen GUI

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

CPU – first tick output - PC & ARegister in Screen GUI

gs99
This post was updated on .
First instruction:
set instruction %B0011000000111001, // @12345
tick, output;
At this point, Combinational chips have processed, but not Sequential chips, correct?

Why does Hardware Simulator (View: Screen) show PC: 1?
Since "pc" is the name of a CPU output, does this value 1 reflect the output of PC chip?  
The PC in chapter 3 did not advance to 1 until tock,output;

And the A register shows 12345.
What part of A register does this reflect?


Edited 2/26: Add "PC & ARegister in Screen GUI" to Subject.
Change from: Simulator (Animate: Program flow)
to: Simulator (View: Screen)
Reply | Threaded
Open this post in threaded view
|

Re: CPU – first tick output

cadet1620
Administrator
This is supposition on my part, derived from experimenting with the Hardware Simulator.

The PC GUI element and the PC[] value in the .out file appear to show the stored state of the built-in PC component. Likewise for the other built-in clocked components with GUI: ARegister, DRegister, RAM16K, Screen.

When the clock "ticks" the internal stored state is updated based on the inputs. However, there is no signal propagation simulated as a part of tick. This means that the output pin "pc" that is connected to PC's "out" pin does not show the new value yet.

When the clock "tocks" signal propagation is simulated and all values shown are again in agreement.

In the .out file, lines for time N+ show the new value for clocked components with GUI and the old value for wires and pins.

--Mark
Reply | Threaded
Open this post in threaded view
|

Re: CPU – first tick output

gs99
The PC GUI element and the PC[] value in the .out file appear to show the stored state of the built-in PC component.
\1 A problem: These two do not show the same value on my computer after the first tick.
After clicking Single Step on “tick, output;”:
View Screen shows PC: 1
View Output shows pc 0
How do they appear on your computer?

\2 As a reminder, are these statements correct?
When I click on “tick, output;”, Combinational parts are updated.
When I click on “tock, output;”, Sequential parts are updated.

\3 By “stored state”, do you mean the value of a register after its output has been changed?
For example, initially PC.out = 0; therefore CPU.pc = 0.
In my hdl, PC.inc has a value of 1.
After clicking on “tock, output;”, PC.out changes to 1; therefore CPU.pc = 1.
This should not occur after “tick, output;” is clicked. Is that correct?

If yes, the PC GUI element is not at this point showing the current value of chip PC.out (see \1).
The PC[] value in the .out file is correct.