public void InputSelect(object sender, Trit select) { SelectState = select; OnSelectInvoked(sender, select); }
public MinGate(IComponentOutput componentA, IComponentOutput componentB, Trit inputStateA = Trit.Neu, Trit inputStateB = Trit.Neu) : base(componentA, componentB, inputStateA, inputStateB) { }
protected virtual void OnInputInvoked(object sender, Trit trit, int pin) { }
protected void InvokeSignedOutput(object sender, Trit sign) { SignedState = sign; SignedOutput?.Invoke(this, SignedState); }
public MinGate(ComponentTriggeredEvent input1 = null, ComponentTriggeredEvent input2 = null, Trit inputStateA = Trit.Neu, Trit inputStateB = Trit.Neu) : base(input1, input2, inputStateA, inputStateB) { }
public DeMuxer(Trit selectState = Trit.Neu, Trit inputState = Trit.Neu) : base(selectState) { InputState = inputState; }
public void FowleanControlInput(object sender, Trit trit) { FowleanControlState = trit; muxerBus2.InputSelect(this, trit); }
public static Trit Reverse(Trit trit) { return(trit == Trit.Neg ? Trit.Neg : Trit.Neu); }
public Trit this[int index] { get { switch (index) { case 0: return(T0); case 1: return(T1); case 2: return(T2); case 3: return(T3); case 4: return(T4); case 5: return(T5); case 6: return(T6); case 7: return(T7); case 8: return(T8); case 9: return(T9); case 10: return(T10); case 11: return(T11); } throw new IndexOutOfRangeException(); } set { switch (index) { case 0: T0 = value; break; case 1: T1 = value; break; case 2: T2 = value; break; case 3: T3 = value; break; case 4: T4 = value; break; case 5: T5 = value; break; case 6: T6 = value; break; case 7: T7 = value; break; case 8: T8 = value; break; case 9: T9 = value; break; case 10: T10 = value; break; case 11: T11 = value; break; default: throw new IndexOutOfRangeException(); } } }
/// <summary> /// Represents Ternary XOR Gate /// </summary> /// <param name="inputA">The first input <see cref="Trit"/></param> /// <param name="inputB">The second input <see cref="Trit"/></param> /// <returns>Ternary XOR <see cref="Trit"/> output</returns> public static Trit Output(Trit inputA, Trit inputB) { return(TAND.Output(TNAND.Output(inputA, inputB), TOR.Output(inputA, inputB))); }
public static Trit Forward(Trit trit) { return(trit == Trit.Pos ? Trit.Pos : Trit.Neu); }
protected abstract Trit Execute(Trit inputStateA, Trit inputStateB);
public bool Equal(Trit other) { return(this.Value == other.Value); }
protected abstract void OnSelectInvoked(object sender, Trit select);
public void Input(object sender, Trit trit) { InputState = trit; OnInputInvoked(sender, trit); }
protected override Trit Execute(object sender, Trit trit) { return(TritLogic.Forward(trit)); }
protected void InvokeOutput(object sender, Trit trit) { OutputState = trit; Output?.Invoke(sender, trit); }
protected override void OnInputInvoked(object sender, Trit trit, int pin) { InvokeOutput(pin, Execute(sender, InputStates[pin]), this); }
protected override void OnSelectInvoked(object sender, Trit select) { Input(this, InputState); }
protected abstract Trit Execute(object sender, Trit inputState);
protected void InvokeOverflowOutput(object sender, Trit overflow) { OverflowState = overflow; OverflowOutput?.Invoke(this, OverflowState); }
public ConverseImplicationGate(ComponentTriggeredEvent input1 = null, ComponentTriggeredEvent input2 = null, Trit inputStateA = Trit.Neu, Trit inputStateB = Trit.Neu) : base(input1, input2, inputStateA, inputStateB) { }
public void InputD(object sender, Trit trit) { egated.AInput(this, trit); }
protected override Trit Execute(Trit inputStateA, Trit inputStateB) { return(TritLogic.ConverseImplication(inputStateA, inputStateB)); }
protected override Trit Execute(Trit inputStateA, Trit inputStateB) { return(TritLogic.Min(inputStateA, inputStateB)); }
public ConverseImplicationGate(IComponentOutput componentA, IComponentOutput componentB, Trit inputStateA = Trit.Neu, Trit inputStateB = Trit.Neu) : base(componentA, componentB, inputStateA, inputStateB) { }
protected override Trit Execute(object sender, Trit trit) { return(TritLogic.ShiftUp(trit)); }
public Basic1In1OutComponent(ComponentTriggeredEvent input = null, Trit inputState = Trit.Neu) { input += Input; InputState = inputState; }
public ShiftUpGate(ComponentTriggeredEvent input = null, Trit inputState = Trit.Neu) : base(input, inputState) { }
public MuxerBusBase(Trit selectState = Trit.Neu) { SelectState = selectState; }