Testing the program counter and the memory system
We designed the program counter in entry 26. Let's hook it up to the address bus and to the memory system to make sure that these two component can interact. This is what I want to test:
- Incrementing the program counter (PC)
- Sending the the value of the PC to the Memory Address Register (MAR) over the address bus
- Updating the PC by sending a new address from RAM to the PC over the data bus.
I also add a new OUT register The purpose of this register is to display the result of whatever operation the computer has performed. I will hook it up like this:
I will use the following four control pins on the PC:
- Count (Count = 1 will increase count when Clock goes high): COUNT
- Write (Write = 1 enables W and puts count on address bus): PCW
- Load (Load = 1 sets the count to the value on the data bus D): PCL
I will also use the Load control pin on the OUT register: OUTL. The memory system was designed in entry 21:
I will use the two S-pins of the two MUX's, AS and DS, to set if we are in "programming mode" (programming RAM with the DIP's) or in "computing mode", where RAM takes address and data from the busses, via MAR and MDR. I will also use the following 5 control pins (and names):
- Load on MAR (Load = 1 loads the address from the address bus, which is then the address seen by RAM if it is in computing mode): MARL.
- Load on RAM (Load = 1 loads the data on D pins into RAM at address A): RAML.
- Write on RAM (Write = 1 writes the data at address A to the buses): RAMW.
Try it out on Wokwi: Project "Testing Program counter with memory system". On Wokwi, you can see which chips that are used and the connections that are made.
Step by step instructions to perform the test:
Let's move on to programming this stupid thing... in the next entry.