Program Counter

The program counter (PC) keeps track of which line of instruction to run next. Luckily the 74LS161 counter singlehandedly takes care of this function of the CPU.

74LS161 4-bit Binary Counter

The chip also allows an initial state to be set with the input pins. Both T and P pins need to be enabled for the counter to run.

The counter was placed to the right of the bus interface, the four outputs tied so the counter value can be uploaded to the bus. The green jumper wire determines the upload enable. The LEDs indicate the counter value as well.

Hooking pin 2 up to the clock, the counter does start counting, overflowing back to zero when 1111 is reached. Now the CPU will run instructions 0 through 15 repeatedly. The usage of a 4-bit counter does mean the largest program this CPU can run is 16 bytes, which is quite small.