Supercon 2023: Exploring the Elegance of the Voja4

Supercon 2023: Exploring the Elegance of the Voja4
By Tom Nardi

When you design an electronic badge, the goal is to make a device that’s interesting and has enough depth to keep your attendees engaged for the duration of the con but not so complicated that they can’t become proficient with it before they have to head home. It’s a difficult balance to nail down, and truth be told, not every Supercon badge has stuck the landing in this regard.

But if you’ve really done things right, you’ll create a piece of hardware that manages to outlive the event it was designed for. A badge that attendees continue to explore for months, and potentially even years, afterward. If the talk “Inside the Voja4” by Nathan Jones is any indication, we think it’s safe to say that goal was achieved with the Supercon 2022 badge.

During this forty-minute presentation, Nathan discusses what makes the 4-bit badge so fascinating from a technical standpoint and how it could theoretically be expanded to accomplish far more complex tasks than one might assume at first glance.

Following The Instructions

The bulk of Nathan’s presentation is on the architecture of the Voja4, or more specifically, the architecture used by the emulated 4-bit CPU that lives inside the badge’s PIC24 microcontroller. The emulated CPU isn’t based on anything that ever existed in the real world — it came straight from the imagination of badge designer Voja Antonić. But that doesn’t mean it’s some fanciful creation, either. Nathan breaks down how it compares to more traditional CPU architectures and the rationale behind its deviation from the norms.

If the goal of the Voja4 was simply to get people writing code for vintage hardware, we could have just put a 6502 on the thing and called it a day. But in that case, the user would simply have found some 6502 code on the Internet, ran it on the badge, and then promptly forgot about the whole thing. Instead, the goal was to get attendees acquainted with the idea of bare metal programming and the joys of actually being able to understand what the computer is doing at each step.

Keeping in mind the ideal level of badge complexity, it was necessary to create a processor that used a significantly reduced instruction set. In the short term, this makes programming the badge in assembly easier than if it had used a “real” CPU. On the flip side, this austerity does mean your final code could end up longer and more complicated than is strictly necessary. As Nathan says, it would be nice to have a multiplication instruction built in, but that doesn’t mean you can’t work around it.

Unlike pretty much anything else attendees would have likely had experience with, the Voja4 uses a 12-bit instruction length. Within these 12 bits, which corresponded to 12 physical buttons and LEDs on the front of the badge, you could express both the opcode and up to two operands. At first glance, this would seem to limit you to just 16 possible opcodes, but by designing some of the opcodes so they only require a single operand, Voja was able to double that number.

Compared to other architectures, which can throw you for a loop with things like variable instruction lengths, this makes it much easier to understand what’s going on during each cycle on the Voja4.

Limited By Imagination…and RAM

Looking at the Voja4 and its specifications, you might naturally assume that it’s little more than a computational novelty. But Nathan argues that the instruction set, while limited, is complete enough that there’s no task it cannot perform — assuming you’ve got some time to burn. He points to examples of folks running Linux on 8-bit chips like the ATmega1284P, which can take hours just to boot up to the login prompt.

That said, there’s technically still one missing element: more memory. The Voja4, as designed, can’t address enough memory to make something like this possible, but at the end of his talk, Nathan proposes some hypothetical modifications that could be made to allow the badge to address external memory over the serial port.

Again, patience would be the name of the game with such an arrangement. But if given all the memory it could handle and enough time to chew through it, the only remaining limitation on the Voja4 would be within the user’s imagination. While we don’t expect anyone to boot Linux with it as they did on the 2019 FPGA badge, we’d love to see somebody actually try and expand the Voja4’s memory and really push the envelope on what it can do. Maybe for Supercon 2024?

May 20, 2024 at 07:30PM
via Blog – Hackaday https://ift.tt/MdX6vYp


Lascia un commento