Exemple #1
0
        public HalfAdder(TTLGateTypeEnum gateType)
        {
            var xorGate = new XorGate(gateType, 2);
            var andGate = new AndGate(gateType, 2);

            Gates.Add(xorGate);
            Gates.Add(andGate);

            Connections.Add(new Connection
            {
                Source      = A,
                Termination = xorGate.Inputs[0]
            });

            Connections.Add(new Connection
            {
                Source      = B,
                Termination = xorGate.Inputs[1]
            });

            Connections.Add(new Connection
            {
                Source      = A,
                Termination = andGate.Inputs[0]
            });

            Connections.Add(new Connection
            {
                Source      = B,
                Termination = andGate.Inputs[1]
            });
        }
Exemple #2
0
        public FalstadCircuit(TTLGateTypeEnum gateTypes)
        {
            var andGate  = new AndGate(gateTypes, 2);
            var inverter = new Inverter(gateTypes);

            Gates.Add(andGate);
            Gates.Add(inverter);

            Connections.Add(new Connection
            {
                Source      = Input,
                Termination = andGate.Inputs[0]
            });

            Connections.Add(new Connection
            {
                Source      = Input,
                Termination = inverter.Inputs[0]
            });

            Connections.Add(new Connection
            {
                Source      = inverter,
                Termination = andGate.Inputs[1]
            });
        }
Exemple #3
0
    public void CreateNewGates(int wave = 0)
    {
        Wave                  waveDefinition     = WaveDefinitions[wave];
        List <Entity>         spawnedEntities    = SpawnEntitiesFromDefinition(waveDefinition);
        List <Entity>         randomizedEntities = RandomizeList(spawnedEntities);
        List <List <Entity> > gatesEntities      = SplitEntityList(randomizedEntities);

        for (int idx = 0; idx < gatesEntities.Count; idx++)
        {
            Gate newGate = new Gate()
            {
                Position        = _floor.GetRandomSpawnLocation(),
                EntitiesToSpawn = gatesEntities[idx]
            };
            newGate.Init();
            GetTree().Root.CallDeferred("add_child", newGate);
            Gates.Add(newGate);
            newGate.Connect("Complete", this, "OnGateComplete");
            if (idx == 0)
            {
                newGate.ActivateOnReady = true;
            }
            else
            {
                Gates[idx - 1].Connect("ThresholdReached", newGate, "Activate");
            }
        }
    }
Exemple #4
0
 protected int AddGate(Gate gate)
 {
     Gates.Add(gate);
     if (!WireDict.ContainsKey(gate.ID))
     {
         WireDict.Add(gate.ID, new List <Wire>());
     }
     return(Gates.Count - 1);
 }
Exemple #5
0
 protected Gate AddGateIndexed(Gate gate)
 {
     Gates.Add(gate);
     if (!WireDict.ContainsKey(gate.ID))
     {
         WireDict.Add(gate.ID, new List <Wire>());
     }
     gate.index = Gates.Count - 1;
     return(gate);
 }
Exemple #6
0
        public Gate AddDoor()
        {
            Gate door = new Gate(this)
            {
                Type        = "Door",
                Length      = 100,
                Thickness   = this.BorderThickness.Left * 5,
                Color       = new SolidColorBrush(Colors.White),
                ModelSource = @"models\gate\Door.obj"
            };

            Canvas.SetZIndex(door, 2);
            Gates.Add(door);
            floor.Children.Add(door);
            return(door);
        }
Exemple #7
0
        public Gate AddWindow()
        {
            Gate window = new Gate(this)
            {
                Type        = "Window",
                Length      = 80,
                Thickness   = this.BorderThickness.Left * 7,
                Color       = new SolidColorBrush(Colors.CadetBlue),
                ModelSource = @"models\gate\window.obj"
            };

            Canvas.SetZIndex(window, 5);
            Gates.Add(window);
            floor.Children.Add(window);
            return(window);
        }
Exemple #8
0
        public SRLatch(TTLGateTypeEnum gateType)
        {
            var nandGate1 = new NandGate(gateType, 2);
            var nandGate2 = new NandGate(gateType, 2);

            Gates.Add(nandGate1);
            Gates.Add(nandGate2);

            // C0
            Connections.Add(new Connection
            {
                Source      = nandGate1,
                Termination = nandGate2.Inputs[0]
            });

            // C1
            Connections.Add(new Connection
            {
                Source      = nandGate2,
                Termination = nandGate1.Inputs[1]
            });

            // C2
            Connections.Add(new Connection
            {
                Source      = S,
                Termination = nandGate1.Inputs[0]
            });

            // C3
            Connections.Add(new Connection
            {
                Source      = R,
                Termination = nandGate2.Inputs[1]
            });
        }
Exemple #9
0
        public FullAdder(TTLGateTypeEnum gateTypes)
        {
            Name = "full adder";

            Gates.Add(new XorGate(gateTypes, 2)
            {
                CircuitName = "G0"
            });
            Gates.Add(new XorGate(gateTypes, 2)
            {
                CircuitName = "G1"
            });
            Gates.Add(new AndGate(gateTypes, 2)
            {
                CircuitName = "G2"
            });
            Gates.Add(new AndGate(gateTypes, 2)
            {
                CircuitName = "G3"
            });
            Gates.Add(new OrGate(gateTypes, 2)
            {
                CircuitName = "G4"
            });

            #region inputs
            Connections.Add(new Connection
            {
                Source      = A,
                Termination = Gates[0].Inputs[0],
                Name        = "A -> G0(0)"
            });

            Connections.Add(new Connection
            {
                Source      = B,
                Termination = Gates[0].Inputs[1],
                Name        = "B -> G0(1)"
            });

            Connections.Add(new Connection
            {
                Source      = A,
                Termination = Gates[3].Inputs[0],
                Name        = "A -> G3(0)"
            });

            Connections.Add(new Connection
            {
                Source      = B,
                Termination = Gates[3].Inputs[1],
                Name        = "B -> G3(1)"
            });

            Connections.Add(new Connection
            {
                Source      = Cin,
                Termination = Gates[1].Inputs[1],
                Name        = "Cin -> G1(1)"
            });

            Connections.Add(new Connection
            {
                Source      = Cin,
                Termination = Gates[2].Inputs[0],
                Name        = "Cin -> G2(0)"
            });
            #endregion

            #region gate 0 output
            Connections.Add(new Connection
            {
                Source      = Gates[0],
                Termination = Gates[1].Inputs[0],
                Name        = "G0 -> G1(0)"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[0],
                Termination = Gates[2].Inputs[1],
                Name        = "G0 -> G2(1)"
            });
            #endregion

            #region gate 2 output
            Connections.Add(new Connection
            {
                Source      = Gates[2],
                Termination = Gates[4].Inputs[0],
                Name        = "G2 -> G4(0)"
            });
            #endregion

            #region gate 3 output
            Connections.Add(new Connection
            {
                Source      = Gates[3],
                Termination = Gates[4].Inputs[1],
                Name        = "G3 -> G4(1)"
            });
            #endregion
        }
        public JKMasterSlave(TTLGateTypeEnum gateType)
        {
            var nandGate1 = new NandGate(gateType, 2)
            {
                CircuitName = "G1"
            };
            var nandGate2 = new NandGate(gateType, 2)
            {
                CircuitName = "G2"
            };

            var nandGate3 = new NandGate(gateType, 2)
            {
                CircuitName = "G3"
            };
            var nandGate4 = new NandGate(gateType, 2)
            {
                CircuitName = "G4"
            };

            var nandGate5 = new NandGate(gateType, 2)
            {
                CircuitName = "G5"
            };
            var nandGate6 = new NandGate(gateType, 2)
            {
                CircuitName = "G6"
            };

            var nandGate7 = new NandGate(gateType, 3)
            {
                CircuitName = "G7"
            };
            var nandGate8 = new NandGate(gateType, 3)
            {
                CircuitName = "G8"
            };

            var inverter = new Inverter(gateType)
            {
                CircuitName = "G9"
            };

            Gates.Add(nandGate1);
            Gates.Add(nandGate2);
            Gates.Add(nandGate3);
            Gates.Add(nandGate4);
            Gates.Add(nandGate5);
            Gates.Add(nandGate6);
            Gates.Add(nandGate7);
            Gates.Add(nandGate8);
            Gates.Add(inverter);

            // C0
            Connections.Add(new Connection
            {
                Source      = J,
                Termination = nandGate7.Inputs[1],
                Name        = "C0"
            });

            // C1
            Connections.Add(new Connection
            {
                Source      = Clk,
                Termination = nandGate7.Inputs[2],
                Name        = "C1"
            });

            // C2
            Connections.Add(new Connection
            {
                Source      = Clk,
                Termination = nandGate8.Inputs[0],
                Name        = "C2"
            });

            // C3
            Connections.Add(new Connection
            {
                Source      = K,
                Termination = nandGate8.Inputs[1],
                Name        = "C3"
            });

            // C4
            Connections.Add(new Connection
            {
                Source      = nandGate7,
                Termination = nandGate5.Inputs[0],
                Name        = "C4"
            });

            // C5
            Connections.Add(new Connection
            {
                Source      = nandGate8,
                Termination = nandGate6.Inputs[1],
                Name        = "C5"
            });

            // C6
            Connections.Add(new Connection
            {
                Source      = nandGate6,
                Termination = nandGate5.Inputs[1],
                Name        = "C6"
            });

            // C7
            Connections.Add(new Connection
            {
                Source      = nandGate5,
                Termination = nandGate6.Inputs[0],
                Name        = "C7"
            });

            // C8
            Connections.Add(new Connection
            {
                Source      = nandGate5,
                Termination = nandGate3.Inputs[0],
                Name        = "C8"
            });

            // C9
            Connections.Add(new Connection
            {
                Source      = nandGate6,
                Termination = nandGate4.Inputs[1],
                Name        = "C9"
            });

            // C10
            Connections.Add(new Connection
            {
                Source      = inverter,
                Termination = nandGate3.Inputs[1],
                Name        = "C10"
            });

            // C11
            Connections.Add(new Connection
            {
                Source      = inverter,
                Termination = nandGate4.Inputs[0],
                Name        = "C11"
            });

            // C12
            Connections.Add(new Connection
            {
                Source      = nandGate3,
                Termination = nandGate1.Inputs[0],
                Name        = "C12"
            });

            // C13
            Connections.Add(new Connection
            {
                Source      = nandGate4,
                Termination = nandGate2.Inputs[1],
                Name        = "C13"
            });

            // C14
            Connections.Add(new Connection
            {
                Source      = nandGate2,
                Termination = nandGate1.Inputs[1],
                Name        = "C14"
            });

            // C15
            Connections.Add(new Connection
            {
                Source      = nandGate1,
                Termination = nandGate2.Inputs[0],
                Name        = "C15"
            });

            // C16
            Connections.Add(new Connection
            {
                Source      = nandGate1,
                Termination = nandGate8.Inputs[2],
                Name        = "C16"
            });

            // C17
            Connections.Add(new Connection
            {
                Source      = Clk,
                Termination = inverter.Inputs[0],
                Name        = "C17"
            });

            // C18
            Connections.Add(new Connection
            {
                Source      = nandGate2,
                Termination = nandGate7.Inputs[0],
                Name        = "C18"
            });
        }
Exemple #11
0
 protected int AddGate(Gate gate)
 {
     Gates.Add(gate);
     return(Gates.Count - 1);
 }
