Nit-picking about the program counter

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

Nit-picking about the program counter

John Rohde Jensen
I've implemented the whole computer and have had a great time. I'm a bit puzzled by the interface and the testscript for the program counter (pc) though.

In my cpu implementation the inc input is hardwired to true since the pc always should increase unless it's jumping or reseting. So what is the point of having that input pin?

Second, it is my understanding that the pc should change with every single clockcycle. Therefore I should be able to hardwire the load pin of the register to true. Unfortunately the testscript doesn't quite share my understanding and forces me to add some extra logic here.

My claim is that a tightning up of testscript and compare file would allow a good deal of simplification of the pc.


/John
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Nit-picking about the program counter

John Rohde Jensen
Never mind. The questions were answered two years ago over in the chapter 5 discussion.

But on the positive side, I were sorta right :-)


/John
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Nit-picking about the program counter

cadet1620
Administrator
John Rohde Jensen wrote
Never mind. The questions were answered two years ago over in the chapter 5 discussion.
This is the post John is referring to: Design Question.

Here's an example of when you might want to hold the address during a clock cycle.

I made a modification to the Hack CPU to allow it to read data from the ROM. It works by adding an extra cycle to instruction execution whenever a ROM address needs to be read. The first cycle reads the instruction from ROM and the second cycle reads the data from ROM. The PC must remain the same for both execution cycles when this happens.

--Mark
Loading...