Commands are input on the "Input" section. The first input (Marked with the arrow) is the highest significant bit of the command. (Ie. the one in the below number) 1000
Commands with no arguments. Code - What it does 0000 - No Operation 0010 - Send stop command 1101 - Adds register A & B together and puts the result in C 1110 - Subtracts A and B (A-B) and stores the result in C
Commands that which require an argument take two clock cycles to gather/process the info. For example if I want to load ram slot 2 into register A. I would first use. 1001 - Load ram into register A Then once the clock cycle has completed. I would then use. 0010 - Binary for 2 Another clock cycle should pass and the information from ram slot 2 will be in register A.
The following commands have one argument, this is the constant to load into the register. Code - What it does 0001 - Load constant into register A 0011 - Load constant into register B
The following commands have one argument, this is the position of ram in which to load/store data. Code - What it does 10XX - Load data from ram slot into register XX 01XX - Store register XX into ram slot XX01 - Register A XX10 - Register B XX11 - Register C
Following codes do not work & will probably cause issues. 1000 0100 1100 1111 (A 2 bit decoder here would give an extra 2 commands)
Issues/Notes Ideally you would want some kind of stack to be automatically placing commands onto the processor each clock cycle. I also believe there is an issue when loading data from ram into register C (It sometimes causes ram slot 0 to take incorrect data)
you made me cry after i compared my 5bit calculator with your processor. this pushes the "weird-things-you-can-do-with-powder-toy-level" one step ahead by using a real processor to simulate a artificial processor ... what a waste of energy