Ejemplo n.º 1
0
 public BitComparator(IXOr xOr, IAnd and, IOr or, INot not)
 {
     _xOr = xOr;
     _and = and;
     _or  = or;
     _not = not;
 }
Ejemplo n.º 2
0
 public Stepper(IMemoryGateFactory memoryGateFactory, IAnd and, INot not, IOr or)
 {
     _and         = and;
     _not         = not;
     _or          = or;
     _memoryGates = Enumerable.Range(0, 12).Select(_ => memoryGateFactory.Create()).ToList();
 }
Ejemplo n.º 3
0
 public Bus1Factory(IAnd and, INot not, IOr or, IByteFactory byteFactory)
 {
     _and         = and;
     _not         = not;
     _or          = or;
     _byteFactory = byteFactory;
 }
Ejemplo n.º 4
0
 public Clock(IClockStateFactory clockStateFactory, IAnd and, IOr or)
 {
     _and  = and;
     _or   = or;
     _clk  = clockStateFactory.Create();
     _clkD = clockStateFactory.Create();
     ClkE  = false;
     ClkS  = false;
 }
Ejemplo n.º 5
0
 public Bus1(IAnd and, INot not, IOr or, IByteFactory byteFactory, Action <IByte> updateWire)
 {
     _and         = and;
     _not         = not;
     _or          = or;
     _byteFactory = byteFactory;
     _updateWire  = updateWire;
     Input        = _byteFactory.Create(0);
     Output       = _byteFactory.Create(0);
 }
Ejemplo n.º 6
0
 public CpuPinStates(
     IClock clock,
     IStepper stepper,
     IByte instruction,
     Caez caez,
     IAnd and,
     IOr or,
     INot not,
     IDecoder decoder,
     IByteFactory byteFactory)
 {
     _clock       = clock;
     _stepper     = stepper;
     _instruction = instruction;
     _caez        = caez;
     _and         = and;
     _or          = or;
     _not         = not;
     _decoder     = decoder;
     _byteFactory = byteFactory;
 }
        public ArithmeticLogicUnit(
            IByteXOr byteXOr,
            IByteOr byteOr,
            IByteAnd byteAnd,
            IInverter inverter,
            IByteAdder byteAdder,
            IByteEnabler byteEnabler,
            IAnd and,
            IIsZeroGate isZeroGate,
            IByteDecoder byteDecoder,
            IRightByteShifter rightByteShifter,
            ILeftByteShifter leftByteShifter,
            IOr or,
            IAluWire aluWire,
            IByteComparator byteComparator,
            Action <Caez> updateFlags,
            Action <IByte> updateAcc,
            IByteFactory byteFactory)
        {
            _byteXOr          = byteXOr;
            _byteOr           = byteOr;
            _byteAnd          = byteAnd;
            _inverter         = inverter;
            _byteAdder        = byteAdder;
            _byteEnabler      = byteEnabler;
            _and              = and;
            _isZeroGate       = isZeroGate;
            _byteDecoder      = byteDecoder;
            _rightByteShifter = rightByteShifter;
            _leftByteShifter  = leftByteShifter;
            _or             = or;
            _aluWire        = aluWire;
            _byteComparator = byteComparator;
            _updateFlags    = updateFlags;
            _updateAcc      = updateAcc;

            InputA = byteFactory.Create();
            InputB = byteFactory.Create();
            Op     = new Op();
        }
Ejemplo n.º 8
0
 public RealTimeOr([NotNull] IDisposer disposer,
                   [NotNull] IAgenda agenda,
                   [NotNull] IOrFactory factory,
                   [NotNull] IWire wireInOne,
                   [NotNull] IWire wireInTwo,
                   [NotNull] IWire wireOut)
     : base(disposer,
            agenda,
            new[]
 {
     wireInOne,
     wireInTwo
 },
            new[]
 {
     wireOut
 })
 {
     m_Or = factory.Create(wireInOne,
                           wireInTwo,
                           wireOut);
 }
Ejemplo n.º 9
0
        private SituationSegment BuildSituationSegment(IOr Predicate, ISituationSegment NextSegment)
        {
            List <ISituationSegment> segments;
            SituationSegment         result;

            if ((Predicate.Items == null) || (!Predicate.Items.Any()))
            {
                throw new InvalidOperationException("Invalid or predicate");
            }

            segments = new List <ISituationSegment>();
            foreach (IPredicate item in Predicate.Items)
            {
                segments.Add(BuildSituationSegment(item, NextSegment));
            }

            result = new SituationSegment();
            result.InputTransitions.AddRange(segments.SelectMany(item => item.InputTransitions));
            result.OutputSituations.AddRange(segments.SelectMany(item => item.OutputSituations));

            return(result);
        }
Ejemplo n.º 10
0
 public BitAdder(IXOr xOr, IOr or, IAnd and)
 {
     _xOr = xOr;
     _or  = or;
     _and = and;
 }
Ejemplo n.º 11
0
 public IsZeroGate(IOr or, INot not)
 {
     _or  = or;
     _not = not;
 }
Ejemplo n.º 12
0
 public ByteOr(IOr or, IByteFactory byteFactory)
 {
     _or          = or;
     _byteFactory = byteFactory;
 }