The No-CPU Computer Gets A C Compiler

C is the most perfect language and it will run on anything. It will even run on a computer without a CPU.

The computer in question here is the Gigatron, a fully-functional ‘home computer’ the likes of which you would find in the late 70s and early 80s, complete with a VGA output. What makes the Gigatron exceptional is the fact that there is no microprocessor; everything is just a RAM, a ROM, and a bunch of logic chips. There is no ALU chip. Or rather, there is; it’s just that an entire RISC CPU is implemented in basic logic chips and a whole lot of microcode on the ROM. It’s weird, yes, but it is cool. We’ve taken a look at the Gigatron before, and with this computer you get a glimpse of how clever engineers could have been if there were massive memories available in the late 70s.

While the Gigatron can be programmed in BASIC, the limiting factor of this computer is the fact that it remains exceptionally difficult to program. This is what the 8-Bit Guy says, and even though you can write some simple programs, it’s nothing compared to the likes of an Apple II or C64. If only there were a proper IDE, indeed if only there were a C compiler. That’s where [pgavlin] comes in. He has the LCC compiler working on the Gigatron. This is technically a C compiler for a computer without a CPU, or a computer that is entirely CPU. Either way you look at it, this is impressive.

As far as examples and demos go, [pgavlin] has a demo of Conway’s Game of Life working, and a program that will put dots on the screen. It’s not much, and it’s very slow, but check out the video below.

This isn’t a complete implementation of C, as multiplication, division, mod, and arbitrary shifts left or right haven’t been written yet. Floating point support will probably never be completed, and there’s no shame in that. The hardware is limited due to the fact of the fragmented memory map, but this can be improved by upgrading the Gigatron to a 64k memory model.


22 thoughts on “The No-CPU Computer Gets A C Compiler

  1. A CPU (or ALU) just boils down to logic gates. Whats the difference between a bunch of discrete logic chips and a single chip processor? Both are just an implementation detail but the result in either case is still a CPU.

    1. The central (and debateidly “unit”) part of CPU is the difference
      It’s a processor as it processes data but it’s not central (or some would say its not also a unit) as its discrete and distributed
      If the processor was placed on a separate card with all the processing bits included, than you could call it a CPU

      It sounds like splitting hairs but the distinction is important

      1. It is splitting hairs, the distinction is completely unimportant. Also, it’s wrong, CPU does not mean “implemented on one chip”. Being on several chips does not make it “distributed”. CPU describes the function in logical terms, not physical implementation.

        Obviously, this computer does have a CPU, but Brian is an expert on click-bait. Misleading headlines leads to nerds like us arguing, then buying nerdy stuff from the ads. It’s a business.

        1. That’s getting closer but still missing the mark.

          The distinction is that it runs on microcode stored on ROM.

          So in effect it is a state machine with the state map in ROM.

    2. Quote from the website: “In the Gigatron these simple chips not only form a CPU, but this CPU in turn performs all tasks that normally require dedicated peripheral chips”. Their take is ‘no microprocessor’

  2. From Wikipedia:
    “A central processing unit (CPU), also called a central processor or main processor, is the electronic circuitry within a computer that carries out the instructions of a computer program by performing the basic arithmetic, logic, controlling, and input/output (I/O) operations specified by the instructions.”

    So this thing indeed _has_ a CPU, even if it is not under the form of a single chip. It does have an instruction decoder, control logic and an ALU (Arithmetic and Logic Unit) built around 74181 chips.

    What would be really interesting though, is a computer based on a CPU (or processor) without an ALU: the feasibility has been deomnstrated in 2010 by Raul Rojas in this paper:

    For more details, check the logs in my project

        1. The adders are just a portion of the ALU. The real magic is done by the multiplexers that control what the adders add, and it’s not just as simple as selecting what registers get added. Study the circuit.

  3. I bought a Gigatron about a year ago when they first came available.

    Since then, the Gigatron community has contributed the following projects:

    A PC based emulator that runs the native assembly language.
    A 16-bit virtual machine “vCPU” converting the 8-bit Harvard architecture to 16-bit Von Neumann architecture.
    A higher level control language GCL.
    An Arduino interface to allow program loading
    An on-screen hex editor/monitor program based on Steve Wozniak’s “WozMon”
    A 64K byte RAM upgrade
    Tiny BASIC with support for colour graphics and sound
    A PS/2 keyboard adaptor
    A Gigatron emulated using an STM32F407 ARM Cortex M4
    A ROM emulator based on SRAM to allow rapid changes to made to ROM contents
    An expansion board to provide connectivity to SPI devices – including SDcards
    A high resolution video mode
    A Gigatron with integrated keyboard – all on one pcb
    Two variants of the pcb – respun with 4 layers
    Custom modifications to the instruction set
    An experimental overclocked Gigatron using 74Fxx series TTL running at 12.5MHz.
    And this week’s announcement of a C compiler, which will allow greater accessibility.

    Gigatron has been demonstrated at Hacker and computer festivals in Belgrade, Berlin, Zurich, Pasadena, Seattle, Cambridge (UK), Shanghai, Lisbon, Eindhoven and Saarbrucken.

    All of these developments are discussed on the Gigatron Community Forum

  4. Great fun. I used to build mini computers, DIGICO M16e to be precise, I imagine that the author means no CPU on a chip, so we had to make them on lots of separate circuit boards. Microprocessors came along and put the essential functions on a single chip so you only had to add memory and peripherals…. and power :)

  5. Thanks! LCC is really a cool addition that opens many possibilities.

    That video is more than a year old BTW. The 8-bit Guy gave an update when BASIC and the keyboard interface were added:

    The EPROM size is irrelevant for the design. Half of it is used for the color pictures, and most of the rest is cold storage for the built-in applications. For a system with just the kernel and Tiny BASIC, an 8K ROM will suffice.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.