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.
24 thoughts on “The No-CPU Computer Gets A C Compiler”
This is a thing that entertains me greatly. I really hope this is continued.
you should see sinclair spectrum and/or even older zx81… :-) in the very early 80s
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.
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
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.
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.
I agree with donotdespisethesnake. What you are describing is a microprocessor. CPUs existed and were called CPUs before microprocessors existed.
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’
Try to get the basics right. CPU does not equal microprocessor.
I think the claim was that it complains no microprocessor, not that it is one
With just a few more IC’s, a computer can be built that also has no microprocessor, but has more power and is easier to program. Have a look at my Kobold Computer project:
The instruction set will be similar to the PDP-11, the famous 16 bit computer that was used to develop UNIX.
And the C language. So yeah running C without an MPU, while cool, is nothing new.
“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 Hachaday.io project https://hackaday.io/project/21193-aluminimum
Almost correct. The Gigatron does not use ALU chips, 74181 or otherwise. The ALU functions are implemented in multiplexers.
Sorry, almost correct: the Gigatron uses 2x 74HCT283 4-bit adders (U25 and U26), not multiplexers, according to the schematics on page 6:
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.
There are no 74181s in there. Instead its ALU is made out of 8 multiplexer chips (for the “Logic Unit”) and 2 adders (for the “Arithmetic Unit”), together forming an “ALU”.
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
“This is what the 8-Bit Guy says..” – wow. so not interested in what an e-begging youtuber has to say.
The hell do you mean by e-begging?
He’s a great youtuber, what do you have against him?
nice work. lcc is a huge gift to the community 30+ years on.
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 :)
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: https://www.youtube.com/watch?v=uidtGvsk21M
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.
Here’s that floating point for you: https://twitter.com/gigatronTTL/status/1182348033683533826
Please be kind and respectful to help make the comments section excellent. (Comment Policy)