public ControlUnitOutput Do(Byte2 data, bool clock) { var decodedInstruction = InstructionDecoder.Decode(data); var selectedSourceMemory = Select16.Do(decodedInstruction.SourceMemory, _memoryOutput.Ram, _memoryOutput.A); _aluOutput = ArithmeticLogicUnit.Do(decodedInstruction.Operation, _memoryOutput.D, selectedSourceMemory); _selectedBasedOnComputationInstruction = Select16.Do(decodedInstruction.ComputationInstruction, _aluOutput, decodedInstruction.w); _memoryOutput = _memory.Do(decodedInstruction.Destination, _selectedBasedOnComputationInstruction, clock); var isCondition = ArithmeticLogicUnit.Evaluate(decodedInstruction.Condition, _aluOutput); return(new ControlUnitOutput(isCondition, _memoryOutput.A)); }
public void Test6() { // Arrange var byte2X = new Byte2(1); var condition = new Condition(true, false, false); // Act var output = ArithmeticLogicUnit.Evaluate(condition, byte2X); // Assert output.Should().BeFalse(); }