Example #1
0
    public NOTX(string parameters) : base(2)
    {
        var size = byte.Parse(parameters);

        IOGroups.Add(Input, new SchemeIOGroup(size, IO.Input));
        IOGroups.Add(Output, new SchemeIOGroup(size, IO.Output));
        IOGroups[Output].IOArray.SetAll(true);
    }
Example #2
0
    public void AddIOGroup(UIIOGroupBuildInfo ioGroupBuildInfo)
    {
        var ioGroupContainer = new IOGroupContainer(ioGroupBuildInfo, Self);

        IOGroups.Add(ioGroupContainer.BuildInfo.BuildString.Name, ioGroupContainer.IOGroup);
        IOGroupsInfo.Add(ioGroupContainer);

        ioGroupContainer.Design = SchemeDesigner.Instance.CreateSelfIOGroupDesign(ioGroupContainer);
    }
Example #3
0
    public RAMX(string parameters) : base(4)
    {
        var sizes       = parameters.Split(' ');
        var valueSize   = byte.Parse(sizes[0]);
        var addressSize = byte.Parse(sizes[1]);
        var valuesTotal = Extensions.Pow(2, addressSize);
        var totalSize   = valuesTotal * valueSize;

        if (totalSize > MaxSize)
        {
            throw new UnityException("Превышен максимальный размер RAM");
        }
        IOGroups.Add(Input, new SchemeIOGroup(valueSize, IO.Input));
        IOGroups.Add(Address, new SchemeIOGroup(addressSize, IO.Input));
        IOGroups.Add(Load, new SchemeIOGroup(1, IO.Input));
        IOGroups.Add(Output, new SchemeIOGroup(valueSize, IO.Output));
        CycleManager.Instance.Tick += OnTick;
        mRam = new BitArray[valuesTotal];
        for (int i = 0; i < valuesTotal; i++)
        {
            mRam[i] = new BitArray(valueSize);
        }
    }
Example #4
0
 public SimulationStop(bool enabled) : base(1)
 {
     IOGroups.Add(Input, new SchemeIOGroup(1, IO.Input));
     CycleManager.Instance.Tick += OnTick;
     Enabled = enabled;
 }
Example #5
0
 public DFF() : base(2)
 {
     IOGroups.Add(Input, new SchemeIOGroup(1, IO.Input));
     IOGroups.Add(Output, new SchemeIOGroup(1, IO.Output));
     CycleManager.Instance.Tick += OnTick;
 }
Example #6
0
 public NumberDisplay(Parameters parameters) : base(1)
 {
     mSchemeParameters = parameters;
     IOGroups.Add(Input, new SchemeIOGroup(mSchemeParameters.Size, IO.Input));
 }
Example #7
0
 public IntConst(int value) : base(1)
 {
     IOGroups.Add(Output, new SchemeIOGroup(32, IO.Output));
     Number = value;
 }
Example #8
0
 public CONST() : base(1)
 {
     IOGroups.Add(Output, new SchemeIOGroup(1, IO.Output));
     IOGroups[Output].IOArray[0] = true;
 }
Example #9
0
 public NAND() : base(2)
 {
     IOGroups.Add(Input, new SchemeIOGroup(2, IO.Input));
     IOGroups.Add(Output, new SchemeIOGroup(1, IO.Output));
     IOGroups[Output].IOArray[0] = true;
 }