Exemple #12
0
        public TTL74157(TTLGateTypeEnum gateType)
        {
            Gates.Add(new AndGate(gateType, 3)
            {
                CircuitName = "G0"
            });
            Gates.Add(new AndGate(gateType, 3)
            {
                CircuitName = "G1"
            });
            Gates.Add(new AndGate(gateType, 3)
            {
                CircuitName = "G2"
            });
            Gates.Add(new AndGate(gateType, 3)
            {
                CircuitName = "G3"
            });
            Gates.Add(new AndGate(gateType, 3)
            {
                CircuitName = "G4"
            });
            Gates.Add(new AndGate(gateType, 3)
            {
                CircuitName = "G5"
            });
            Gates.Add(new AndGate(gateType, 3)
            {
                CircuitName = "G6"
            });
            Gates.Add(new AndGate(gateType, 3)
            {
                CircuitName = "G7"
            });
            Gates.Add(new OrGate(gateType, 2)
            {
                CircuitName = "G8"
            });
            Gates.Add(new OrGate(gateType, 2)
            {
                CircuitName = "G9"
            });
            Gates.Add(new OrGate(gateType, 2)
            {
                CircuitName = "G10"
            });
            Gates.Add(new OrGate(gateType, 2)
            {
                CircuitName = "G11"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G12"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G13"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G14"
            });

            #region inputs
            Connections.Add(new Connection
            {
                Source      = A1,
                Termination = Gates[0].Inputs[0],
                Name        = "A1 -> G0-0"
            });

            Connections.Add(new Connection
            {
                Source      = B1,
                Termination = Gates[1].Inputs[0],
                Name        = "B1 -> G1-0"
            });

            Connections.Add(new Connection
            {
                Source      = A2,
                Termination = Gates[2].Inputs[0],
                Name        = "A2 -> G2-0"
            });

            Connections.Add(new Connection
            {
                Source      = B2,
                Termination = Gates[3].Inputs[0],
                Name        = "B2 -> G3-0"
            });

            Connections.Add(new Connection
            {
                Source      = A3,
                Termination = Gates[4].Inputs[0],
                Name        = "A3 -> G4-0"
            });

            Connections.Add(new Connection
            {
                Source      = B3,
                Termination = Gates[5].Inputs[0],
                Name        = "B3 -> G5-0"
            });

            Connections.Add(new Connection
            {
                Source      = A4,
                Termination = Gates[6].Inputs[0],
                Name        = "A4 -> G6-0"
            });

            Connections.Add(new Connection
            {
                Source      = B4,
                Termination = Gates[7].Inputs[0],
                Name        = "B4 -> G7-0"
            });

            Connections.Add(new Connection
            {
                Source      = Select,
                Termination = Gates[12].Inputs[0],
                Name        = "Select -> G12-0"
            });

            Connections.Add(new Connection
            {
                Source      = Strobe,
                Termination = Gates[14].Inputs[0],
                Name        = "Strobe -> G14-0"
            });
            #endregion

            #region Gate 0 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[0],
                Termination = Gates[8].Inputs[0],
                Name        = "G0 -> G8-0"
            });
            #endregion

            #region Gate 1 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[1],
                Termination = Gates[8].Inputs[1],
                Name        = "G1 -> G8-1"
            });
            #endregion

            #region Gate 2 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[2],
                Termination = Gates[9].Inputs[0],
                Name        = "G2 -> G9-0"
            });
            #endregion

            #region Gate 3 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[3],
                Termination = Gates[9].Inputs[1],
                Name        = "G3 -> G9-1"
            });
            #endregion

            #region Gate 4 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[10].Inputs[0],
                Name        = "G4 -> G10-0"
            });
            #endregion

            #region Gate 5 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[5],
                Termination = Gates[10].Inputs[1],
                Name        = "G5 -> G10-1"
            });
            #endregion

            #region Gate 6 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[6],
                Termination = Gates[11].Inputs[0],
                Name        = "G6 -> G11-0"
            });
            #endregion

            #region Gate 7 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[7],
                Termination = Gates[11].Inputs[1],
                Name        = "G7 -> G11-1"
            });
            #endregion

            #region Gate 12 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[12],
                Termination = Gates[0].Inputs[1],
                Name        = "G12 -> G0-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[12],
                Termination = Gates[2].Inputs[1],
                Name        = "G12 -> G2-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[12],
                Termination = Gates[4].Inputs[1],
                Name        = "G12 -> G4-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[12],
                Termination = Gates[6].Inputs[1],
                Name        = "G12 -> G6-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[12],
                Termination = Gates[13].Inputs[0],
                Name        = "G12 -> G13-0"
            });
            #endregion

            #region Gate 13 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[13],
                Termination = Gates[1].Inputs[1],
                Name        = "G13 -> G1-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[13],
                Termination = Gates[3].Inputs[1],
                Name        = "G13 -> G3-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[13],
                Termination = Gates[5].Inputs[1],
                Name        = "G13 -> G5-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[13],
                Termination = Gates[7].Inputs[1],
                Name        = "G13 -> G7-1"
            });
            #endregion

            #region Gate 14 outputs
            for (int i = 0; i < 8; i++)
            {
                Connections.Add(new Connection
                {
                    Source      = Gates[14],
                    Termination = Gates[i].Inputs[2],
                    Name        = $"G14 -> G{i}-2"
                });
            }
            #endregion
        }
Exemple #13
0
        public JKFlipFlop(TTLGateTypeEnum gateType)
        {
            var nandGate1 = new NandGate(gateType, 2)
            {
                CircuitName = "G1"
            };
            var nandGate2 = new NandGate(gateType, 2)
            {
                CircuitName = "G2"
            };

            var nandGate3 = new NandGate(gateType, 3)
            {
                CircuitName = "G3"
            };
            var nandGate4 = new NandGate(gateType, 3)
            {
                CircuitName = "G4"
            };

            Gates.Add(nandGate1);
            Gates.Add(nandGate2);
            Gates.Add(nandGate3);
            Gates.Add(nandGate4);

            // C0
            Connections.Add(new Connection
            {
                Source      = J,
                Termination = nandGate3.Inputs[1],
                Name        = "C0"
            });

            // C1
            Connections.Add(new Connection
            {
                Source      = Clk,
                Termination = nandGate3.Inputs[2],
                Name        = "C1"
            });

            // C2
            Connections.Add(new Connection
            {
                Source      = nandGate2,            // QNot
                Termination = nandGate3.Inputs[0],
                Name        = "C2"
            });

            // C3
            Connections.Add(new Connection
            {
                Source      = K,
                Termination = nandGate4.Inputs[1],
                Name        = "C3"
            });

            // C4
            Connections.Add(new Connection
            {
                Source      = Clk,
                Termination = nandGate4.Inputs[0],
                Name        = "C4"
            });

            // C5
            Connections.Add(new Connection
            {
                Source      = nandGate1,            // Q
                Termination = nandGate4.Inputs[2],
                Name        = "C5"
            });

            // C6
            Connections.Add(new Connection
            {
                Source      = nandGate1,
                Termination = nandGate2.Inputs[0],
                Name        = "C6"
            });

            // C7
            Connections.Add(new Connection
            {
                Source      = nandGate2,
                Termination = nandGate1.Inputs[1],
                Name        = "C7"
            });

            // C8
            Connections.Add(new Connection
            {
                Source      = nandGate3,
                Termination = nandGate1.Inputs[0],
                Name        = "C8"
            });

            // C9
            Connections.Add(new Connection
            {
                Source      = nandGate4,
                Termination = nandGate2.Inputs[1],
                Name        = "C9"
            });
        }
Exemple #14
0
        public TTL74138(TTLGateTypeEnum gateType)
        {
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G0"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G1"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G2"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G3"
            });

            Gates.Add(new AndGate(gateType, 3)
            {
                CircuitName = "G4"
            });

            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G5"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G6"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G7"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G8"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G9"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G10"
            });

            Gates.Add(new NandGate(gateType, 4)
            {
                CircuitName = "G11"
            });
            Gates.Add(new NandGate(gateType, 4)
            {
                CircuitName = "G12"
            });
            Gates.Add(new NandGate(gateType, 4)
            {
                CircuitName = "G13"
            });
            Gates.Add(new NandGate(gateType, 4)
            {
                CircuitName = "G14"
            });
            Gates.Add(new NandGate(gateType, 4)
            {
                CircuitName = "G15"
            });
            Gates.Add(new NandGate(gateType, 4)
            {
                CircuitName = "G16"
            });
            Gates.Add(new NandGate(gateType, 4)
            {
                CircuitName = "G17"
            });
            Gates.Add(new NandGate(gateType, 4)
            {
                CircuitName = "G18"
            });

            #region inputs
            Connections.Add(new Connection
            {
                Source      = G1,
                Termination = Gates[0].Inputs[0],
                Name        = "G1 -> G0-0"
            });

            Connections.Add(new Connection
            {
                Source      = G2A,
                Termination = Gates[2].Inputs[0],
                Name        = "G2A -> G2-0"
            });

            Connections.Add(new Connection
            {
                Source      = G2B,
                Termination = Gates[3].Inputs[0],
                Name        = "G2B -> G3-0"
            });

            Connections.Add(new Connection
            {
                Source      = A,
                Termination = Gates[5].Inputs[0],
                Name        = "A -> G5-0"
            });

            Connections.Add(new Connection
            {
                Source      = B,
                Termination = Gates[6].Inputs[0],
                Name        = "B -> G6-0"
            });

            Connections.Add(new Connection
            {
                Source      = C,
                Termination = Gates[7].Inputs[0],
                Name        = "C -> G7-0"
            });
            #endregion

            #region Gate 0 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[0],
                Termination = Gates[1].Inputs[0],
                Name        = "G0 -> G1-0"
            });
            #endregion

            #region Gate 1 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[1],
                Termination = Gates[4].Inputs[0],
                Name        = "G1 -> G4-0"
            });
            #endregion

            #region Gate 2 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[2],
                Termination = Gates[4].Inputs[1],
                Name        = "G2 -> G4-1"
            });
            #endregion

            #region Gate 3 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[3],
                Termination = Gates[4].Inputs[2],
                Name        = "G3 -> G4-2"
            });
            #endregion

            #region Gate 4 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[11].Inputs[3],
                Name        = "G4 -> G11-3"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[12].Inputs[3],
                Name        = "G4 -> G12-3"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[13].Inputs[3],
                Name        = "G4 -> G13-3"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[14].Inputs[3],
                Name        = "G4 -> G14-3"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[15].Inputs[3],
                Name        = "G4 -> G15-3"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[16].Inputs[3],
                Name        = "G4 -> G16-3"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[17].Inputs[3],
                Name        = "G4 -> G17-3"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[18].Inputs[0],
                Name        = "G4 -> G18-0"
            });
            #endregion

            #region Gate 5 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[5],
                Termination = Gates[8].Inputs[0],
                Name        = "G5 -> G8-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[5],
                Termination = Gates[11].Inputs[0],
                Name        = "G5 -> G11-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[5],
                Termination = Gates[13].Inputs[0],
                Name        = "G5 -> G13-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[5],
                Termination = Gates[15].Inputs[0],
                Name        = "G5 -> G15-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[5],
                Termination = Gates[17].Inputs[0],
                Name        = "G5 -> G17-0"
            });
            #endregion

            #region Gate 6 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[6],
                Termination = Gates[9].Inputs[0],
                Name        = "G6 -> G9-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[6],
                Termination = Gates[11].Inputs[1],
                Name        = "G6 -> G11-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[6],
                Termination = Gates[12].Inputs[1],
                Name        = "G6 -> G12-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[6],
                Termination = Gates[15].Inputs[1],
                Name        = "G6 -> G15-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[6],
                Termination = Gates[16].Inputs[0],
                Name        = "G6 -> G16-0"
            });
            #endregion

            #region Gate 7 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[7],
                Termination = Gates[10].Inputs[0],
                Name        = "G7 -> G10-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[7],
                Termination = Gates[11].Inputs[2],
                Name        = "G7 -> G11-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[7],
                Termination = Gates[12].Inputs[2],
                Name        = "G7 -> G12-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[7],
                Termination = Gates[13].Inputs[2],
                Name        = "G7 -> G13-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[7],
                Termination = Gates[14].Inputs[2],
                Name        = "G7 -> G14-2"
            });
            #endregion

            #region Gate 8 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[8],
                Termination = Gates[12].Inputs[0],
                Name        = "G8 -> G12-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[8],
                Termination = Gates[14].Inputs[0],
                Name        = "G8 -> G14-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[8],
                Termination = Gates[16].Inputs[2],
                Name        = "G8 -> G16-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[8],
                Termination = Gates[18].Inputs[2],
                Name        = "G8 -> G18-2"
            });
            #endregion

            #region Gate 9 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[9],
                Termination = Gates[13].Inputs[1],
                Name        = "G9 -> G13-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[9],
                Termination = Gates[14].Inputs[1],
                Name        = "G9 -> G14-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[9],
                Termination = Gates[17].Inputs[2],
                Name        = "G9 -> G17-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[9],
                Termination = Gates[18].Inputs[1],
                Name        = "G9 -> G18-1"
            });
            #endregion

            #region Gate 10 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[10],
                Termination = Gates[15].Inputs[2],
                Name        = "G10 -> G15-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[10],
                Termination = Gates[16].Inputs[1],
                Name        = "G10 -> G16-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[10],
                Termination = Gates[17].Inputs[1],
                Name        = "G10 -> G17-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[10],
                Termination = Gates[18].Inputs[3],
                Name        = "G10 -> G18-3"
            });
            #endregion
        }
