First design for the microcode sequencer. The purpose of the sequencer is to run the micro-code program for the current instruction. Each line of the micro-code program sets the control lines that control the fundamental operation of the CPU.
The current instruction is loaded from the databus into the Instruction Register on the next clock signal (rising edge) by setting control line 1 to 'H'. For reasons that will become clear below only the 6 least significant bits (lsb) are used for the instruction meaning the Juno CPU instruction set can be up to 64 instructions. Hopefully, this is more than enough for a little accumulator CPU.
When a new instruction is loaded into the Instruction Register the Micro Program Counter must also be re-set to zero by setting control line 0 to 'H'.
Each instruction is implemented by a small micro-code program which is stored in the EEPROM. In order to determine the start address for the first line of the instruction's micro-code a simple trick is used. The EEPROM has a 10-bit address therefore the 6 bit Instruction Register forms the 6 most significant bits (msb) of the address and the 4 lsb are formed by the Micro Program Counter i.e. the first line of the micro-code is located at the address '<instruction code>0000'.
Using this approach each micro program can be up to 16 instructions in length. For example the first line of micro code for instruction code 0 is address 0; instruction code 1 starts at address 16; instruction code 2 starts at address 32 etc.
The micro-code is then fetched from memory and sent to the de-multiplexer. As both the EEPROM and de-multiplexer are not synchronised to the clock the output will appear on the control lines immediately. The CPU's logic gates will then respond to the changed control lines and logic will "settle" to stable logic values, before the next clock signal occurs and the next micro-code is executed.
At the next clock signal the Micro Program Counter will increment by 1 and the next line of the micro program will be fetched from the memory. This will repeat until the last line of the micro-code program which will set control line 0 'H' to reset the Micro Program Counter and control line 1 'H' to load the next instruction into the Instruction Register.
The reset input allows the Micro Program Counter to be reset to zero when the CPU is re-set.
Things to do
- Design the Program Counter (PC) circuitry and ensure the next instruction is ready on the databus
NB - I have re-numbered the control lines used by the ALU and will upload a revised design.

No comments:
Post a Comment