예제 #1
0
        public void Test_MinValue_increment()
        {
            // Arrange
            var a = new Byte2(short.MinValue);

            // Act
            var byteResult = Arithmetics.Increment(a);

            // Assert
            byteResult.ToInt16().Should().Be(short.MinValue + 1);
        }
예제 #2
0
        public void Test_0_increment()
        {
            // Arrange
            var a = new Byte2(0);

            // Act
            var byteResult = Arithmetics.Increment(a);

            // Assert
            byteResult.ToInt16().Should().Be(1);
        }
예제 #3
0
        public Byte2 Do(bool store, Byte2 data, bool clock)
        {
            var invertedClock = Gates.Invert(clock);

            incremented = Arithmetics.Increment(registeredOutput);

            _selectedData = Select16.Do(store,
                                        data,
                                        incremented);

            registeredOutput = register.Do(invertedClock,
                                           _selectedData,
                                           clock);

            return(registeredOutput);
        }