Exemple #15
0
        public TTL74148(TTLGateTypeEnum gateType)
        {
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G0"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G1"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G2"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G3"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G4"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G5"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G6"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G7"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G8"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G9"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G10"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G11"
            });

            Gates.Add(new NandGate(gateType, 9)
            {
                CircuitName = "G12"
            });

            Gates.Add(new AndGate(gateType, 5)
            {
                CircuitName = "G13"
            });
            Gates.Add(new AndGate(gateType, 4)
            {
                CircuitName = "G14"
            });
            Gates.Add(new AndGate(gateType, 3)
            {
                CircuitName = "G15"
            });
            Gates.Add(new AndGate(gateType, 2)
            {
                CircuitName = "G16"
            });
            Gates.Add(new AndGate(gateType, 4)
            {
                CircuitName = "G17"
            });
            Gates.Add(new AndGate(gateType, 4)
            {
                CircuitName = "G18"
            });
            Gates.Add(new AndGate(gateType, 2)
            {
                CircuitName = "G19"
            });
            Gates.Add(new AndGate(gateType, 2)
            {
                CircuitName = "G20"
            });
            Gates.Add(new AndGate(gateType, 2)
            {
                CircuitName = "G21"
            });
            Gates.Add(new AndGate(gateType, 2)
            {
                CircuitName = "G22"
            });
            Gates.Add(new AndGate(gateType, 2)
            {
                CircuitName = "G23"
            });
            Gates.Add(new AndGate(gateType, 2)
            {
                CircuitName = "G24"
            });

            Gates.Add(new NandGate(gateType, 2)
            {
                CircuitName = "G25"
            });

            Gates.Add(new NorGate(gateType, 4)
            {
                CircuitName = "G26"
            });
            Gates.Add(new NorGate(gateType, 4)
            {
                CircuitName = "G27"
            });
            Gates.Add(new NorGate(gateType, 4)
            {
                CircuitName = "G28"
            });

            #region inputs
            Connections.Add(new Connection
            {
                Source      = I0,
                Termination = Gates[12].Inputs[0],
                Name        = "I0 -> G12-0"
            });

            Connections.Add(new Connection
            {
                Source      = I1,
                Termination = Gates[0].Inputs[0],
                Name        = "I1 -> G0-0"
            });

            Connections.Add(new Connection
            {
                Source      = I1,
                Termination = Gates[12].Inputs[1],
                Name        = "I1 -> G12-1"
            });

            Connections.Add(new Connection
            {
                Source      = I2,
                Termination = Gates[1].Inputs[0],
                Name        = "I2 -> G1-0"
            });

            Connections.Add(new Connection
            {
                Source      = I2,
                Termination = Gates[12].Inputs[2],
                Name        = "I2 -> G12-2"
            });

            Connections.Add(new Connection
            {
                Source      = I3,
                Termination = Gates[2].Inputs[0],
                Name        = "I3 -> G2-0"
            });

            Connections.Add(new Connection
            {
                Source      = I3,
                Termination = Gates[12].Inputs[3],
                Name        = "I3 -> G12-3"
            });

            Connections.Add(new Connection
            {
                Source      = I4,
                Termination = Gates[3].Inputs[0],
                Name        = "I4 -> G3-0"
            });

            Connections.Add(new Connection
            {
                Source      = I4,
                Termination = Gates[12].Inputs[4],
                Name        = "I4 -> G12-4"
            });

            Connections.Add(new Connection
            {
                Source      = I5,
                Termination = Gates[4].Inputs[0],
                Name        = "I5 -> G4-0"
            });

            Connections.Add(new Connection
            {
                Source      = I5,
                Termination = Gates[12].Inputs[5],
                Name        = "I5 -> G12-5"
            });

            Connections.Add(new Connection
            {
                Source      = I6,
                Termination = Gates[5].Inputs[0],
                Name        = "I6 -> G5-0"
            });

            Connections.Add(new Connection
            {
                Source      = I6,
                Termination = Gates[12].Inputs[6],
                Name        = "I6 -> G12-6"
            });

            Connections.Add(new Connection
            {
                Source      = I7,
                Termination = Gates[6].Inputs[0],
                Name        = "I7 -> G6-0"
            });

            Connections.Add(new Connection
            {
                Source      = I7,
                Termination = Gates[12].Inputs[7],
                Name        = "I7 -> G12-7"
            });

            Connections.Add(new Connection
            {
                Source      = EI,
                Termination = Gates[7].Inputs[0],
                Name        = "EI -> G7-0"
            });
            #endregion

            #region Gate 0 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[0],
                Termination = Gates[13].Inputs[0],
                Name        = "G0 -> G13-0"
            });
            #endregion

            #region Gate 1 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[1],
                Termination = Gates[8].Inputs[0],
                Name        = "G1 -> G8-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[1],
                Termination = Gates[17].Inputs[0],
                Name        = "G1 -> G17-0"
            });
            #endregion

            #region Gate 2 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[2],
                Termination = Gates[14].Inputs[0],
                Name        = "G2 -> G14-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[2],
                Termination = Gates[18].Inputs[0],
                Name        = "G2 -> G18-0"
            });
            #endregion

            #region Gate 3 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[3],
                Termination = Gates[9].Inputs[0],
                Name        = "G3 -> G9-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[3],
                Termination = Gates[21].Inputs[0],
                Name        = "G3 -> G21-0"
            });
            #endregion

            #region Gate 4 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[10].Inputs[0],
                Name        = "G4 -> G10-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[15].Inputs[0],
                Name        = "G4 -> G15-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[22].Inputs[0],
                Name        = "G4 -> G22-0"
            });
            #endregion

            #region Gate 5 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[5],
                Termination = Gates[11].Inputs[0],
                Name        = "G5 -> G11-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[5],
                Termination = Gates[19].Inputs[0],
                Name        = "G5 -> G19-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[5],
                Termination = Gates[23].Inputs[0],
                Name        = "G5 -> G23-0"
            });
            #endregion

            #region Gate 6 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[6],
                Termination = Gates[24].Inputs[0],
                Name        = "G6 -> G24-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[6],
                Termination = Gates[20].Inputs[0],
                Name        = "G6 -> G20-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[6],
                Termination = Gates[16].Inputs[0],
                Name        = "G6 -> G16-0"
            });
            #endregion

            #region Gate 7 outputs

            for (int i = 12; i < 25; i++)
            {
                Connections.Add(new Connection
                {
                    Source      = Gates[7],
                    Termination = Gates[i].Inputs[Gates[i].Inputs.Count - 1],
                    Name        = $"G7 -> G{i}-{Gates[i].Inputs.Count - 1}"
                });
            }
            Connections.Add(new Connection
            {
                Source      = Gates[7],
                Termination = Gates[25].Inputs[1],
                Name        = "G7 -> G25-1"
            });

            #endregion

            #region Gate 8 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[8],
                Termination = Gates[13].Inputs[1],
                Name        = "G8 -> G13-1"
            });
            #endregion

            #region Gate 9 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[9],
                Termination = Gates[13].Inputs[2],
                Name        = "G9 -> G13-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[9],
                Termination = Gates[14].Inputs[1],
                Name        = "G9 -> G14-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[9],
                Termination = Gates[17].Inputs[1],
                Name        = "G9 -> G17-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[9],
                Termination = Gates[18].Inputs[1],
                Name        = "G9 -> G18-1"
            });
            #endregion

            #region Gate 10 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[10],
                Termination = Gates[17].Inputs[2],
                Name        = "G10 -> G17-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[10],
                Termination = Gates[18].Inputs[2],
                Name        = "G10 -> G18-2"
            });
            #endregion

            #region Gate 11 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[11],
                Termination = Gates[13].Inputs[3],
                Name        = "G11 -> G13-4"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[11],
                Termination = Gates[14].Inputs[2],
                Name        = "G11 -> G14-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[11],
                Termination = Gates[15].Inputs[1],
                Name        = "G11 -> G15-1"
            });
            #endregion

            #region Gate 12 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[12],
                Termination = Gates[25].Inputs[0],
                Name        = "G12 -> G25-0"
            });
            #endregion

            #region Gate 13 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[13],
                Termination = Gates[26].Inputs[0],
                Name        = "G13 -> G26-0"
            });
            #endregion

            #region Gate 14 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[14],
                Termination = Gates[26].Inputs[1],
                Name        = "G14 -> G26-1"
            });
            #endregion

            #region Gate 15 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[15],
                Termination = Gates[26].Inputs[2],
                Name        = "G15 -> G26-2"
            });
            #endregion

            #region Gate 16 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[16],
                Termination = Gates[26].Inputs[3],
                Name        = "G16 -> G26-3"
            });
            #endregion

            #region Gate 17 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[17],
                Termination = Gates[27].Inputs[0],
                Name        = "G17 -> G27-0"
            });
            #endregion

            #region Gate 18 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[18],
                Termination = Gates[27].Inputs[1],
                Name        = "G18 -> G27-1"
            });
            #endregion

            #region Gate 19 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[19],
                Termination = Gates[27].Inputs[2],
                Name        = "G19 -> G27-2"
            });
            #endregion

            #region Gate 20 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[20],
                Termination = Gates[27].Inputs[3],
                Name        = "G20 -> G27-3"
            });
            #endregion

            #region Gate 21 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[21],
                Termination = Gates[28].Inputs[0],
                Name        = "G21 -> G28-0"
            });
            #endregion

            #region Gate 22 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[22],
                Termination = Gates[28].Inputs[1],
                Name        = "G22 -> G28-1"
            });
            #endregion

            #region Gate 23 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[23],
                Termination = Gates[28].Inputs[2],
                Name        = "G23 -> G28-2"
            });
            #endregion

            #region Gate 24 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[24],
                Termination = Gates[28].Inputs[3],
                Name        = "G24 -> G28-3"
            });
            #endregion
        }
