PyCon X


2nd - 5th May 2019

Ternary CPUs: how they work and how Python helps designing one

0/1, False/True, off/on, etc.: the computers which we’re working on are based, from very long time, on the so called binary arithmetic/logic.

“Two states to rule them all": with these we built a complete ecosystem which goes from the hardware to the software… showing even this text that you’re reading now.

However the possibility to use the ternary logic instead, that started just a joke some years ago, generated recent papers and researches about it, with interesting features exploited and documented.

An FPGA project is in development to implement a “ternary CPU” and an ISA (Instruction Set Architecture) draft was roughly defined (and evolving).

But a CPU without code to execute is useless and here comes Python, which allows to quickly implement (and test) some simple, primitive assembler to generate executables ("ternaries”?), which can then be transferred to the FPGA board and run.

A basic emulator with a minimal set of instructions is implemented, in order to test the code even without the physical board.

This talk provides a short overview of the ternary logic, some challenges, and how the basic assembler and emulator are written, tested, and work.

in on Sunday 5 May at 10:15 See schedule


  1. Gravatar
    Interesting! Can you please format better your proposal? It's hard to read from mobile.
    — Roberto Polli,
  2. Gravatar
    Sorry, I didn't check on mobiles when I've submitted the abstract. I hope that it looks better now. ;)
    — Cesare Di Mauro,

New comment