Long multiplication

You will learn

How n x m becomes rows of copies, zeros and flips.

Each trit of m picks a copy, a zero or a flip of n, shifted one place per row; adding the rows gives the product. 7 x 8: 8 is +0-, so the rows are -7, 0 and 63, which sum to 56. There is no times table to learn, only the three-way switch of the last lesson and an adder. The spec's long_mul() is checked against n x m on 243 pairs.

Open the interactive lesson →