Exemple #16
0
        public TTL74181_alternate(TTLGateTypeEnum gateType)
        {
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G0"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G1"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G2"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G3"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G4"
            });

            Gates.Add(new AndGate(gateType, 3)
            {
                CircuitName = "G5"
            });
            Gates.Add(new AndGate(gateType, 3)
            {
                CircuitName = "G6"
            });
            Gates.Add(new AndGate(gateType, 2)
            {
                CircuitName = "G7"
            });
            Gates.Add(new AndGate(gateType, 2)
            {
                CircuitName = "G8"
            });
            Gates.Add(new AndGate(gateType, 1)
            {
                CircuitName = "G9"
            });

            Gates.Add(new AndGate(gateType, 3)
            {
                CircuitName = "G10"
            });
            Gates.Add(new AndGate(gateType, 3)
            {
                CircuitName = "G11"
            });
            Gates.Add(new AndGate(gateType, 2)
            {
                CircuitName = "G12"
            });
            Gates.Add(new AndGate(gateType, 2)
            {
                CircuitName = "G13"
            });
            Gates.Add(new AndGate(gateType, 1)
            {
                CircuitName = "G14"
            });

            Gates.Add(new AndGate(gateType, 3)
            {
                CircuitName = "G15"
            });
            Gates.Add(new AndGate(gateType, 3)
            {
                CircuitName = "G16"
            });
            Gates.Add(new AndGate(gateType, 2)
            {
                CircuitName = "G17"
            });
            Gates.Add(new AndGate(gateType, 2)
            {
                CircuitName = "G18"
            });
            Gates.Add(new AndGate(gateType, 1)
            {
                CircuitName = "G19"
            });

            Gates.Add(new AndGate(gateType, 3)
            {
                CircuitName = "G20"
            });
            Gates.Add(new AndGate(gateType, 3)
            {
                CircuitName = "G21"
            });
            Gates.Add(new AndGate(gateType, 2)
            {
                CircuitName = "G22"
            });
            Gates.Add(new AndGate(gateType, 2)
            {
                CircuitName = "G23"
            });
            Gates.Add(new AndGate(gateType, 1)
            {
                CircuitName = "G24"
            });

            Gates.Add(new NorGate(gateType, 2)
            {
                CircuitName = "G25"
            });
            Gates.Add(new NorGate(gateType, 3)
            {
                CircuitName = "G26"
            });
            Gates.Add(new NorGate(gateType, 2)
            {
                CircuitName = "G27"
            });
            Gates.Add(new NorGate(gateType, 3)
            {
                CircuitName = "G28"
            });
            Gates.Add(new NorGate(gateType, 2)
            {
                CircuitName = "G29"
            });
            Gates.Add(new NorGate(gateType, 3)
            {
                CircuitName = "G30"
            });
            Gates.Add(new NorGate(gateType, 2)
            {
                CircuitName = "G31"
            });
            Gates.Add(new NorGate(gateType, 3)
            {
                CircuitName = "G32"
            });

            Gates.Add(new XorGate(gateType, 2)
            {
                CircuitName = "G33"
            });
            Gates.Add(new XorGate(gateType, 2)
            {
                CircuitName = "G34"
            });
            Gates.Add(new XorGate(gateType, 2)
            {
                CircuitName = "G35"
            });
            Gates.Add(new XorGate(gateType, 2)
            {
                CircuitName = "G36"
            });

            Gates.Add(new AndGate(gateType, 1)
            {
                CircuitName = "G37"
            });
            Gates.Add(new AndGate(gateType, 2)
            {
                CircuitName = "G38"
            });
            Gates.Add(new AndGate(gateType, 3)
            {
                CircuitName = "G39"
            });
            Gates.Add(new AndGate(gateType, 4)
            {
                CircuitName = "G40"
            });
            Gates.Add(new NandGate(gateType, 5)
            {
                CircuitName = "G41"
            });
            Gates.Add(new NandGate(gateType, 4)
            {
                CircuitName = "G42"
            });

            Gates.Add(new AndGate(gateType, 5)
            {
                CircuitName = "G43"
            });
            Gates.Add(new AndGate(gateType, 4)
            {
                CircuitName = "G44"
            });
            Gates.Add(new AndGate(gateType, 3)
            {
                CircuitName = "G45"
            });
            Gates.Add(new AndGate(gateType, 2)
            {
                CircuitName = "G46"
            });

            Gates.Add(new AndGate(gateType, 4)
            {
                CircuitName = "G47"
            });
            Gates.Add(new AndGate(gateType, 3)
            {
                CircuitName = "G48"
            });
            Gates.Add(new AndGate(gateType, 2)
            {
                CircuitName = "G49"
            });

            Gates.Add(new AndGate(gateType, 3)
            {
                CircuitName = "G50"
            });
            Gates.Add(new AndGate(gateType, 2)
            {
                CircuitName = "G51"
            });

            Gates.Add(new NandGate(gateType, 2)
            {
                CircuitName = "G52"
            });

            Gates.Add(new NorGate(gateType, 4)
            {
                CircuitName = "G53"
            });
            Gates.Add(new NorGate(gateType, 4)
            {
                CircuitName = "G54"
            });
            Gates.Add(new NorGate(gateType, 3)
            {
                CircuitName = "G55"
            });
            Gates.Add(new NorGate(gateType, 2)
            {
                CircuitName = "G56"
            });

            Gates.Add(new NotOrGate(gateType, 2)
            {
                CircuitName = "G57"
            });                                                                        // special inverted input or gate

            Gates.Add(new XorGate(gateType, 2)
            {
                CircuitName = "G58"
            });
            Gates.Add(new XorGate(gateType, 2)
            {
                CircuitName = "G59"
            });
            Gates.Add(new XorGate(gateType, 2)
            {
                CircuitName = "G60"
            });
            Gates.Add(new XorGate(gateType, 2)
            {
                CircuitName = "G61"
            });

            Gates.Add(new AndGate(gateType, 4)
            {
                CircuitName = "G62"
            });

            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G63"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G64"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G65"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G66"
            });
            #region inputs

            Connections.Add(new Connection
            {
                Source      = S0,
                Termination = Gates[8].Inputs[0],
                Name        = "S0 -> G8-0"
            });

            Connections.Add(new Connection
            {
                Source      = S0,
                Termination = Gates[13].Inputs[0],
                Name        = "S0 -> G13-0"
            });

            Connections.Add(new Connection
            {
                Source      = S0,
                Termination = Gates[18].Inputs[0],
                Name        = "S0 -> G18-0"
            });

            Connections.Add(new Connection
            {
                Source      = S0,
                Termination = Gates[23].Inputs[0],
                Name        = "S0 -> G23-0"
            });

            Connections.Add(new Connection
            {
                Source      = S1,
                Termination = Gates[7].Inputs[1],
                Name        = "S1 -> G7-1"
            });

            Connections.Add(new Connection
            {
                Source      = S1,
                Termination = Gates[12].Inputs[1],
                Name        = "S1 -> G12-1"
            });

            Connections.Add(new Connection
            {
                Source      = S1,
                Termination = Gates[17].Inputs[1],
                Name        = "S1 -> G17-1"
            });

            Connections.Add(new Connection
            {
                Source      = S1,
                Termination = Gates[22].Inputs[1],
                Name        = "S1 -> G22-1"
            });

            Connections.Add(new Connection
            {
                Source      = S2,
                Termination = Gates[6].Inputs[1],
                Name        = "S2 -> G6-1"
            });

            Connections.Add(new Connection
            {
                Source      = S2,
                Termination = Gates[11].Inputs[1],
                Name        = "S2 -> G11-1"
            });

            Connections.Add(new Connection
            {
                Source      = S2,
                Termination = Gates[16].Inputs[1],
                Name        = "S2 -> G16-1"
            });

            Connections.Add(new Connection
            {
                Source      = S2,
                Termination = Gates[21].Inputs[1],
                Name        = "S2 -> G21-1"
            });

            Connections.Add(new Connection
            {
                Source      = S3,
                Termination = Gates[5].Inputs[1],
                Name        = "S3 -> G5-1"
            });

            Connections.Add(new Connection
            {
                Source      = S3,
                Termination = Gates[10].Inputs[1],
                Name        = "S3 -> G10-1"
            });

            Connections.Add(new Connection
            {
                Source      = S3,
                Termination = Gates[15].Inputs[1],
                Name        = "S3 -> G15-1"
            });

            Connections.Add(new Connection
            {
                Source      = S3,
                Termination = Gates[20].Inputs[1],
                Name        = "S3 -> G20-1"
            });

            Connections.Add(new Connection
            {
                Source      = B3,
                Termination = Gates[5].Inputs[0],
                Name        = "B3 -> G5-0"
            });

            Connections.Add(new Connection
            {
                Source      = B3,
                Termination = Gates[0].Inputs[0],
                Name        = "B3 -> G0-0"
            });

            Connections.Add(new Connection
            {
                Source      = B3,
                Termination = Gates[8].Inputs[1],
                Name        = "B3 -> G8-1"
            });

            Connections.Add(new Connection
            {
                Source      = A3,
                Termination = Gates[5].Inputs[2],
                Name        = "A3 -> G5-2"
            });

            Connections.Add(new Connection
            {
                Source      = A3,
                Termination = Gates[6].Inputs[0],
                Name        = "A3 -> G6-0"
            });

            Connections.Add(new Connection
            {
                Source      = A3,
                Termination = Gates[9].Inputs[0],
                Name        = "A3 -> G9-0"
            });

            Connections.Add(new Connection
            {
                Source      = B2,
                Termination = Gates[10].Inputs[0],
                Name        = "B2 -> G10-0"
            });

            Connections.Add(new Connection
            {
                Source      = B2,
                Termination = Gates[1].Inputs[0],
                Name        = "B2 -> G1-0"
            });

            Connections.Add(new Connection
            {
                Source      = B2,
                Termination = Gates[13].Inputs[1],
                Name        = "B2 -> G13-1"
            });

            Connections.Add(new Connection
            {
                Source      = A2,
                Termination = Gates[10].Inputs[2],
                Name        = "A2 -> G10-2"
            });

            Connections.Add(new Connection
            {
                Source      = A2,
                Termination = Gates[11].Inputs[0],
                Name        = "A2 -> G11-0"
            });

            Connections.Add(new Connection
            {
                Source      = A2,
                Termination = Gates[14].Inputs[0],
                Name        = "A2 -> G14-0"
            });

            Connections.Add(new Connection
            {
                Source      = B1,
                Termination = Gates[15].Inputs[0],
                Name        = "B1 -> G15-0"
            });

            Connections.Add(new Connection
            {
                Source      = B1,
                Termination = Gates[2].Inputs[0],
                Name        = "B1 -> G2-0"
            });

            Connections.Add(new Connection
            {
                Source      = B1,
                Termination = Gates[18].Inputs[1],
                Name        = "B1 -> G18-1"
            });

            Connections.Add(new Connection
            {
                Source      = A1,
                Termination = Gates[15].Inputs[2],
                Name        = "A1 -> G15-2"
            });

            Connections.Add(new Connection
            {
                Source      = A1,
                Termination = Gates[16].Inputs[0],
                Name        = "A1 -> G16-0"
            });

            Connections.Add(new Connection
            {
                Source      = A1,
                Termination = Gates[19].Inputs[0],
                Name        = "A1 -> G19-0"
            });

            Connections.Add(new Connection
            {
                Source      = B0,
                Termination = Gates[20].Inputs[0],
                Name        = "B0 -> G20-0"
            });

            Connections.Add(new Connection
            {
                Source      = B0,
                Termination = Gates[3].Inputs[0],
                Name        = "B0 -> G3-0"
            });

            Connections.Add(new Connection
            {
                Source      = B0,
                Termination = Gates[23].Inputs[1],
                Name        = "B0 -> G23-1"
            });

            Connections.Add(new Connection
            {
                Source      = A0,
                Termination = Gates[20].Inputs[2],
                Name        = "A0 -> G20-2"
            });

            Connections.Add(new Connection
            {
                Source      = A0,
                Termination = Gates[21].Inputs[0],
                Name        = "A0 -> G21-0"
            });

            Connections.Add(new Connection
            {
                Source      = A0,
                Termination = Gates[24].Inputs[0],
                Name        = "A0 -> G24-0"
            });

            Connections.Add(new Connection
            {
                Source      = M,
                Termination = Gates[4].Inputs[0],
                Name        = "M -> G4-0"
            });

            Connections.Add(new Connection
            {
                Source      = Cn,
                Termination = Gates[41].Inputs[4],
                Name        = "Cn -> G41-4"
            });

            Connections.Add(new Connection
            {
                Source      = Cn,
                Termination = Gates[43].Inputs[0],
                Name        = "Cn -> G43-0"
            });

            Connections.Add(new Connection
            {
                Source      = Cn,
                Termination = Gates[47].Inputs[0],
                Name        = "Cn -> G47-0"
            });

            Connections.Add(new Connection
            {
                Source      = Cn,
                Termination = Gates[50].Inputs[0],
                Name        = "Cn -> G50-0"
            });

            Connections.Add(new Connection
            {
                Source      = Cn,
                Termination = Gates[52].Inputs[0],
                Name        = "Cn -> G47-3"
            });

            #endregion

            #region Gate 0 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[0],
                Termination = Gates[6].Inputs[2],
                Name        = "G0 -> G6-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[0],
                Termination = Gates[7].Inputs[0],
                Name        = "G0 -> G7-0"
            });
            #endregion

            #region Gate 1 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[1],
                Termination = Gates[11].Inputs[2],
                Name        = "G1 -> G11-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[1],
                Termination = Gates[12].Inputs[0],
                Name        = "G1 -> 12-0"
            });
            #endregion

            #region Gate 2 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[2],
                Termination = Gates[16].Inputs[2],
                Name        = "G2 -> G16-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[2],
                Termination = Gates[17].Inputs[0],
                Name        = "G2 -> G17-0"
            });
            #endregion

            #region Gate 3 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[3],
                Termination = Gates[21].Inputs[2],
                Name        = "G3 -> G21-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[3],
                Termination = Gates[22].Inputs[0],
                Name        = "G3 -> G22-0"
            });
            #endregion

            #region Gate 4 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[43].Inputs[4],
                Name        = "G4 -> G43-4"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[44].Inputs[3],
                Name        = "G4 -> G44-3"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[45].Inputs[2],
                Name        = "G4 -> G45-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[46].Inputs[1],
                Name        = "G4 -> G46-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[47].Inputs[3],
                Name        = "G4 -> G47-3"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[48].Inputs[2],
                Name        = "G4 -> G48-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[49].Inputs[1],
                Name        = "G4 -> G49-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[50].Inputs[2],
                Name        = "G4 -> G50-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[51].Inputs[1],
                Name        = "G4 -> G51-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[52].Inputs[1],
                Name        = "G4 -> G52-1"
            });
            #endregion

            #region Gate 5 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[5],
                Termination = Gates[25].Inputs[0],
                Name        = "G5 -> G25-0"
            });
            #endregion

            #region Gate 6 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[6],
                Termination = Gates[25].Inputs[1],
                Name        = "G6 -> G25-1"
            });
            #endregion

            #region Gate 7 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[7],
                Termination = Gates[26].Inputs[0],
                Name        = "G7 -> G26-0"
            });
            #endregion

            #region Gate 8 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[8],
                Termination = Gates[26].Inputs[1],
                Name        = "G8 -> G26-1"
            });
            #endregion

            #region Gate 9 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[9],
                Termination = Gates[26].Inputs[2],
                Name        = "G9 -> G26-2"
            });
            #endregion

            #region Gate 10 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[10],
                Termination = Gates[27].Inputs[0],
                Name        = "G10 -> G27-0"
            });
            #endregion

            #region Gate 11 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[11],
                Termination = Gates[27].Inputs[1],
                Name        = "G11 -> G27-1"
            });
            #endregion

            #region Gate 12 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[12],
                Termination = Gates[28].Inputs[0],
                Name        = "G12 -> G28-0"
            });
            #endregion

            #region Gate 13 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[13],
                Termination = Gates[28].Inputs[1],
                Name        = "G13 -> G28-1"
            });
            #endregion

            #region Gate 14 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[14],
                Termination = Gates[28].Inputs[2],
                Name        = "G14 -> G28-2"
            });
            #endregion

            #region Gate 15 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[15],
                Termination = Gates[29].Inputs[0],
                Name        = "G15 -> G29-0"
            });
            #endregion

            #region Gate 16 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[16],
                Termination = Gates[29].Inputs[1],
                Name        = "G16 -> G29-1"
            });
            #endregion

            #region Gate 17 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[17],
                Termination = Gates[30].Inputs[0],
                Name        = "G17 -> G30-0"
            });
            #endregion

            #region Gate 18 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[18],
                Termination = Gates[30].Inputs[1],
                Name        = "G18 -> G30-1"
            });
            #endregion

            #region Gate 19 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[19],
                Termination = Gates[30].Inputs[2],
                Name        = "G19 -> G30-2"
            });
            #endregion

            #region Gate 20 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[20],
                Termination = Gates[31].Inputs[0],
                Name        = "G20 -> G31-0"
            });
            #endregion

            #region Gate 21 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[21],
                Termination = Gates[31].Inputs[1],
                Name        = "G21 -> G31-1"
            });
            #endregion

            #region Gate 22 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[22],
                Termination = Gates[32].Inputs[0],
                Name        = "G22 -> G32-0"
            });
            #endregion

            #region Gate 23 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[23],
                Termination = Gates[32].Inputs[1],
                Name        = "G23 -> G32-1"
            });
            #endregion

            #region Gate 24 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[24],
                Termination = Gates[32].Inputs[2],
                Name        = "G24 -> G32-2"
            });
            #endregion

            #region Gate 25 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[25],
                Termination = Gates[38].Inputs[0],
                Name        = "G25 -> G38-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[25],
                Termination = Gates[33].Inputs[0],
                Name        = "G25 -> G33-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[25],
                Termination = Gates[39].Inputs[0],
                Name        = "G25 -> G39-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[25],
                Termination = Gates[40].Inputs[0],
                Name        = "G25 -> G40-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[25],
                Termination = Gates[41].Inputs[0],
                Name        = "G25 -> G41-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[25],
                Termination = Gates[42].Inputs[0],
                Name        = "G25 -> G42-0"
            });
            #endregion

            #region Gate 26 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[26],
                Termination = Gates[37].Inputs[0],
                Name        = "G26 -> G37-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[26],
                Termination = Gates[63].Inputs[0],
                Name        = "G26 -> G63-0"
            });
            #endregion

            #region Gate 27 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[27],
                Termination = Gates[34].Inputs[0],
                Name        = "G27 -> G34-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[27],
                Termination = Gates[39].Inputs[1],
                Name        = "G27 -> G39-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[27],
                Termination = Gates[40].Inputs[1],
                Name        = "G27 -> G40-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[27],
                Termination = Gates[41].Inputs[1],
                Name        = "G27 -> G41-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[27],
                Termination = Gates[42].Inputs[1],
                Name        = "G27 -> G42-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[27],
                Termination = Gates[43].Inputs[3],
                Name        = "G27 -> G43-3"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[27],
                Termination = Gates[44].Inputs[1],
                Name        = "G27 -> G44-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[27],
                Termination = Gates[45].Inputs[0],
                Name        = "G27 -> G45-0"
            });
            #endregion

            #region Gate 28 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[28],
                Termination = Gates[38].Inputs[1],
                Name        = "G28 -> G38-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[28],
                Termination = Gates[64].Inputs[0],
                Name        = "G28 -> G64-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[28],
                Termination = Gates[46].Inputs[0],
                Name        = "G28 -> G46-0"
            });
            #endregion

            #region Gate 29 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[29],
                Termination = Gates[47].Inputs[2],
                Name        = "G29 -> G47-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[29],
                Termination = Gates[48].Inputs[0],
                Name        = "G29 -> G48-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[29],
                Termination = Gates[40].Inputs[2],
                Name        = "G29 -> G40-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[29],
                Termination = Gates[35].Inputs[0],
                Name        = "G29 -> G35-0"
            });
            #endregion

            #region Gate 30 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[30],
                Termination = Gates[39].Inputs[2],
                Name        = "G30 -> G39-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[30],
                Termination = Gates[45].Inputs[1],
                Name        = "G30 -> G45-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[30],
                Termination = Gates[49].Inputs[0],
                Name        = "G30 -> G49-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[30],
                Termination = Gates[65].Inputs[0],
                Name        = "G30 -> G65-0"
            });
            #endregion

            #region Gate 31 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[31],
                Termination = Gates[41].Inputs[3],
                Name        = "G31 -> G41-3"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[31],
                Termination = Gates[42].Inputs[3],
                Name        = "G31 -> G42-3"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[31],
                Termination = Gates[43].Inputs[1],
                Name        = "G31 -> G43-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[31],
                Termination = Gates[44].Inputs[0],
                Name        = "G31 -> G44-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[31],
                Termination = Gates[47].Inputs[1],
                Name        = "G31 -> G47-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[31],
                Termination = Gates[50].Inputs[1],
                Name        = "G31 -> G50-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[31],
                Termination = Gates[36].Inputs[0],
                Name        = "G31 -> G36-0"
            });
            #endregion

            #region Gate 32 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[32],
                Termination = Gates[40].Inputs[3],
                Name        = "G32 -> G40-3"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[32],
                Termination = Gates[41].Inputs[2],
                Name        = "G32 -> G41-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[32],
                Termination = Gates[42].Inputs[2],
                Name        = "G32 -> G42-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[32],
                Termination = Gates[43].Inputs[2],
                Name        = "G32 -> G43-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[32],
                Termination = Gates[44].Inputs[2],
                Name        = "G32 -> G44-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[32],
                Termination = Gates[48].Inputs[1],
                Name        = "G32 -> G48-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[32],
                Termination = Gates[51].Inputs[0],
                Name        = "G32 -> G51-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[32],
                Termination = Gates[66].Inputs[0],
                Name        = "G32 -> G66-0"
            });
            #endregion

            #region Gate 33 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[33],
                Termination = Gates[58].Inputs[0],
                Name        = "G33 -> G58-0"
            });
            #endregion

            #region Gate 34 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[34],
                Termination = Gates[59].Inputs[0],
                Name        = "G34 -> G59-0"
            });
            #endregion

            #region Gate 35 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[35],
                Termination = Gates[60].Inputs[0],
                Name        = "G35 -> G60-0"
            });
            #endregion

            #region Gate 36 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[36],
                Termination = Gates[61].Inputs[0],
                Name        = "G36 -> G61-0"
            });
            #endregion

            #region Gate 37 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[37],
                Termination = Gates[53].Inputs[0],
                Name        = "G37 -> G53-0"
            });
            #endregion

            #region Gate 38 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[38],
                Termination = Gates[53].Inputs[1],
                Name        = "G38 -> G53-1"
            });
            #endregion

            #region Gate 39 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[39],
                Termination = Gates[53].Inputs[2],
                Name        = "G39 -> G53-2"
            });
            #endregion

            #region Gate 40 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[40],
                Termination = Gates[53].Inputs[3],
                Name        = "G40 -> G53-3"
            });
            #endregion

            #region Gate 41 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[41],
                Termination = Gates[57].Inputs[1],
                Name        = "G41 -> G57-1"
            });
            #endregion

            #region Gate 43 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[43],
                Termination = Gates[54].Inputs[0],
                Name        = "G43 -> G54-0"
            });
            #endregion

            #region Gate 44 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[44],
                Termination = Gates[54].Inputs[1],
                Name        = "G44 -> G54-1"
            });
            #endregion

            #region Gate 45 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[45],
                Termination = Gates[54].Inputs[2],
                Name        = "G45 -> G54-2"
            });
            #endregion

            #region Gate 46 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[46],
                Termination = Gates[54].Inputs[3],
                Name        = "G46 -> G54-3"
            });
            #endregion

            #region Gate 47 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[47],
                Termination = Gates[55].Inputs[0],
                Name        = "G47 -> G55-0"
            });
            #endregion

            #region Gate 48 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[48],
                Termination = Gates[55].Inputs[1],
                Name        = "G48 -> G55-1"
            });
            #endregion

            #region Gate 49 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[49],
                Termination = Gates[55].Inputs[2],
                Name        = "G49 -> G55-2"
            });
            #endregion

            #region Gate 50 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[50],
                Termination = Gates[56].Inputs[0],
                Name        = "G50 -> G56-0"
            });
            #endregion

            #region Gate 51 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[51],
                Termination = Gates[56].Inputs[1],
                Name        = "G51 -> G56-1"
            });
            #endregion

            #region Gate 52 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[52],
                Termination = Gates[61].Inputs[1],
                Name        = "G52 -> G61-1"
            });
            #endregion

            #region Gate 53 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[53],
                Termination = Gates[57].Inputs[0],
                Name        = "G53 -> G57-0"
            });
            #endregion

            #region Gate 54 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[54],
                Termination = Gates[58].Inputs[1],
                Name        = "G54 -> G58-1"
            });
            #endregion

            #region Gate 55 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[55],
                Termination = Gates[59].Inputs[1],
                Name        = "G55 -> G59-1"
            });
            #endregion

            #region Gate 56 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[56],
                Termination = Gates[60].Inputs[1],
                Name        = "G56 -> G60-1"
            });
            #endregion

            #region Gate 58 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[58],
                Termination = Gates[62].Inputs[0],
                Name        = "G58 -> G62-0"
            });
            #endregion

            #region Gate 59 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[59],
                Termination = Gates[62].Inputs[1],
                Name        = "G59 -> G62-1"
            });
            #endregion

            #region Gate 60 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[60],
                Termination = Gates[62].Inputs[2],
                Name        = "G60 -> G62-2"
            });
            #endregion

            #region Gate 61 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[61],
                Termination = Gates[62].Inputs[3],
                Name        = "G61 -> G62-3"
            });
            #endregion

            #region Gate 63 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[63],
                Termination = Gates[33].Inputs[1],
                Name        = "G63 -> G33-1"
            });
            #endregion

            #region Gate 64 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[64],
                Termination = Gates[34].Inputs[1],
                Name        = "G64 -> G34-1"
            });
            #endregion

            #region Gate 65 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[65],
                Termination = Gates[35].Inputs[1],
                Name        = "G65 -> G35-1"
            });
            #endregion

            #region Gate 66 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[66],
                Termination = Gates[36].Inputs[1],
                Name        = "G66 -> G36-1"
            });
            #endregion
        }
