public void Fifteen_does_not_equal_zero() { // Act var equalsZero = Arithmetics.EqualsZero(new Nibble(15)); // Assert equalsZero.Should().BeFalse(); }
public void Zero_equals_zero() { // Act var equalsZero = Arithmetics.EqualsZero(new Nibble(0)); // Assert equalsZero.Should().BeTrue(); }
public static bool Evaluate(Condition condition, Byte2 data) { var isLessThanZero = Arithmetics.IsLessThanZero(data); var andIsLessThanZero = Gates.And(condition.LessThanZero, isLessThanZero); var equalsZero = Arithmetics.EqualsZero(data); var andIsEqualToZero = Gates.And(condition.EqualToZero, equalsZero); var isGreaterThanZero = Gates.And(condition.GreaterThanZero, Gates.And(Gates.Invert(isLessThanZero), Gates.Invert(equalsZero))); var lessOrEqual = Gates.Or(andIsLessThanZero, andIsEqualToZero); var lessOrEqualOrGreater = Gates.Or(lessOrEqual, isGreaterThanZero); return(lessOrEqualOrGreater); }