(This article is part of the The Fabric of Computing series: in search of simplicity)
Here is a fun project, created from start to finish by Matthias Koch, as part of his Mecrisp implementation of Forth:
What youâre seeing is a Nandland Go Board running Mecrisp-Ice, generating a VGA 512-colour video signal on a 7â LCD display.
In itself, this is no big deal. The generated pattern is a 16Ă16 expanded pixel image, and 640Ă480 displays are pretty basic by now â although theyâre fine for presenting text-mode information and retro games.
The interesting bit is the simplicity of the underlying technology. The entire build consists of an FPGA with 1280 âlogic cellsâ. Think of them as the stem cells of digital circuitry, i.e. the building blocks which can be used to create just about anything digital:
A bit over 1000 of these plus 64 Kbits of memory, is all it takes to implement a little Forth compiler plus runtime, with enough storage and power to turn it all into a VGA display with randomly updating patterns.
Thatâs 60 video images per second, with 525 scan lines of 800 pixels each (of which only 480 by 640 actually contain image data). The full resolution would require a 25 MHz âpixel clockâ rate, but by stretching pixels and repeating lines 16 times, we get a more manageable data rate to produce the above.
Matthiasâ Forth code is a mere 100 lines long (source on GitHub) and an intriguing example of what can be done on such an absolutely minimal hardware core (adapted from James Bowmanâs tiny j1a soft cpu).
Just to drive the point home: 1) an FPGA does not have video hardware, 2) the soft ”C implemented on top of it is equally general-purpose, and 3) all video signal-generation is done in Forth, i.e. 100% in software!
If you use C/C++, Java, JavaScript, Python, or some other modern high-level language, and have always wondered what is really needed under the hood to make computers work, then this âFPGA & Forth = VGAâ demo could be a great candidate to find out.
For more detail: TFoC: FPGA & Forth = VGA