jaga.pj.circuits.experiment
Class MUXFunction
java.lang.Object
|
+--jaga.pj.circuits.experiment.MUXFunction
- All Implemented Interfaces:
- BooleanFunction, java.io.Serializable
- public class MUXFunction
- extends java.lang.Object
- implements BooleanFunction
This BooleanFunction is to be used to evolve MUXes with configurable address and
data buses.
Bits data are the data bus with 0 being bit 0, etc...
Bits add are the address bus with bit last bit being the LSB, so having them = 001
select bit 1 from the data bus (as opposed to bit 4)
- See Also:
- Serialized Form
Constructor Summary |
MUXFunction(int addLines,
int dataLines)
Creates new MUX5d3aFunction |
Method Summary |
int |
getNumOfInputs()
returns the amount of inputs needed to compute this function |
boolean |
getResult(boolean[] inputs)
returns the result of this function given the inputs in the array |
SampleData[] |
getTestData()
returns a set of SampleDatas providing a good set of input samples
to test this function
To avoid doing the full set which would be 256 lines long, use this:
D0 D1 D2 D3 D4 A2 A1 A0 (Q)
0 0 X0 X1 X1 X0 0 0 0 (0)
1 1 X0 X1 X0 X0 0 0 0 (1)
2 X1 1 X0 X0 X1 0 0 1 (1)
3 X0 0 X1 X1 X1 0 0 1 (0)
4 X1 X1 1 X1 X0 0 1 0 (1)
5 X0 X0 0 X0 X0 0 1 0 (0)
6 X0 X1 X0 0 X1 0 1 1 (0)
7 X0 X1 X1 1 X1 0 1 1 (1)
8 X1 X0 X1 X0 0 1 0 0 (0)
9 X1 X0 X1 X0 1 1 0 0 (1)
10 X0 X0 X1 X0 X1 1 1 1 (0)
11 X0 X0 X1 X0 X0 1 1 1 (0)
12 X1 1 X0 X1 X0 0 0 1 (1)
13 X1 X1 X1 X1 1 1 0 0 (1)
14 X1 X0 0 X0 X0 0 1 0 (0) |
void |
setRandomSeed(long seed)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
MUXFunction
public MUXFunction(int addLines,
int dataLines)
- Creates new MUX5d3aFunction
getResult
public boolean getResult(boolean[] inputs)
- returns the result of this function given the inputs in the array
- Specified by:
getResult
in interface BooleanFunction
- Parameters:
inputs
- what values the inputs to the function have
getNumOfInputs
public int getNumOfInputs()
- returns the amount of inputs needed to compute this function
- Specified by:
getNumOfInputs
in interface BooleanFunction
getTestData
public SampleData[] getTestData()
- returns a set of SampleDatas providing a good set of input samples
to test this function
To avoid doing the full set which would be 256 lines long, use this:
D0 D1 D2 D3 D4 A2 A1 A0 (Q)
0 0 X0 X1 X1 X0 0 0 0 (0)
1 1 X0 X1 X0 X0 0 0 0 (1)
2 X1 1 X0 X0 X1 0 0 1 (1)
3 X0 0 X1 X1 X1 0 0 1 (0)
4 X1 X1 1 X1 X0 0 1 0 (1)
5 X0 X0 0 X0 X0 0 1 0 (0)
6 X0 X1 X0 0 X1 0 1 1 (0)
7 X0 X1 X1 1 X1 0 1 1 (1)
8 X1 X0 X1 X0 0 1 0 0 (0)
9 X1 X0 X1 X0 1 1 0 0 (1)
10 X0 X0 X1 X0 X1 1 1 1 (0)
11 X0 X0 X1 X0 X0 1 1 1 (0)
12 X1 1 X0 X1 X0 0 0 1 (1)
13 X1 X1 X1 X1 1 1 0 0 (1)
14 X1 X0 0 X0 X0 0 1 0 (0)
- Specified by:
getTestData
in interface BooleanFunction
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
setRandomSeed
public void setRandomSeed(long seed)
- Specified by:
setRandomSeed
in interface BooleanFunction