We’ve seen how we can use lateral encoding to easily build a NOT gate. So why did we bother with presence encoding in the first place?
compactness
The lateral encoding stream carries the same information, but takes twice as much space. Disks are not big! Often we need to prioritise keeping our devices compact, for which presence encoding is perfect.
native interface
Many roons expect their input to be presence encoding. For example, a turn functions as both an AND and OR gate — but only under PE.
If we have to, we can use LE with these roons by just taking the 1 channel and routing the 0 around. But again, this takes up extra space, and is less elegant than directly using PE.
adapters
Fortunately, we don’t have to choose a single encoding — we can mix and match within the same pattern. But we’ll need an adapter to convert between the different encodings.
Think of it like an international company — one branch might speak English, another Spanish, and a third one Romansh. Each branch can function perfectly well internally, but to talk to another branch, they need a translator.
LE to PE
Converting from lateral to presence encoding is easy — in fact, we don’t have to do anything:
The 1s column already contains a presence encoding! So to convert to PE, we can just take this column.
Similarly, the 0s column contains the inverted values of the stream. It’s like we’re carrying around the output of a NOT gate.
PE to LE
To convert presence to lateral encoding, we’ll need a reservoir:
The reservoir reads the stream and outputs a lateral encoding.
If you think about it, this has always been the point of a switch — it converts
into
, and
into
!
summary
We now know how to represent bits — 1s and 0s — and manipulate them via logic gates.
In the next sequence, we’ll learn how to combine bits together to represent more meaningful pieces of data, like numbers and text.
finish