Implementing Tests

As part of the game, players will test their logic circuits against Truth Tables to unlock higher-level parts. I also use the tests to check my own creations. It’s the same as running Unit Tests.

When manually testing, you are far more likely to miss edge cases and find it tedious to try many combinations of inputs. But with automation it is more efficient and easy.

Testing the Shift Register

Today I implemented truth tables for the Register, Shift Register, and ALU. Doing this revealed various bugs which I was able to fix. These Truth Tables are not Text Book style, but they map input patterns to expected output patterns.

Maybe you can see that I have implemented some codes to tell the visual Truth Table scene how to display or not to display the data?

An example of Truth Table Data:

Truth Table

I needed to add Bus inputs alongside logic-level inputs. To indicate a Bus in the Truth Table, I simply used lower-case letters, and added new IO Bus parts to use instead of IO Pins. Also, I added the support for hex numbers in the Truth Table.

The ALU in particular was tricky since it deals with twos complement signed binary numbers, so it can get confusing when figuring out how to indicate an overflow for both addition and subtraction for example.

Testing ALU

Next we need to test the ROM and RAM parts.

More Devlog entries

Most recent first