display peripheral

We now know how to represent numbers and add them together. But it’s still a pain to read results like 1100100110 — can we find a way to present the answer nicely?

peripherals

Just like with , a regular computer is just a box that manipulates binary data. But we know that computers can do all kinds of things — play games, show videos, back Kickstarter projects. How do they do this?

The answer is peripherals. A peripheral is a device that “plugs in” to this data-manipulating box, giving it tools for interacting with the real world. Most computers have peripherals like:

  • Monitor (screen)
  • Keyboard
  • Speakers
  • WiFi antenna
  • etc

We’ve actually already met our first peripheral: the encabulator. This is effectively a power bank that we plug into the grid — it’s not part of the underlying data manipulation, but rather enhances ’ capabilities by supplying power.

peripherals are devices that plug into the grid. They use the same gears to receive and transfer power, but while a disk drive uses that power to run a disk, a peripheral uses that power for some other purpose.

display

Focusing back on our problem: we want some kind of display that can take data and show it to us in a nice way. With a regular computer, this would be a screen or monitor.

In a nutshell, this is what a monitor does:

  • The computer manipulates binary data and produces a result
  • The computer sends this result to the monitor (still in binary)
  • The monitor uses the binary stream to set the colours of its pixels, constructing an image

The key points here are that the peripheral expects to receive binary data, and knows how to convert it into a more useful format to show the user.

7-segment display (WIP)

The 7-segment display is a peripheral. It takes in a marble bitstream and displays the corresponding sequence of numbers.

00/0000/00
loading…

display

note

The display isn’t available in review kits and won’t be part of the Kickstarter — we’re hoping to make it available later down the line.

How it works:

  • The display has the same size and shape as a disk drive. We can snap it into our grid, sending power to its gears just like with a drive.
  • We send a bitstream from a disk into the display’s input. Initially the display is locked — the digit on top won’t change.
  • The display starts in stage 0. Every full rotation of the gears (corresponding to 2 steps on the disk), the display uses a geneva drive to transition stage 1, then stage 2, then stage 3, and finally back to stage 0.
  • The display has a hidden digit picker — imagine a hand on a clock. Initially it’s set to 0. In each stage, the display receives either a new marble or hole. If it receives marble, the digit picker moves around the clock. If it receives hole, nothing happens.
  • The amount the digit picker moves depends on the stage. In stage 0, it moves 1 space; stage 1 moves it 2 spaces; stage 2 moves it 4 spaces; and stage 3 moves it 8 spaces.
  • At the end of stage 3, the display briefly unlocks. Like a regular 7-segment display, the position of the digit picker allows different segments of the display to show or hide themselves, displaying the selected number.
  • Finally, the display locks itself again and sets the digit picker to 0, ready for the next cycle.

Consequently, as we send in a 4-bit bitstream like 1001 0001 1111 0101, the display will show the corresponding digits. As 4 bits allows us to represent 16 values, it can also display the following special values:

bitsvaluedisplay
101010(blank)
101111A
110012
110113L
111014u
111115n

display status

The display is a work in progress and not available in review kits right now. We’re currently looking at:

  • Simplifying the design, to make it easier to produce in the quantities we need;
  • Making the mechanism smaller, so we can fit multiple displays into a single unit.

application

Note: this is a mockup unit for illustration, not a functioning prototype.

Let’s use the display to visualise the results of our adder.

00/0000/00
loading…

adder with display

The adder computes 3 + 6 = 9 and feeds the result in binary to the display, which converts it to the digit “9”.

This is the power of peripherals. Computers like working in binary, but humans don’t. Peripherals give us the best of both worlds — they let the computer keep working with bits, while translating things into something easier for people to work with.

Imagine we had a second peripheral, a keyboard, which would input a marble bitstream whenever we press a key. We could plug it to one end of the disk, with our display at the other end — and then we could hide the marbles entirely. We could cover up the disks and only interact via the peripherals, just like how you interact with a regular computer.

chained displays

One neat thing: because the display passes on the bitstream when it’s finished, if we place multiple displays next to each other, we’ll see the digits “scroll” across the displays.

00/0000/00
loading…

chained displays

This demo unlocks the device view. From the disk view, zoom out twice to see a larger overview of the design. In this view we hide certain details and speed up the simulation rate.

more on peripherals

In principle, there’s nothing limiting us to a 7-segment display. We could have a peripheral that displays any kind of character, or even draws images. We have some pretty exciting peripherals under development and hope to make them available soon.

It’s time to wrap up this tutorial sequence, so in the next chapter we’ll recap what we’ve covered.

continue