STRING CPU 2000
0 Stars     89 Views    

Author: SJP4

Project access type: Public

Description:

There is now string CPU 2000 series. This is the string CPU 2000. There has been a very major change since the 1000 series. I have added a custom ALU instead of using the one in CircuitVerse (there's still a regular ALU used to compare). this ALU supports multiplication, addition, subtraction, shifting binary values, and comparing with <,>, and =.  Please read before programming this CPU. 

CPU instructions

/0. NOP- no instruction at this address

/1. wait for input - stops PC until an input (other than zero) value is detected through DI 

/2. output ANS - output ALU ANS 

/3. output loaded - output loaded data from RAM

/4. output input - output value in DI register

/5. jump if input= - skip to different part of program if a certain value is detected in DI (address can be selected by setting the value in the "addresses" stepper)

/6. jump if ANS= - same as 5 but for ANS

/7. jump if loaded= - also same as 5 but for loaded

/8. jump - like 5, but the skipping is unconditional 

/9. output PRGM - output the value from the 'Values" section in the program EEPROM (make sure you have the program value at the same time as the instruction)

/10. load - load a value from RAM (make sure you have your address from the "addresses" section at the same time as the instruction)

/11. save ANS - save ALU ANS to RAM (make sure you have your address from the "addresses" section at the same time as the instruction)

/12. save input - save value in DI to RAM (make sure you have your address from the "addresses" section at the same time as the instruction)

/13. reset PC - resets the PC

/14. Set ALU operation - sets ALU CTR (set ALU CTR by using "values" section at the same time as instruction Value= OPCODE value)

/15. Jump if input> - jumps if input is > than program value (make sure you have the instruction, address, and value at the same time.)

/16. Jump if input< - same as 15, but <

/17. Jump if ANS> - same as 15, but for ALU ANS

/18. Jump if ANS< - same as 16, but for ALU ANS

/19. Jump if loaded> - same as 15, but for loaded

/20. Jump if loaded< - same as 16, but for loaded

/21. wait for input= - waits for a certain DI value (DI register doesn't save)

/22. Set PRGM to A - sets program value to ALU input A (have your value from "Values" section as same time as instruction)

/23. Set PRGM to B - same as 22, but for ALU input B

/24. save PRGM - saves program value to RAM (make sure you have the instruction, address, and value at the same time.)

/25. Reset A - resets ALU input A

/26. Reset B - resets ALU input B

/27. Reset operation - resets ALU CTR

/28. Reset loaded - clears loaded data in loaded register

/29. Reset input - clears value in DI register

/30. Reset output - clears value in output register

/31. Reset ANS - clears data in ALU ANS register

/32. Reset All REG - clears data in all registers in CPU

/33. reset RAM - clears all data in RAM

/34. Reset system - clears all data off RAM and registers

/35. set input to A - sets value in DI register to ALU input A

/36. set input to B - same as 35, but for ALU input B

/37. set loaded to A - sets loaded value to ALU input A

/38. set loaded to B - same as 37, but for ALU input B

/39. set ANS to A - sets ALU ANS to ALU input A

/40. set ANS to B - same as 39, but for ALU input B

/41. submit ANS - submits ANS to ANS register (make sure you use this instruction before clearing ALU inputs otherwise the ANS will be lost)

/42. jump if carry - same as 5, but if ALU COUT = 1

ALU operations:

0. AND

1. SUB

2. ADD

3. MULT

4. SHIFT RIGHT

5. SHIFT LEFT

6. A<B

7. A>B

8. A=B

There is a programming machine that you can connect an empty EEPROM (make sure bit width is 32 and address width is 10 and don't ever use ram for programming!!!). make sure that your program is starting at EEPROM address 2 and increase the EEPROM address by one every instruction you write to EEPROM otherwise you are essentially constantly overriding instructions!

Created: Jun 15, 2023

Updated: Jul 28, 2023


Comments

You must login before you can post a comment.