TFoC: FPGA & Forth = VGA

(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:

FPGA & Forth = VGA


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

About The Author

Ibrar Ayyub

I am an experienced technical writer with a Master's degree in computer science from BZU Multan University. I have written for various industries, mainly home automation, and engineering. I have a clear and simple writing style and am skilled in using infographics and diagrams. I am a great researcher and is able to present information in a well-organized and logical manner.

Scroll to Top