Design Question

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

Design Question

Warren Toomey
The overall design of the hack CPU is elegant, and a great example of good pedagogy. There is just one design aspect which I can't figure out. The Program Counter has two separate control lines: load and incr. I sort of think they are mutually exclusive: if we are loading the PC with a new value (i.e. a jump), then incr will be off, and if we are not loading a new value, we will be incrementing.

Could the design of the PC be changed to keep just one of these lines, e.g. just incr?
Reply | Threaded
Open this post in threaded view
|

Re: Design Question

Noam
The idea was to define a "general" program counter that makes sense on its own, not just as part of the whole CPU.  This generality does not increase the difficulty of implementation or of understanding (I think), so it comes "for free" even though it is not used in the book.
Reply | Threaded
Open this post in threaded view
|

Re: Design Question

Warren Toomey
Good point, and thanks for the reply! That extra line had me puzzled.