Exemple #17
0
        public TTL7474(TTLGateTypeEnum gateType)
        {
            Gates.Add(new NandGate(gateType, 3)
            {
                CircuitName = "G0"
            });
            Gates.Add(new NandGate(gateType, 3)
            {
                CircuitName = "G1"
            });
            Gates.Add(new NandGate(gateType, 3)
            {
                CircuitName = "G2"
            });
            Gates.Add(new NandGate(gateType, 3)
            {
                CircuitName = "G3"
            });
            Gates.Add(new NandGate(gateType, 3)
            {
                CircuitName = "G4"
            });
            Gates.Add(new NandGate(gateType, 3)
            {
                CircuitName = "G5"
            });

            Gates.Add(new NandGate(gateType, 3)
            {
                CircuitName = "G6"
            });
            Gates.Add(new NandGate(gateType, 3)
            {
                CircuitName = "G7"
            });
            Gates.Add(new NandGate(gateType, 3)
            {
                CircuitName = "G8"
            });
            Gates.Add(new NandGate(gateType, 3)
            {
                CircuitName = "G9"
            });
            Gates.Add(new NandGate(gateType, 3)
            {
                CircuitName = "G10"
            });
            Gates.Add(new NandGate(gateType, 3)
            {
                CircuitName = "G11"
            });

            #region inputs

            Connections.Add(new Connection
            {
                Source      = PRE1,
                Termination = Gates[0].Inputs[0],
                Name        = "PRE1 -> G0-0"
            });

            Connections.Add(new Connection
            {
                Source      = PRE1,
                Termination = Gates[4].Inputs[0],
                Name        = "PRE1 -> G4-0"
            });

            Connections.Add(new Connection
            {
                Source      = CLR1,
                Termination = Gates[1].Inputs[1],
                Name        = "CLR1 -> G1-1"
            });

            Connections.Add(new Connection
            {
                Source      = CLR1,
                Termination = Gates[5].Inputs[1],
                Name        = "CLR1 -> G5-1"
            });

            Connections.Add(new Connection
            {
                Source      = CLR1,
                Termination = Gates[3].Inputs[1],
                Name        = "CLR1 -> G3-1"
            });

            Connections.Add(new Connection
            {
                Source      = CLK1,
                Termination = Gates[2].Inputs[1],
                Name        = "CLK1 -> G2-1"
            });

            Connections.Add(new Connection
            {
                Source      = CLK1,
                Termination = Gates[1].Inputs[2],
                Name        = "CLK1 -> G1-2"
            });

            Connections.Add(new Connection
            {
                Source      = D1,
                Termination = Gates[3].Inputs[2],
                Name        = "D1 -> G3-2"
            });

            // second unit
            Connections.Add(new Connection
            {
                Source      = PRE2,
                Termination = Gates[6].Inputs[0],
                Name        = "PRE2 -> G6-0"
            });

            Connections.Add(new Connection
            {
                Source      = PRE2,
                Termination = Gates[10].Inputs[0],
                Name        = "PRE2 -> G10-0"
            });

            Connections.Add(new Connection
            {
                Source      = CLR2,
                Termination = Gates[7].Inputs[1],
                Name        = "CLR2 -> G7-1"
            });

            Connections.Add(new Connection
            {
                Source      = CLR2,
                Termination = Gates[11].Inputs[1],
                Name        = "CLR2 -> G11-1"
            });

            Connections.Add(new Connection
            {
                Source      = CLR2,
                Termination = Gates[9].Inputs[1],
                Name        = "CLR2 -> G9-1"
            });

            Connections.Add(new Connection
            {
                Source      = CLK2,
                Termination = Gates[8].Inputs[1],
                Name        = "CLK2 -> G8-1"
            });

            Connections.Add(new Connection
            {
                Source      = CLK2,
                Termination = Gates[7].Inputs[2],
                Name        = "CLK2 -> G7-2"
            });

            Connections.Add(new Connection
            {
                Source      = D2,
                Termination = Gates[9].Inputs[2],
                Name        = "D2 -> G9-2"
            });
            #endregion

            #region Gate 0 outputs

            Connections.Add(new Connection
            {
                Source      = Gates[0],
                Termination = Gates[1].Inputs[0],
                Name        = "G0 -> G1-0"
            });
            #endregion

            #region Gate 1 outputs

            Connections.Add(new Connection
            {
                Source      = Gates[1],
                Termination = Gates[0].Inputs[2],
                Name        = "G1 -> G0-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[1],
                Termination = Gates[4].Inputs[1],
                Name        = "G1 -> G4-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[1],
                Termination = Gates[2].Inputs[0],
                Name        = "G1 -> G2-0"
            });
            #endregion

            #region Gate 2 outputs

            Connections.Add(new Connection
            {
                Source      = Gates[2],
                Termination = Gates[3].Inputs[0],
                Name        = "G2 -> G3-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[2],
                Termination = Gates[5].Inputs[2],
                Name        = "G2 -> G5-2"
            });
            #endregion

            #region Gate 3 outputs

            Connections.Add(new Connection
            {
                Source      = Gates[3],
                Termination = Gates[2].Inputs[2],
                Name        = "G3 -> G2-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[3],
                Termination = Gates[0].Inputs[1],
                Name        = "G3 -> G0-1"
            });
            #endregion

            #region Gate 4 outputs

            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[5].Inputs[0],
                Name        = "G4 -> G5-0"
            });
            #endregion

            #region Gate 5 outputs

            Connections.Add(new Connection
            {
                Source      = Gates[5],
                Termination = Gates[4].Inputs[2],
                Name        = "G5 -> G4-2"
            });
            #endregion

            #region Gate 6 outputs

            Connections.Add(new Connection
            {
                Source      = Gates[6],
                Termination = Gates[7].Inputs[0],
                Name        = "G6 -> G7-0"
            });
            #endregion

            #region Gate 7 outputs

            Connections.Add(new Connection
            {
                Source      = Gates[7],
                Termination = Gates[6].Inputs[2],
                Name        = "G7 -> G6-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[7],
                Termination = Gates[10].Inputs[1],
                Name        = "G7 -> G10-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[7],
                Termination = Gates[8].Inputs[0],
                Name        = "G7 -> G8-0"
            });
            #endregion

            #region Gate 8 outputs

            Connections.Add(new Connection
            {
                Source      = Gates[8],
                Termination = Gates[9].Inputs[0],
                Name        = "G8 -> G9-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[8],
                Termination = Gates[11].Inputs[2],
                Name        = "G8 -> G11-2"
            });
            #endregion

            #region Gate 9 outputs

            Connections.Add(new Connection
            {
                Source      = Gates[9],
                Termination = Gates[8].Inputs[2],
                Name        = "G9 -> G8-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[9],
                Termination = Gates[6].Inputs[1],
                Name        = "G9 -> G6-1"
            });
            #endregion

            #region Gate 10 outputs

            Connections.Add(new Connection
            {
                Source      = Gates[10],
                Termination = Gates[11].Inputs[0],
                Name        = "G10 -> G11-0"
            });
            #endregion

            #region Gate 11 outputs

            Connections.Add(new Connection
            {
                Source      = Gates[11],
                Termination = Gates[10].Inputs[2],
                Name        = "G11 -> G10-2"
            });
            #endregion
        }
