예제 #1
0
        public void Apply()
        {
            var inputData = MemoryAddressRegister.Data;

            var yInput   = new[] { inputData.Eight, inputData.Seven, inputData.Six, inputData.Five };
            var yDecoder = _decoder.Apply(yInput).ToList();

            var xInput   = new[] { inputData.Four, inputData.Three, inputData.Two, inputData.One };
            var xDecoder = _decoder.Apply(xInput).ToList();

            for (var y = 0; y < yDecoder.Count; y++)
            {
                for (var x = 0; x < xDecoder.Count; x++)
                {
                    var xAndY = _and.Apply(xDecoder[x], yDecoder[y]);

                    var s = _and.Apply(xAndY, Set);
                    var e = _and.Apply(xAndY, Enable);

                    InternalRegisters[y][x].Set    = s;
                    InternalRegisters[y][x].Enable = e;

                    InternalRegisters[y][x].Apply();
                }
            }
        }
예제 #2
0
        public void UpdateGeneralPurposeRegisters(bool regAEnable, bool regBEnable, bool regBSet)
        {
            var decoderEnableRegA = _decoder.Apply(_instruction[4], _instruction[5]).ToArray();
            var decoderEnableRegB = _decoder.Apply(_instruction[6], _instruction[7]).ToArray();
            var decoderSetRegB    = _decoder.Apply(_instruction[6], _instruction[7]).ToArray();

            var clkE = PinStates.ClockOutput.ClkE;
            var clkS = PinStates.ClockOutput.ClkS;

            var r0Ea = _and.Apply(decoderEnableRegA[0], regAEnable, clkE);
            var r1Ea = _and.Apply(decoderEnableRegA[1], regAEnable, clkE);
            var r2Ea = _and.Apply(decoderEnableRegA[2], regAEnable, clkE);
            var r3Ea = _and.Apply(decoderEnableRegA[3], regAEnable, clkE);

            var r0Eb = _and.Apply(decoderEnableRegB[0], regBEnable, clkE);
            var r1Eb = _and.Apply(decoderEnableRegB[1], regBEnable, clkE);
            var r2Eb = _and.Apply(decoderEnableRegB[2], regBEnable, clkE);
            var r3Eb = _and.Apply(decoderEnableRegB[3], regBEnable, clkE);

            var r0S = _and.Apply(decoderSetRegB[0], regBSet, clkS);
            var r1S = _and.Apply(decoderSetRegB[1], regBSet, clkS);
            var r2S = _and.Apply(decoderSetRegB[2], regBSet, clkS);
            var r3S = _and.Apply(decoderSetRegB[3], regBSet, clkS);

            PinStates.GeneralPurposeRegisters[0].Enable = _or.Apply(r0Ea, r0Eb);
            PinStates.GeneralPurposeRegisters[1].Enable = _or.Apply(r1Ea, r1Eb);
            PinStates.GeneralPurposeRegisters[2].Enable = _or.Apply(r2Ea, r2Eb);
            PinStates.GeneralPurposeRegisters[3].Enable = _or.Apply(r3Ea, r3Eb);

            PinStates.GeneralPurposeRegisters[0].Set = r0S;
            PinStates.GeneralPurposeRegisters[1].Set = r1S;
            PinStates.GeneralPurposeRegisters[2].Set = r2S;
            PinStates.GeneralPurposeRegisters[3].Set = r3S;
        }
예제 #3
0
 public IByte Decode(bool a, bool b, bool c)
 {
     return(_byteFactory.Create(_decoder.Apply(a, b, c).ToArray()));
 }