I was playing around when one day I thought a bitmath (logic gate) processor in MC is possible. I have created a theory of combining logic gates together to probably the point where you can add in it. I managed to create a basic theoretical layout using logic gates and registers, along with an example of simulating an XNOR by ORing AND and NOR.
1. Controlling the system
There will be 4 rows of inputs when calculating. These rows will be numbered like so:
Function - 000
Register to use for input A - 0000
Register to use for input B - 0000
Register to output to - 0000
All of these are levers, so this will be addressed in binary.
2. Function calls
Each 3-bit binary number under function (excluding 000) calls a certain logic gate.
AND - 001
OR - 010
NOT - 011
NAND - 100
NOR - 101
XOR - 110
XNOR - 111
3. Register layout
The layout of the registers is important. Note that I didn't add a normal A and B input in the inputs for this. I (attempted to) make this as low-level as possible. You will use 1-0 inputs for your system using always registers. The layout is in the spoiler below.
Always 0 - 0000
Always 1 - 0001
GP reg - 0010 to 1011
LAMP reg - 1100 to 1111
4. 1 XNOR 1 example
This is slow and hard to code. This is just a theory for combining logic gates digitally using a program. I am going to prove that you can combine gates together for larger purposes. In this example program, I will be doing 1 XNOR 1 using smaller gates then ORing them together. Each set of 4 lines is the state of the levers based on the inputs. 1 meaning on and 0 meaning off.
001 - AND
0001 - Always 1 reg
0001 - Always 1 reg
0010 - GP reg 0010
101 - NOR
0001 - Always 1 reg
0001 - Always 1 reg
0011 - GP reg 0011
010 - OR
0010 - GP reg 0010 (result of AND)
0011 - GP reg 0011 (result of NOR)
1100 - LAMP reg 1100
Yupp, I planned on building something similar, but I never had time to do it, when you finish it, please let me know
I'm too terrible at this to actually make it. I dunno how to do half the stuff I am saying, but seeing the instruction sets for MC cpu's that I see work, this is 100% possible.
1. Controlling the system
There will be 4 rows of inputs when calculating. These rows will be numbered like so:
Function - 000
Register to use for input A - 0000
Register to use for input B - 0000
Register to output to - 0000
All of these are levers, so this will be addressed in binary.
2. Function calls
Each 3-bit binary number under function (excluding 000) calls a certain logic gate.
AND - 001
OR - 010
NOT - 011
NAND - 100
NOR - 101
XOR - 110
XNOR - 111
3. Register layout
The layout of the registers is important. Note that I didn't add a normal A and B input in the inputs for this. I (attempted to) make this as low-level as possible. You will use 1-0 inputs for your system using always registers. The layout is in the spoiler below.
Always 0 - 0000
Always 1 - 0001
GP reg - 0010 to 1011
LAMP reg - 1100 to 1111
4. 1 XNOR 1 example
This is slow and hard to code. This is just a theory for combining logic gates digitally using a program. I am going to prove that you can combine gates together for larger purposes. In this example program, I will be doing 1 XNOR 1 using smaller gates then ORing them together. Each set of 4 lines is the state of the levers based on the inputs. 1 meaning on and 0 meaning off.
001 - AND
0001 - Always 1 reg
0001 - Always 1 reg
0010 - GP reg 0010
101 - NOR
0001 - Always 1 reg
0001 - Always 1 reg
0011 - GP reg 0011
010 - OR
0010 - GP reg 0010 (result of AND)
0011 - GP reg 0011 (result of NOR)
1100 - LAMP reg 1100
I'm too terrible at this to actually make it. I dunno how to do half the stuff I am saying, but seeing the instruction sets for MC cpu's that I see work, this is 100% possible.