Beispiel #1
0
        public Sub4()
        {
            input0 = new Nibble();
            input1 = new Nibble();
            output0 = new Nibble();
            borrow = new Bit();
            borrow.Bittype = Bit.BitType.Output;

            input0.Deletable = false;
            input0.Draggable = false;

            input1.Deletable = false;
            input1.Draggable = false;

            output0.Deletable = false;
            output0.Draggable = false;

            borrow.Deletable = false;
            borrow.Draggable = false;

            fs1 = new FullSubtractor();
            fs2 = new FullSubtractor();
            fs3 = new FullSubtractor();
            fs4 = new FullSubtractor();

            Connections.CrossConnect(input0.OutputPoint0, fs1.Input0);
            Connections.CrossConnect(input1.OutputPoint0, fs1.Input1);
            Connections.CrossConnect(fs1.OutputB, fs2.InputB);
            Connections.CrossConnect(input0.OutputPoint1, fs2.Input0);
            Connections.CrossConnect(input1.OutputPoint1, fs2.Input1);
            Connections.CrossConnect(fs2.OutputB, fs3.InputB);
            Connections.CrossConnect(input0.OutputPoint2, fs3.Input0);
            Connections.CrossConnect(input1.OutputPoint2, fs3.Input1);
            Connections.CrossConnect(fs3.OutputB, fs4.InputB);
            Connections.CrossConnect(input0.OutputPoint3, fs4.Input0);
            Connections.CrossConnect(input1.OutputPoint3, fs4.Input1);
            Connections.CrossConnect(fs4.OutputB, borrow.InputPoint);
            Connections.CrossConnect(fs1.OutputS, output0.InputPoint0);
            Connections.CrossConnect(fs2.OutputS, output0.InputPoint1);
            Connections.CrossConnect(fs3.OutputS, output0.InputPoint2);
            Connections.CrossConnect(fs4.OutputS, output0.InputPoint3);

            fs1.InputB.IO = false;

            this.Controls.Add(input0);
            this.Controls.Add(input1);
            this.Controls.Add(output0);
            this.Controls.Add(borrow);

            this.ContextMenuStrip = cms;
        }
 private void fullSubtractorToolStripMenuItem_Click(object sender, EventArgs e)
 {
     FullSubtractor fulls = new FullSubtractor();
     fulls.Location = calcLocation();
     fulls.Size = s.Equals(LogicGate.small) ? LGComponent.small : s.Equals(LogicGate.medium) ? LGComponent.medium : LGComponent.large;
     fulls.Font = new Font(fulls.Font.FontFamily, fs);
     fulls.Name = fulls.GetType().Name + namecntr++;
     this.Controls.Add(fulls);
 }