Espeer5 / Trinary

A ternary ALU simulation
https://espeer5.github.io/Trinary/
MIT License
2 stars 0 forks source link

Standardize Device Interface #9

Closed Espeer5 closed 1 year ago

Espeer5 commented 1 year ago

I think that every type of device installed in the machine should have a standard interface inheriting from a superclass which describes a device. i.e, every device should have input IoBus, an output IoBus, and should have a function compute() which runs the computing pipeline from input to output. This is basically already implemented for the alu implementation but just needs to be setup with the class.

One slight hitch is that some devices take two input busses and others may take only one... For example the alu takes two input busses while depending on the decision made around #6, an object extending this superclass would take the place of the wordMap function but need only 1 input bus. We could have an array of input busses, but I feel like this could get confusing when we need to specify the routing of multiple internal to the device (we would have to pass by index and this doesn't seem right).

Therefore opening this for discussion as to how we should represent devices.