Ejemplo n.º 1
0
        public BitwiseMultiwayDemux(int iSize, int cControlBits)
        {
            Size    = iSize;
            Input   = new WireSet(Size);
            Control = new WireSet(cControlBits);
            Outputs = new WireSet[(int)Math.Pow(2, cControlBits)];
            for (int i = 0; i < Outputs.Length; i++)
            {
                Outputs[i] = new WireSet(Size);
            }
            //your code here
            ControlBits          = cControlBits;
            m_multiwayDemuxGates = new MultiwayDemuxGate[Size];
            for (int i = 0; i < Size; i++)
            {
                var multiwayDemuxGate = new MultiwayDemuxGate(ControlBits);
                m_multiwayDemuxGates[i] = multiwayDemuxGate;

                multiwayDemuxGate.ConnectInput(Input[i]);
                multiwayDemuxGate.ConnectControl(Control);
                for (int j = 0; j < Outputs.Length; j++)
                {
                    Outputs[j][i].ConnectInput(multiwayDemuxGate.Outputs[j]);
                }
            }
        }
Ejemplo n.º 2
0
Archivo: Memory.cs Proyecto: boaz23/ECS
 private void ConnectWritingDemux()
 {
     m_addressDemux = new MultiwayDemuxGate(AddressSize);
     m_addressDemux.ConnectControl(Address);
     m_addressDemux.ConnectInput(Load);
 }