DmitrySoshnikov/hdl-js

CLI: implement truth table printer

DmitrySoshnikov opened this issue · 1 comments

The --table (-t) option should print a truth table of a gate, applying to all possible inputs.

./bin/hdl-js --file examples/And.hdl --table

Result:

Truth table for "And":

┌───┬───┬─────┐
│ a │ b │ out │
├───┼───┼─────┤
│ 0 │ 0 │  0  │
├───┼───┼─────┤
│ 0 │ 1 │  0  │
├───┼───┼─────┤
│ 1 │ 0 │  0  │
├───┼───┼─────┤
│ 1 │ 1 │  1  │
└───┴───┴─────┘

Built in 616af24 with the --describe option.