Exemple #18
0
        public TTL74153(TTLGateTypeEnum gateType)
        {
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G0"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G1"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G2"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G3"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G4"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G5"
            });
            Gates.Add(new AndGate(gateType, 4)
            {
                CircuitName = "G6"
            });
            Gates.Add(new AndGate(gateType, 4)
            {
                CircuitName = "G7"
            });
            Gates.Add(new AndGate(gateType, 4)
            {
                CircuitName = "G8"
            });
            Gates.Add(new AndGate(gateType, 4)
            {
                CircuitName = "G9"
            });
            Gates.Add(new AndGate(gateType, 4)
            {
                CircuitName = "G10"
            });
            Gates.Add(new AndGate(gateType, 4)
            {
                CircuitName = "G11"
            });
            Gates.Add(new AndGate(gateType, 4)
            {
                CircuitName = "G12"
            });
            Gates.Add(new AndGate(gateType, 4)
            {
                CircuitName = "G13"
            });
            Gates.Add(new OrGate(gateType, 4)
            {
                CircuitName = "G14"
            });
            Gates.Add(new OrGate(gateType, 4)
            {
                CircuitName = "G15"
            });

            #region inputs

            Connections.Add(new Connection
            {
                Source      = Ea,
                Termination = Gates[0].Inputs[0],
                Name        = "Ea -> G0-0"
            });

            Connections.Add(new Connection
            {
                Source      = I0a,
                Termination = Gates[6].Inputs[3],
                Name        = "I0a -> G6-3"
            });

            Connections.Add(new Connection
            {
                Source      = I1a,
                Termination = Gates[7].Inputs[3],
                Name        = "I1a -> G7-3"
            });

            Connections.Add(new Connection
            {
                Source      = I2a,
                Termination = Gates[8].Inputs[3],
                Name        = "I2a -> G8-3"
            });

            Connections.Add(new Connection
            {
                Source      = I3a,
                Termination = Gates[9].Inputs[3],
                Name        = "I3a -> G9-3"
            });

            Connections.Add(new Connection
            {
                Source      = S1,
                Termination = Gates[1].Inputs[0],
                Name        = "S1 -> G1-0"
            });

            Connections.Add(new Connection
            {
                Source      = S0,
                Termination = Gates[2].Inputs[0],
                Name        = "S0 -> G2-0"
            });

            Connections.Add(new Connection
            {
                Source      = I0b,
                Termination = Gates[10].Inputs[0],
                Name        = "I0b -> G10-0"
            });

            Connections.Add(new Connection
            {
                Source      = I1b,
                Termination = Gates[11].Inputs[0],
                Name        = "I1b -> G11-0"
            });

            Connections.Add(new Connection
            {
                Source      = I2b,
                Termination = Gates[12].Inputs[0],
                Name        = "I2b -> G12-0"
            });

            Connections.Add(new Connection
            {
                Source      = I3b,
                Termination = Gates[13].Inputs[0],
                Name        = "I3b -> G13-0"
            });

            Connections.Add(new Connection
            {
                Source      = Eb,
                Termination = Gates[3].Inputs[0],
                Name        = "Eb -> G3-0"
            });
            #endregion

            #region Gate 0 outputs

            for (int i = 6; i < 10; i++)
            {
                Connections.Add(new Connection
                {
                    Source      = Gates[0],
                    Termination = Gates[i].Inputs[0],
                    Name        = $"G0 -> G{i}-0"
                });
            }

            #endregion

            #region Gate 1 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[1],
                Termination = Gates[4].Inputs[0],
                Name        = "G1 -> G4-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[1],
                Termination = Gates[6].Inputs[1],
                Name        = "G1 -> G6-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[1],
                Termination = Gates[7].Inputs[1],
                Name        = "G1 -> G7-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[1],
                Termination = Gates[10].Inputs[1],
                Name        = "G1 -> G10-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[1],
                Termination = Gates[11].Inputs[1],
                Name        = "G1 -> G11-1"
            });

            #endregion

            #region Gate 2 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[2],
                Termination = Gates[5].Inputs[0],
                Name        = "G2 -> G5-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[2],
                Termination = Gates[6].Inputs[2],
                Name        = "G2 -> G6-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[2],
                Termination = Gates[8].Inputs[2],
                Name        = "G2 -> G8-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[2],
                Termination = Gates[10].Inputs[2],
                Name        = "G2 -> G10-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[2],
                Termination = Gates[12].Inputs[2],
                Name        = "G2 -> G12-2"
            });
            #endregion

            #region Gate 3 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[3],
                Termination = Gates[10].Inputs[3],
                Name        = "G3 -> G10-3"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[3],
                Termination = Gates[11].Inputs[3],
                Name        = "G3 -> G11-3"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[3],
                Termination = Gates[12].Inputs[3],
                Name        = "G3 -> G12-3"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[3],
                Termination = Gates[13].Inputs[3],
                Name        = "G3 -> G13-3"
            });
            #endregion

            #region Gate 4 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[8].Inputs[1],
                Name        = "G4 -> G8-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[9].Inputs[1],
                Name        = "G4 -> G9-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[12].Inputs[1],
                Name        = "G4 -> G12-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[13].Inputs[1],
                Name        = "G4 -> G13-1"
            });
            #endregion

            #region Gate 5 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[5],
                Termination = Gates[7].Inputs[2],
                Name        = "G5 -> G7-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[5],
                Termination = Gates[9].Inputs[2],
                Name        = "G5 -> G9-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[5],
                Termination = Gates[11].Inputs[2],
                Name        = "G5 -> G11-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[5],
                Termination = Gates[13].Inputs[2],
                Name        = "G5 -> G13-2"
            });
            #endregion

            #region Gate 6 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[6],
                Termination = Gates[14].Inputs[0],
                Name        = "G6 -> G14-0"
            });
            #endregion

            #region Gate 7 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[7],
                Termination = Gates[14].Inputs[1],
                Name        = "G7 -> G14-1"
            });
            #endregion

            #region Gate 8 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[8],
                Termination = Gates[14].Inputs[2],
                Name        = "G8 -> G14-2"
            });
            #endregion

            #region Gate 9 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[9],
                Termination = Gates[14].Inputs[3],
                Name        = "G9 -> G14-3"
            });
            #endregion

            #region Gate 10 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[10],
                Termination = Gates[15].Inputs[0],
                Name        = "G10 -> G15-0"
            });
            #endregion

            #region Gate 11 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[11],
                Termination = Gates[15].Inputs[1],
                Name        = "G11 -> G15-1"
            });
            #endregion

            #region Gate 12 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[12],
                Termination = Gates[15].Inputs[2],
                Name        = "G12 -> G15-2"
            });
            #endregion

            #region Gate 13 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[13],
                Termination = Gates[15].Inputs[3],
                Name        = "G13 -> G15-3"
            });
            #endregion
        }
Exemple #19
0
 /// <summary>
 /// Adds the given gate to this physical circuit.
 /// </summary>
 /// <param name="gate"> The gate to add to this circuit. </param>
 /// <remarks>
 /// The given gate should be able to be executed on the the architecture
 /// of this physical circuit.
 /// </remarks>
 public void AddGate(Gate gate)
 {
     Gates.Add(gate);
     NbGates++;
     NbQubits = Math.Max(gate.GetMaxQubit(), NbQubits);
 }
