lateral encoding

In the last tutorial, we encountered a problem with representing 1 as marble and 0 as hole — if we want to transform 0 into marble, we have to source a marble from somewhere. This can make our circuits messy.

revisiting representations

How did we end up here, anyway?

Ages ago, we chose to label marble with 1s and hole with 0s:

00/0000/00
loading…

1s and 0s

This was our reasoning:

  • treats all marbles identically
  • So we have to write the same value (1) on each marble
  • Because we need 2 values, the only other place to write 0 is on each hole

It turns out this isn’t actually true. doesn’t treat all marbles identically. If it did, none of our patterns would work in the first place.

Consider this pattern:

00/0000/00
loading…

distributor pedantry

Did the distributor distributor treat A and B identically?

Put on your pedantry hats. A and B are not identical, because they are in different places.

This means we can trick the universe into encoding data in the positions of the marbles.

00/0000/00
loading…

lateral encoding

We call this lateral encoding. Instead of encoding values in marbles marble and holes hole — which we will now call presence encoding — we’ll encode them in the lateral (horizontal) position of the marbles.

definition

presence encoding means encoding 0 and 1 as hole and marble.
lateral encoding means encoding 0 and 1 as l and r.

We’re exploiting the arbitrariness of representations yet again — there was nothing special about our original scheme, so it’s perfectly fine to create another one when it’s convenient.

why lateral encoding?

Lateral encoding has some nice features. The main one is that it gives us a consistent marble supply — whether we get l or r, we always receive 1 marble and 1 hole.

This is very convenient for building a NOT gate:

00/0000/00
loading…

not gate le

This makes sense — we’re representing our data as l and r, and a crossing crossing swaps l and r. Under LE our NOT gate doesn’t need a reservoir; it’s just a single common .

So why don’t we use lateral encoding for everything? In the next tutorial we’ll look at the tradeoffs.

continue