public void Test3() { // Arrange var ram = new RandomAccessMemory(); var byte2 = new Byte2(42); // Act ram.Do(false, false, byte2, false); ram.Do(false, true, byte2, false); var output = ram.Do(false, false, byte2, true); // Assert output.ToInt16().Should().Be(42); }
public Byte2 Do(Bit2 address, bool store, Byte2 data, bool clock) { var invertedAddress = Gates.Invert(address.High); var storeAtRam0 = Gates.And(invertedAddress, store); var storeAtRam1 = Gates.And(address.High, store); var output0 = _ram0.Do(address.Low, storeAtRam0, data, clock); var output1 = _ram1.Do(address.Low, storeAtRam1, data, clock); var outputTotal = Select16.Do(address.High, output1, output0); return(outputTotal); }