Exemple #20
0
        public TTL74283(TTLGateTypeEnum gateType)
        {
            Name = "4-bit adder";

            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G0"
            });
            Gates.Add(new NorGate(gateType, 2)
            {
                CircuitName = "G1"
            });
            Gates.Add(new NandGate(gateType, 2)
            {
                CircuitName = "G2"
            });

            Gates.Add(new NorGate(gateType, 2)
            {
                CircuitName = "G3"
            });
            Gates.Add(new NandGate(gateType, 2)
            {
                CircuitName = "G4"
            });

            Gates.Add(new NorGate(gateType, 2)
            {
                CircuitName = "G5"
            });
            Gates.Add(new NandGate(gateType, 2)
            {
                CircuitName = "G6"
            });

            Gates.Add(new NorGate(gateType, 2)
            {
                CircuitName = "G7"
            });
            Gates.Add(new NandGate(gateType, 2)
            {
                CircuitName = "G8"
            });

            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G9"
            });
            Gates.Add(new AndGate(gateType, 2)
            {
                CircuitName = "G10"
            });
            Gates[10].Inputs[1].InputInverted = true;


            Gates.Add(new AndGate(gateType, 2)
            {
                CircuitName = "G11"
            });
            Gates.Add(new LogicLibrary.Buffer(gateType)
            {
                CircuitName = "G12"
            });

            Gates.Add(new AndGate(gateType, 2)
            {
                CircuitName = "G13"
            });
            Gates[13].Inputs[1].InputInverted = true;
            Gates.Add(new AndGate(gateType, 3)
            {
                CircuitName = "G14"
            });
            Gates.Add(new AndGate(gateType, 2)
            {
                CircuitName = "G15"
            });
            Gates.Add(new LogicLibrary.Buffer(gateType)
            {
                CircuitName = "G16"
            });

            Gates.Add(new AndGate(gateType, 2)
            {
                CircuitName = "G17"
            });
            Gates[17].Inputs[1].InputInverted = true;
            Gates.Add(new AndGate(gateType, 4)
            {
                CircuitName = "G18"
            });
            Gates.Add(new AndGate(gateType, 3)
            {
                CircuitName = "G19"
            });
            Gates.Add(new AndGate(gateType, 2)
            {
                CircuitName = "G20"
            });
            Gates.Add(new LogicLibrary.Buffer(gateType)
            {
                CircuitName = "G21"
            });

            Gates.Add(new AndGate(gateType, 2)
            {
                CircuitName = "G22"
            });
            Gates[22].Inputs[1].InputInverted = true;
            Gates.Add(new AndGate(gateType, 5)
            {
                CircuitName = "G23"
            });
            Gates.Add(new AndGate(gateType, 4)
            {
                CircuitName = "G24"
            });
            Gates.Add(new AndGate(gateType, 3)
            {
                CircuitName = "G25"
            });
            Gates.Add(new AndGate(gateType, 2)
            {
                CircuitName = "G26"
            });
            Gates.Add(new LogicLibrary.Buffer(gateType)
            {
                CircuitName = "G27"
            });

            Gates.Add(new NorGate(gateType, 2)
            {
                CircuitName = "G28"
            });
            Gates.Add(new NorGate(gateType, 3)
            {
                CircuitName = "G29"
            });
            Gates.Add(new NorGate(gateType, 4)
            {
                CircuitName = "G30"
            });
            Gates.Add(new NorGate(gateType, 5)
            {
                CircuitName = "G31"
            });

            Gates.Add(new XorGate(gateType, 2)
            {
                CircuitName = "G32"
            });
            Gates.Add(new XorGate(gateType, 2)
            {
                CircuitName = "G33"
            });
            Gates.Add(new XorGate(gateType, 2)
            {
                CircuitName = "G34"
            });
            Gates.Add(new XorGate(gateType, 2)
            {
                CircuitName = "G35"
            });

            #region inputs
            Connections.Add(new Connection
            {
                Source      = Cin,
                Termination = Gates[0].Inputs[0],
                Name        = "Cin -> G0-0"
            });

            Connections.Add(new Connection
            {
                Source      = A1,
                Termination = Gates[1].Inputs[1],
                Name        = "A1 -> G1-1"
            });

            Connections.Add(new Connection
            {
                Source      = A1,
                Termination = Gates[2].Inputs[0],
                Name        = "A1 -> G2-0"
            });

            Connections.Add(new Connection
            {
                Source      = B1,
                Termination = Gates[1].Inputs[0],
                Name        = "B1 -> G1-0"
            });

            Connections.Add(new Connection
            {
                Source      = B1,
                Termination = Gates[2].Inputs[1],
                Name        = "B1 -> G2-1"
            });

            Connections.Add(new Connection
            {
                Source      = A2,
                Termination = Gates[3].Inputs[1],
                Name        = "A2 -> G3-1"
            });

            Connections.Add(new Connection
            {
                Source      = A2,
                Termination = Gates[4].Inputs[0],
                Name        = "A2 -> G4-0"
            });

            Connections.Add(new Connection
            {
                Source      = B2,
                Termination = Gates[3].Inputs[0],
                Name        = "B2 -> G3-0"
            });

            Connections.Add(new Connection
            {
                Source      = B2,
                Termination = Gates[4].Inputs[1],
                Name        = "B2 -> G4-1"
            });

            Connections.Add(new Connection
            {
                Source      = A3,
                Termination = Gates[5].Inputs[1],
                Name        = "A3 -> G5-1"
            });

            Connections.Add(new Connection
            {
                Source      = A3,
                Termination = Gates[6].Inputs[0],
                Name        = "A3 -> G6-0"
            });

            Connections.Add(new Connection
            {
                Source      = B3,
                Termination = Gates[5].Inputs[0],
                Name        = "B3 -> G5-0"
            });

            Connections.Add(new Connection
            {
                Source      = B3,
                Termination = Gates[6].Inputs[1],
                Name        = "B3 -> G6-1"
            });

            Connections.Add(new Connection
            {
                Source      = A4,
                Termination = Gates[7].Inputs[1],
                Name        = "A4 -> G7-1"
            });

            Connections.Add(new Connection
            {
                Source      = A4,
                Termination = Gates[8].Inputs[0],
                Name        = "A4 -> G8-0"
            });

            Connections.Add(new Connection
            {
                Source      = B4,
                Termination = Gates[7].Inputs[0],
                Name        = "B4 -> G7-0"
            });

            Connections.Add(new Connection
            {
                Source      = B4,
                Termination = Gates[8].Inputs[1],
                Name        = "B4 -> G8-1"
            });
            #endregion

            #region gate 0 output
            Connections.Add(new Connection
            {
                Source      = Gates[0],
                Termination = Gates[9].Inputs[0],
                Name        = "G0 -> G9-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[0],
                Termination = Gates[11].Inputs[1],
                Name        = "G0 -> G11-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[0],
                Termination = Gates[14].Inputs[2],
                Name        = "G0 -> G14-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[0],
                Termination = Gates[18].Inputs[3],
                Name        = "G0 -> G18-3"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[0],
                Termination = Gates[23].Inputs[4],
                Name        = "G0 -> G23-4"
            });
            #endregion

            #region gate 1 output
            Connections.Add(new Connection
            {
                Source      = Gates[1],
                Termination = Gates[10].Inputs[1],
                Name        = "G1 -> G10-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[1],
                Termination = Gates[12].Inputs[0],
                Name        = "G1 -> G12-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[1],
                Termination = Gates[15].Inputs[0],
                Name        = "G1 -> G15-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[1],
                Termination = Gates[19].Inputs[0],
                Name        = "G1 -> G19-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[1],
                Termination = Gates[24].Inputs[0],
                Name        = "G1 -> G24-0"
            });
            #endregion

            #region gate 2 output
            Connections.Add(new Connection
            {
                Source      = Gates[2],
                Termination = Gates[10].Inputs[0],
                Name        = "G2 -> G10-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[2],
                Termination = Gates[11].Inputs[0],
                Name        = "G2 -> G11-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[2],
                Termination = Gates[14].Inputs[1],
                Name        = "G2 -> G14-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[2],
                Termination = Gates[18].Inputs[2],
                Name        = "G2 -> G18-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[2],
                Termination = Gates[23].Inputs[3],
                Name        = "G2 -> G23-3"
            });
            #endregion

            #region gate 3 output
            Connections.Add(new Connection
            {
                Source      = Gates[3],
                Termination = Gates[13].Inputs[1],
                Name        = "G3 -> G13-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[3],
                Termination = Gates[16].Inputs[0],
                Name        = "G3 -> G16-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[3],
                Termination = Gates[20].Inputs[0],
                Name        = "G3 -> G20-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[3],
                Termination = Gates[25].Inputs[0],
                Name        = "G3 -> G25-0"
            });
            #endregion

            #region gate 4 output
            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[13].Inputs[0],
                Name        = "G4 -> G13-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[14].Inputs[0],
                Name        = "G4 -> G14-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[15].Inputs[1],
                Name        = "G4 -> G15-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[18].Inputs[1],
                Name        = "G4 -> G18-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[19].Inputs[2],
                Name        = "G4 -> G19-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[23].Inputs[2],
                Name        = "G4 -> G23-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[24].Inputs[3],
                Name        = "G4 -> G24-3"
            });
            #endregion

            #region gate 5 output
            Connections.Add(new Connection
            {
                Source      = Gates[5],
                Termination = Gates[17].Inputs[1],
                Name        = "G5 -> G17-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[5],
                Termination = Gates[21].Inputs[0],
                Name        = "G5 -> G21-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[5],
                Termination = Gates[26].Inputs[0],
                Name        = "G5 -> G26-0"
            });
            #endregion

            #region gate 6 output
            Connections.Add(new Connection
            {
                Source      = Gates[6],
                Termination = Gates[17].Inputs[0],
                Name        = "G6 -> G17-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[6],
                Termination = Gates[18].Inputs[0],
                Name        = "G6 -> G18-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[6],
                Termination = Gates[19].Inputs[1],
                Name        = "G6 -> G19-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[6],
                Termination = Gates[20].Inputs[1],
                Name        = "G6 -> G20-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[6],
                Termination = Gates[23].Inputs[1],
                Name        = "G6 -> G23-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[6],
                Termination = Gates[24].Inputs[2],
                Name        = "G6 -> G24-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[6],
                Termination = Gates[25].Inputs[2],
                Name        = "G6 -> G25-2"
            });
            #endregion

            #region gate 7 output
            Connections.Add(new Connection
            {
                Source      = Gates[7],
                Termination = Gates[22].Inputs[1],
                Name        = "G7 -> G22-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[7],
                Termination = Gates[27].Inputs[0],
                Name        = "G7 -> G27-0"
            });
            #endregion

            #region gate 8 output
            Connections.Add(new Connection
            {
                Source      = Gates[8],
                Termination = Gates[22].Inputs[0],
                Name        = "G8 -> G22-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[8],
                Termination = Gates[23].Inputs[0],
                Name        = "G8 -> G23-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[8],
                Termination = Gates[24].Inputs[1],
                Name        = "G8 -> G24-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[8],
                Termination = Gates[25].Inputs[1],
                Name        = "G8 -> G25-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[8],
                Termination = Gates[26].Inputs[1],
                Name        = "G8 -> G26-1"
            });
            #endregion

            #region gate 9 output
            Connections.Add(new Connection
            {
                Source      = Gates[9],
                Termination = Gates[32].Inputs[1],
                Name        = "G9 -> G32-1"
            });
            #endregion

            #region gate 10 output
            Connections.Add(new Connection
            {
                Source      = Gates[10],
                Termination = Gates[32].Inputs[0],
                Name        = "G10 -> G32-0"
            });
            #endregion

            #region gate 11 output
            Connections.Add(new Connection
            {
                Source      = Gates[11],
                Termination = Gates[28].Inputs[1],
                Name        = "G11 -> G28-1"
            });
            #endregion

            #region gate 12 output
            Connections.Add(new Connection
            {
                Source      = Gates[12],
                Termination = Gates[28].Inputs[0],
                Name        = "G12 -> G28-0"
            });
            #endregion

            #region gate 13 output
            Connections.Add(new Connection
            {
                Source      = Gates[13],
                Termination = Gates[33].Inputs[0],
                Name        = "G13 -> G33-0"
            });
            #endregion

            #region gate 14 output
            Connections.Add(new Connection
            {
                Source      = Gates[14],
                Termination = Gates[29].Inputs[2],
                Name        = "G14 -> G29-2"
            });
            #endregion

            #region gate 15 output
            Connections.Add(new Connection
            {
                Source      = Gates[15],
                Termination = Gates[29].Inputs[1],
                Name        = "G15 -> G29-1"
            });
            #endregion

            #region gate 16 output
            Connections.Add(new Connection
            {
                Source      = Gates[16],
                Termination = Gates[29].Inputs[0],
                Name        = "G16 -> G29-0"
            });
            #endregion

            #region gate 17 output
            Connections.Add(new Connection
            {
                Source      = Gates[17],
                Termination = Gates[34].Inputs[0],
                Name        = "G17 -> G34-0"
            });
            #endregion

            #region gate 18 output
            Connections.Add(new Connection
            {
                Source      = Gates[18],
                Termination = Gates[30].Inputs[3],
                Name        = "G18 -> G30-3"
            });
            #endregion

            #region gate 19 output
            Connections.Add(new Connection
            {
                Source      = Gates[19],
                Termination = Gates[30].Inputs[2],
                Name        = "G19 -> G30-2"
            });
            #endregion

            #region gate 20 output
            Connections.Add(new Connection
            {
                Source      = Gates[20],
                Termination = Gates[30].Inputs[1],
                Name        = "G20 -> G30-1"
            });
            #endregion

            #region gate 21 output
            Connections.Add(new Connection
            {
                Source      = Gates[21],
                Termination = Gates[30].Inputs[0],
                Name        = "G21 -> G30-0"
            });
            #endregion

            #region gate 22 output
            Connections.Add(new Connection
            {
                Source      = Gates[22],
                Termination = Gates[35].Inputs[0],
                Name        = "G22 -> G35-0"
            });
            #endregion

            #region gate 23 output
            Connections.Add(new Connection
            {
                Source      = Gates[23],
                Termination = Gates[31].Inputs[4],
                Name        = "G23 -> G31-4"
            });
            #endregion

            #region gate 24 output
            Connections.Add(new Connection
            {
                Source      = Gates[24],
                Termination = Gates[31].Inputs[3],
                Name        = "G24 -> G31-3"
            });
            #endregion

            #region gate 25 output
            Connections.Add(new Connection
            {
                Source      = Gates[25],
                Termination = Gates[31].Inputs[2],
                Name        = "G25 -> G31-2"
            });
            #endregion

            #region gate 26 output
            Connections.Add(new Connection
            {
                Source      = Gates[26],
                Termination = Gates[31].Inputs[1],
                Name        = "G26 -> G31-1"
            });
            #endregion

            #region gate 27 output
            Connections.Add(new Connection
            {
                Source      = Gates[27],
                Termination = Gates[31].Inputs[0],
                Name        = "G27 -> G31-0"
            });
            #endregion

            #region gate 28 output
            Connections.Add(new Connection
            {
                Source      = Gates[28],
                Termination = Gates[33].Inputs[1],
                Name        = "G28 -> G33-1"
            });
            #endregion

            #region gate 29 output
            Connections.Add(new Connection
            {
                Source      = Gates[29],
                Termination = Gates[34].Inputs[1],
                Name        = "G29 -> G34-1"
            });
            #endregion

            #region gate 30 output
            Connections.Add(new Connection
            {
                Source      = Gates[30],
                Termination = Gates[35].Inputs[1],
                Name        = "G30 -> G35-1"
            });
            #endregion
        }
