📓 uxn_legoptics.myco by @melanocarpa ☆

While having an insomnia, I came up with an idea of a ridiculous project that would be both hard to implement and of very little utility. Introducing UXN Legoptics, an optical Uxn ROM executor project. The name is a portmanteau of Uxn, Lego and optics. Such a combination cannot be boring. Read further!

NB. I'm not starting it any time soon.

The idea

Wintergatan's first Marble Machine is programmed with Lego pins. When I make my own mechanical computer, It'll be programmed with Lego pins too. It's cooler than punch cards!

The Legoptics project is not a fully mechanical computer though. I shall call the device Xunotron for the rest of the article for the ease of read.

Xunotron's architecture

The Machine Word

The beet processor has 8-bit-wide bytes and machine words. But Xunotron Mark 1 has 10-bit-wide words!

The XUN bit is to the right, the first bit is to the left, so the ribbon has some nice margin on both sides.

The Execution

The ribbon is rotated with a gear mechanism that I hope to design well. It can be rotated with any speed, and thus the program's initial execution speed can be set as well. The camera recognizes the program and executes it.

Once the ribbon is fully read, id est it's not looped, the program is fully working. Until it's not, the program is executed on the go.

Caveat Lector

User input would only be possible after the ROM is only read, which is fine.

Also, if the program jumps to the ROM address that is not read yet, the execution will block until it's read. Programs designed with Xunotron in mind should limit the amount of such jumps to the absolute minimum.

An interesting challenge would be to design circular programs that are perfectly executed in a loop. Animations would work well this way. The cat clock, for example.

The Implementation

Is yet to start. I lack the needed Lego pieces, though. Perhaps it would actually be much more practical to go with punch cards, because of how cheap and replaceable they are. But that would never be as good as clicking your program in, right?

The Color Space

A long ribbon is problematic. Storing it, actually rotating it, doesn't sound fun! If it ends up being possible to differentiate colors with the camera, two bytes could be encoded in one line!

Color

Byte 1 bit k

Byte 2 bit k

empty space

0

0

red

1

0

blue

0

1

yellow

1

1

Such a system would make programs ~twice as small physically. If 4 more colors were possible to recognize, 3 bytes could be encoded at once.

Input optimization

Encoding the UXN bytes as is would probably ineffective. We have a 256-symbol alphabet. What's the frequency of every symbol? More common instructions should be encoded with less pieces.

Also, a visualisation that helps the operator place the pieces in place would help greatly as well.

Some Xunotron metacommands

Available with the XUN bit. I feel like something creative and compact can be done with them. They could make the programs a bit smaller. Maybe they are not needed at all.

We have the following variables: