コード例 #1
0
ファイル: TritMatchCircuit4.cs プロジェクト: bmdevx/Ternary
        public TritMatchCircuit4(Trit t0, Trit t1, Trit t2, Trit t3)
        {
            egatea = new EqualityGate(inputStateB: t0)
            {
                ComponentName = nameof(egatea)
            };
            egateb = new EqualityGate(inputStateB: t1)
            {
                ComponentName = nameof(egateb)
            };
            egatec = new EqualityGate(inputStateB: t2)
            {
                ComponentName = nameof(egatec)
            };
            egated = new EqualityGate(inputStateB: t3)
            {
                ComponentName = nameof(egated)
            };

            cgate1 = new ConsensusGate(egatea, egateb)
            {
                ComponentName = nameof(cgate1)
            };
            cgate2 = new ConsensusGate(egatec, egated)
            {
                ComponentName = nameof(cgate2)
            };

            cgate3 = new ConsensusGate(cgate1, cgate2)
            {
                ComponentName = nameof(cgate3)
            };

            deMuxer = new DeMuxer(inputState: Trit.Pos);

            cgate3.Output += deMuxer.InputSelect;

            shiftDownGate = new ShiftDownGate();

            deMuxer.AOutput += shiftDownGate.Input;
            deMuxer.BOutput += shiftDownGate.Input;

            shiftDownGate.Output += (s, t) => Output?.Invoke(this, t);
            deMuxer.COutput      += (s, t) => Output?.Invoke(this, t);
        }
コード例 #2
0
        public TritMatchCircuit(Trit i0, Trit i1)
        {
            egatea = new EqualityGate(inputStateB: i0);
            egateb = new EqualityGate(inputStateB: i1);

            cgate1 = new ConsensusGate(egatea, egateb);

            deMuxer = new DeMuxer(inputState: Trit.Pos);

            cgate1.Output += deMuxer.InputSelect;

            shiftDownGate = new ShiftDownGate();

            deMuxer.AOutput += shiftDownGate.Input;
            deMuxer.BOutput += shiftDownGate.Input;

            shiftDownGate.Output += (s, t) => Output?.Invoke(this, t);
            deMuxer.COutput      += (s, t) => Output?.Invoke(this, t);
        }
コード例 #3
0
ファイル: MatchGate.cs プロジェクト: bmdevx/Ternary
        public MatchGate(Trit i0, Trit i1, Trit t2)
        {
            egatea = new EqualityGate(inputStateB: i0);
            egateb = new EqualityGate(inputStateB: i1);
            egatec = new EqualityGate(inputStateB: t2);

            ecomp1 = new EqualityGate(egatec, null, inputStateB: Trit.Pos);

            cgate1 = new ConsensusGate(egatea, egateb);
            cgate2 = new ConsensusGate(cgate1, ecomp1);

            deMuxer = new DeMuxer(inputState: Trit.Pos);

            cgate2.Output += deMuxer.InputSelect;

            shiftDownGate = new ShiftDownGate();

            deMuxer.AOutput += shiftDownGate.Input;
            deMuxer.BOutput += shiftDownGate.Input;

            shiftDownGate.Output += (s, t) => Output?.Invoke(this, t);
            deMuxer.COutput      += (s, t) => Output?.Invoke(this, t);
        }