Times one trit

You will learn

Why multiplying by -1, 0 or +1 is a switch, not a multiplier.

A product by one trit has three cases: +1 copies the number, 0 drops it, -1 flips every trit. The spec's trit_times() is exactly that switch and contains no multiplication. This is why ternary neural networks are cheap in hardware: a weight of -1, 0 or +1 needs a multiplexer and an inverter, not a multiplier.

Open the interactive lesson →