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 holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top