While I am thinking about the Memory Addressing Modes, I noticed that that if I am to use Relative Addressing, that is an address relative to the Program Counter, I may need to add a PC Offset Register in the Special Use Register Block. So I had to modify the basic design a little to add this new register.
Special Use Registers
The Special Purpose Registers are a set of different registers that are used for special purposes by the CPU. Other than the General Purpose Registers, they cannot be directly accessed by the ALU or the control logic and are instead accessed via memory access in the memory area between 0x00010
and 0x0001F
.
Program Counter The Program Counter is a 20 bit register that contains the current address that is accessed by the CPU. The Program counter can be increased automatically by 1, 2 or 3. It can also be read and written to. Its control signals are $ PCI $, $ PCWA $, $ CS $, $ WE $ and $ RE $. Stack Pointers The Stack Pointers is a 20 bit register that contains the current address of the Systems Stack. That three Stack Pointers are avaiable allows the use of more advanced programming of the system and mplement such things as Task and Interrupt Pointers. The Stack Pointer can be automatically increased and decreased by 1. It can also be read and written to. Its control signals are $ SPID1 – SPID3 $, $ SPWA1 – SPWA3 $, $ CS $, $ WE $ and $ RE $. PC Offset Register The PC Offset Register is used for relative addressing, where the target address is taken relative to the Program Counter. If used, the contents of this register are automatically added to the Program Counter. Its control signals are $ PCA $, $ CS $, $ WE $ and $ RE $. Index Pointers The Index Pointers are 20 bit registers that contain a memory address that can be used by the CPU for indirect addressing of the main memory. It can be read and written to. Their control signals are $ YWA $, $ ZWA $, $ CS $, $ WE $ and $ RE $. Offset Registers The Offset Registers are 16 bit registers that contain an offset that is automatically added to the corresponding Index Register when the appropriate memory addressing method is selected. Their control signals are $ CS $, $ WE $ and $ RE $. To add to their index registers, the control signal $ ORA $. The selection of the correct Offset Register is done by the $ YWA $ and $ ZWA $ signals.
Possible Implementation
Program Counter Five 74191 synchronous presettable up/down 4-bit binary counter can be used to implement the Program Counter. Stack Counters Five 74191 synchronous presettable up/down 4-bit binary counter can be used to implement the Stack Pointers. PC Offset Register Four 74373 octal latches can be used, in combination with five 74283 4-bit binary full adders can be used, with a single 2:1 multiplexer to select between the adder and the Program Counter Register. Index Pointers Five 74373 octal latches can be used to implement an Index Register. Offset Registers Four 74373 octal latches can be used, in combination with five 74283 4-bit binary full adders can be used, with a single 2:1 multiplexer to select between the adder and the Index Registers.