Exemple #21
0
        public TTL7447(TTLGateTypeEnum gateType)
        {
            Gates.Add(new NandGate(gateType, 2)
            {
                CircuitName = "G0"
            });
            Gates.Add(new NandGate(gateType, 2)
            {
                CircuitName = "G1"
            });
            Gates.Add(new NandGate(gateType, 2)
            {
                CircuitName = "G2"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G3"
            });
            Gates.Add(new NandGate(gateType, 2)
            {
                CircuitName = "G4"
            });
            Gates.Add(new NandGate(gateType, 2)
            {
                CircuitName = "G5"
            });
            Gates.Add(new NandGate(gateType, 2)
            {
                CircuitName = "G6"
            });
            Gates.Add(new NandGate(gateType, 2)
            {
                CircuitName = "G7"
            });
            Gates.Add(new Buffer(gateType)
            {
                CircuitName = "G8"
            });
            Gates.Add(new NandGate(gateType, 6)
            {
                CircuitName = "G9"
            });
            Gates.Add(new Buffer(gateType)
            {
                CircuitName = "G10"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G11"
            });

            Gates.Add(new AndGate(gateType, 2)
            {
                CircuitName = "G12"
            });
            Gates.Add(new AndGate(gateType, 2)
            {
                CircuitName = "G13"
            });
            Gates.Add(new AndGate(gateType, 4)
            {
                CircuitName = "G14"
            });
            Gates.Add(new AndGate(gateType, 2)
            {
                CircuitName = "G15"
            });
            Gates.Add(new AndGate(gateType, 3)
            {
                CircuitName = "G16"
            });
            Gates.Add(new AndGate(gateType, 3)
            {
                CircuitName = "G17"
            });
            Gates.Add(new AndGate(gateType, 2)
            {
                CircuitName = "G18"
            });
            Gates.Add(new AndGate(gateType, 3)
            {
                CircuitName = "G19"
            });
            Gates.Add(new AndGate(gateType, 3)
            {
                CircuitName = "G10"
            });
            Gates.Add(new AndGate(gateType, 3)
            {
                CircuitName = "G21"
            });
            Gates.Add(new AndGate(gateType, 3)
            {
                CircuitName = "G22"
            });
            Gates.Add(new Buffer(gateType)
            {
                CircuitName = "G23"
            });
            Gates.Add(new AndGate(gateType, 2)
            {
                CircuitName = "G24"
            });
            Gates.Add(new AndGate(gateType, 2)
            {
                CircuitName = "G25"
            });
            Gates.Add(new AndGate(gateType, 2)
            {
                CircuitName = "G26"
            });
            Gates.Add(new AndGate(gateType, 3)
            {
                CircuitName = "G27"
            });
            Gates.Add(new AndGate(gateType, 3)
            {
                CircuitName = "G28"
            });
            Gates.Add(new AndGate(gateType, 4)
            {
                CircuitName = "G29"
            });

            Gates.Add(new NorGate(gateType, 3)
            {
                CircuitName = "G30"
            });
            Gates.Add(new NorGate(gateType, 3)
            {
                CircuitName = "G31"
            });
            Gates.Add(new NorGate(gateType, 2)
            {
                CircuitName = "G32"
            });
            Gates.Add(new NorGate(gateType, 3)
            {
                CircuitName = "G33"
            });
            Gates.Add(new NorGate(gateType, 2)
            {
                CircuitName = "G34"
            });
            Gates.Add(new NorGate(gateType, 3)
            {
                CircuitName = "G35"
            });
            Gates.Add(new NorGate(gateType, 2)
            {
                CircuitName = "G36"
            });

            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G37"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G38"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G39"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G40"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G41"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G42"
            });
            Gates.Add(new Inverter(gateType)
            {
                CircuitName = "G43"
            });

            #region inputs
            Connections.Add(new Connection
            {
                Source      = A,
                Termination = Gates[0].Inputs[0],
                Name        = "G0-0"
            });

            Connections.Add(new Connection
            {
                Source      = B,
                Termination = Gates[1].Inputs[0],
                Name        = "G1-0"
            });

            Connections.Add(new Connection
            {
                Source      = C,
                Termination = Gates[2].Inputs[0],
                Name        = "G2-0"
            });

            Connections.Add(new Connection
            {
                Source      = D,
                Termination = Gates[3].Inputs[0],
                Name        = "G3-0"
            });

            Connections.Add(new Connection
            {
                Source      = LampTest,
                Termination = Gates[10].Inputs[0],
                Name        = "G10-0"
            });

            Connections.Add(new Connection
            {
                Source      = RBI,
                Termination = Gates[11].Inputs[0],
                Name        = "G11-0"
            });
            #endregion

            #region Gate 0 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[0],
                Termination = Gates[4].Inputs[0],
                Name        = "G4-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[0],
                Termination = Gates[13].Inputs[0],
                Name        = "G13-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[0],
                Termination = Gates[17].Inputs[0],
                Name        = "G17-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[0],
                Termination = Gates[19].Inputs[0],
                Name        = "G19-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[0],
                Termination = Gates[21].Inputs[0],
                Name        = "G21-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[0],
                Termination = Gates[9].Inputs[5],
                Name        = "G9-5"
            });
            #endregion

            #region Gate 1 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[1],
                Termination = Gates[5].Inputs[0],
                Name        = "G5-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[1],
                Termination = Gates[14].Inputs[1],
                Name        = "G14-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[1],
                Termination = Gates[16].Inputs[1],
                Name        = "G16-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[1],
                Termination = Gates[20].Inputs[1],
                Name        = "G20-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[1],
                Termination = Gates[21].Inputs[1],
                Name        = "G21-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[1],
                Termination = Gates[24].Inputs[0],
                Name        = "G24-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[1],
                Termination = Gates[29].Inputs[0],
                Name        = "G29-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[1],
                Termination = Gates[9].Inputs[4],
                Name        = "G9-4"
            });
            #endregion

            #region Gate 2 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[2],
                Termination = Gates[6].Inputs[0],
                Name        = "G6-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[2],
                Termination = Gates[14].Inputs[2],
                Name        = "G14-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[2],
                Termination = Gates[19].Inputs[2],
                Name        = "G19-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[2],
                Termination = Gates[20].Inputs[2],
                Name        = "G20-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[2],
                Termination = Gates[26].Inputs[1],
                Name        = "G26-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[2],
                Termination = Gates[27].Inputs[1],
                Name        = "G27-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[2],
                Termination = Gates[29].Inputs[1],
                Name        = "G29-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[2],
                Termination = Gates[9].Inputs[3],
                Name        = "G9-3"
            });
            #endregion

            #region Gate 3 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[3],
                Termination = Gates[7].Inputs[0],
                Name        = "G7-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[3],
                Termination = Gates[14].Inputs[3],
                Name        = "G14-3"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[3],
                Termination = Gates[27].Inputs[2],
                Name        = "G27-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[3],
                Termination = Gates[29].Inputs[2],
                Name        = "G29-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[3],
                Termination = Gates[9].Inputs[2],
                Name        = "G9-2"
            });
            #endregion

            #region Gate 4 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[14].Inputs[0],
                Name        = "G14-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[16].Inputs[0],
                Name        = "G16-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[20].Inputs[0],
                Name        = "G20-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[22].Inputs[0],
                Name        = "G22-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[23].Inputs[0],
                Name        = "G23-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[25].Inputs[0],
                Name        = "G25-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[27].Inputs[0],
                Name        = "G27-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[4],
                Termination = Gates[28].Inputs[0],
                Name        = "G28-0"
            });
            #endregion

            #region Gate 5 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[5],
                Termination = Gates[12].Inputs[0],
                Name        = "G12-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[5],
                Termination = Gates[15].Inputs[0],
                Name        = "G15-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[5],
                Termination = Gates[17].Inputs[1],
                Name        = "G17-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[5],
                Termination = Gates[19].Inputs[1],
                Name        = "G19-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[5],
                Termination = Gates[22].Inputs[1],
                Name        = "G22-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[5],
                Termination = Gates[25].Inputs[1],
                Name        = "G25-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[5],
                Termination = Gates[26].Inputs[0],
                Name        = "G26-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[5],
                Termination = Gates[28].Inputs[1],
                Name        = "G28-1"
            });
            #endregion

            #region Gate 6 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[6],
                Termination = Gates[13].Inputs[1],
                Name        = "G13-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[6],
                Termination = Gates[16].Inputs[2],
                Name        = "G16-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[6],
                Termination = Gates[17].Inputs[2],
                Name        = "G17-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[6],
                Termination = Gates[18].Inputs[0],
                Name        = "G18-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[6],
                Termination = Gates[21].Inputs[2],
                Name        = "G21-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[6],
                Termination = Gates[22].Inputs[2],
                Name        = "G22-2"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[6],
                Termination = Gates[24].Inputs[1],
                Name        = "G24-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[6],
                Termination = Gates[28].Inputs[2],
                Name        = "G28-2"
            });
            #endregion

            #region Gate 7 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[7],
                Termination = Gates[12].Inputs[1],
                Name        = "G12-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[7],
                Termination = Gates[15].Inputs[1],
                Name        = "G15-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[7],
                Termination = Gates[18].Inputs[1],
                Name        = "G18-1"
            });
            #endregion

            #region Gate 8 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[8],
                Termination = Gates[7].Inputs[1],
                Name        = "G7-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[8],
                Termination = Gates[6].Inputs[1],
                Name        = "G6-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[8],
                Termination = Gates[5].Inputs[1],
                Name        = "G5-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[8],
                Termination = Gates[4].Inputs[1],
                Name        = "G4-1"
            });
            #endregion

            #region Gate 9 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[9],
                Termination = Gates[8].Inputs[0],
                Name        = "G8-0"
            });
            #endregion

            #region Gate 10 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[10],
                Termination = Gates[9].Inputs[0],
                Name        = "G9-0"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[10],
                Termination = Gates[0].Inputs[1],
                Name        = "G0-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[10],
                Termination = Gates[1].Inputs[1],
                Name        = "G1-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[10],
                Termination = Gates[2].Inputs[1],
                Name        = "G2-1"
            });

            Connections.Add(new Connection
            {
                Source      = Gates[10],
                Termination = Gates[29].Inputs[3],
                Name        = "G29-3"
            });
            #endregion

            #region Gate 11 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[11],
                Termination = Gates[9].Inputs[1],
                Name        = "G9-1"
            });
            #endregion

            #region Gate 12 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[12],
                Termination = Gates[30].Inputs[0],
                Name        = "G30-0"
            });
            #endregion

            #region Gate 13 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[13],
                Termination = Gates[30].Inputs[1],
                Name        = "G30-1"
            });
            #endregion

            #region Gate 14 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[14],
                Termination = Gates[30].Inputs[2],
                Name        = "G30-2"
            });
            #endregion

            #region Gate 15 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[15],
                Termination = Gates[31].Inputs[0],
                Name        = "G31-0"
            });
            #endregion

            #region Gate 16 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[16],
                Termination = Gates[31].Inputs[1],
                Name        = "G31-1"
            });
            #endregion

            #region Gate 17 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[17],
                Termination = Gates[31].Inputs[2],
                Name        = "G31-2"
            });
            #endregion

            #region Gate 18 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[18],
                Termination = Gates[32].Inputs[0],
                Name        = "G32-0"
            });
            #endregion

            #region Gate 19 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[19],
                Termination = Gates[32].Inputs[1],
                Name        = "G32-1"
            });
            #endregion

            #region Gate 20 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[20],
                Termination = Gates[33].Inputs[0],
                Name        = "G33-0"
            });
            #endregion

            #region Gate 21 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[21],
                Termination = Gates[33].Inputs[1],
                Name        = "G33-1"
            });
            #endregion

            #region Gate 22 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[22],
                Termination = Gates[33].Inputs[2],
                Name        = "G33-2"
            });
            #endregion

            #region Gate 23 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[23],
                Termination = Gates[34].Inputs[0],
                Name        = "G34-0"
            });
            #endregion

            #region Gate 24 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[24],
                Termination = Gates[34].Inputs[1],
                Name        = "G34-1"
            });
            #endregion

            #region Gate 25 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[25],
                Termination = Gates[35].Inputs[0],
                Name        = "G35-0"
            });
            #endregion

            #region Gate 26 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[26],
                Termination = Gates[35].Inputs[1],
                Name        = "G35-1"
            });
            #endregion

            #region Gate 27 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[27],
                Termination = Gates[35].Inputs[2],
                Name        = "G35-2"
            });
            #endregion

            #region Gate 28 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[28],
                Termination = Gates[36].Inputs[0],
                Name        = "G36-0"
            });
            #endregion

            #region Gate 29 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[29],
                Termination = Gates[36].Inputs[1],
                Name        = "G36-1"
            });
            #endregion

            #region Gate 30 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[30],
                Termination = Gates[37].Inputs[0],
                Name        = "G37-0"
            });
            #endregion

            #region Gate 31 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[31],
                Termination = Gates[38].Inputs[0],
                Name        = "G38-0"
            });
            #endregion

            #region Gate 32 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[32],
                Termination = Gates[39].Inputs[0],
                Name        = "G39-0"
            });
            #endregion

            #region Gate 33 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[33],
                Termination = Gates[40].Inputs[0],
                Name        = "G40-0"
            });
            #endregion

            #region Gate 34 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[34],
                Termination = Gates[41].Inputs[0],
                Name        = "G41-0"
            });
            #endregion

            #region Gate 35 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[35],
                Termination = Gates[42].Inputs[0],
                Name        = "G42-0"
            });
            #endregion

            #region Gate 36 outputs
            Connections.Add(new Connection
            {
                Source      = Gates[36],
                Termination = Gates[43].Inputs[0],
                Name        = "G43-0"
            });
            #endregion
        }