COSMAC ELF Lives Again, In FPGA

Looking around at the personal computing markets in modern times, there seem to be a lot of choices in the market. In reality, though, almost everything runs on hardware from a very small group of companies, and software is often available across platforms. This wasn’t the case in the personal computing boom of the 70s and 80s, where different computers were wildly different in hardware and even architecture. The Cosmac ELF was one of the more interesting specimens from this era, and this one has been meticulously reproduced on an FPGA.

The original hardware was based on an RCA 1802 microprocessor and had a rudimentary (by today’s standards) set of switches and buttons as the computer’s inputs. It was low cost, even for the time, but was one of the first single-board computers available. This recreation is coded in SpinalHDL and the simplicity of the original hardware makes it relatively easy to understand. The FPGA is cycle-accurate to the original hardware, too, which makes it nearly perfect even without any of the original hardware.

The project’s creator, [Winston] aka [wel97459], found that SpinalHDL made this project fun to work on (and released his code on his GitHub page), and was able to get the code down to just 1500 lines to recreate the original hardware. It’s very impressive, and also an accessible read for anyone interested in some of the more unique computers offered during the early computer renaissance in the 70s.

44 thoughts on “COSMAC ELF Lives Again, In FPGA

  1. I wonder, how it compares to our implementation of the 1802 https://wiki.forth-ev.de/doku.php/projects:fig-forth-1802-fpga:start It was part of a project to have FIG-Forth running on the 1802 – using a Lattice FPGA board. Connect via USB to your PC and start typing. The IP is available on github under https://github.com/Steve-Teal/1802-pico-basic and is written in way to easily port to other FPGAs. And the FIG-Forth is documented in a book https://www.amazon.co.uk/FIG-Forth-Manual-Documentation-Test-1802-ebook/dp/B01N42VLJE/ref=asap_bc?ie=UTF8.

    1. It is stated in the github for that implementation of the 1802 that it does not support DMA or Interrupts.

      My project is a fully functional 1802 and is cycle accurate, allowing it to connect to other peripherals that use DMA or Interrupt like the CPD1861 video output chip.

      1. correct, this was not required in the application/project we aimed for. There might be another version soon, but until now there was no need. There are other 1802 IPs around – our aim was to have the running system with Monitor, Tiny Basic and FigForth on board. You just need the programmer of the Lattice board to have it running. The last screen print at https://wiki.forth-ev.de/doku.php/projects:fig-forth-1802-fpga:start is using the board after I did program my Lattice board

  2. Oh no. :( Just when I finally found an CDP1861 (and even a more rare CDP1864) and am about to build a real Cosmac ELF with pixie graphics just for the fun of it. Now it’s all useless. :'(

    ;)

    1. In all honesty it was useless before hand the reason you are building it is for your own entertainment and learning not because it has great utility value… Build it regardless good luck

    2. RetepV, it is never useless… because I’m sure that you do it anyway not for monetary gain! …you do it as balm to your soul memory! – Return to (time) roots and staying in the present looking forward into he future, that is really life.

      1. Hehe, ah well, it was a tongue-in-cheek message. I am really impressed by projects like this, recreating old computers in FPGA, and would like to do such a thing myself once.

        But now it’s done. I replicated a BBC computer in FPGA once (replicated an already made project from someone else). But it was not half as satisfying as having programmed the VHDL myself. And also not half as satisfying as having built it from scratch with the old components.

        So indeed, I am still going to build my Cosmac Elf with Pixie using the original hardware. Just for the fun and the learning. :)

  3. this is an instering reminder from my past while in the Navy in the 70s a friend of mine. another technician bought one of the cosmic elf kits and built it….. What memories

    1. Weird. That is exactly my story! ET in the Navy, built (wire wrapped) the magazine kit, got out of the Navy, EE degree and then a great career as an engineer. Wonder how many careers were launched as a result of that magazine article? And the 1802.

    1. The core used in that project has no Interrupts or DMA support.

      My project is a fully functional 1802, and is cycle accurate allow for it to connect to other peripherals that use DMA or Interrupt like the CPD1861 video output chip.

    1. One problem with his 1802 core is there’s no support for Interrupts or DMA.

      My project is a fully functional 1802 and is cycle accurate, allow for it to connect to other peripherals that use DMA or Interrupt like the CPD1861 video output chip.

      1. Steve implemented what was required to get the FIG-Forth running
        – which worked very successfully.
        Which software do you have running on your core?
        And what is the performance of your core compared to the original 1802 at say 1MHz?

  4. We should always credit the creators. Joseph Weisbecker was an amazing man! His creativity and imagination foreseen the future. A real visionary! I’ve done a talk on him, but it still feels short of explaining the genious he was.

  5. The CDP1802 was the first microprocessor with a register bank. 16 8 bits registers that could be paired to form 8 16 bits registers. Very interesting design that let you choose any register pair as the program counter and any other as interrupt pointer. But it was slow, it required 16T per instructions. At 2Mhz clock it was executing only 125,000 instructions per second. A modern implementation with 1T per instruction would be welcome.

    1. actually…it was 16 x 16 bit registers, any of which could be used as the program counter. Call a subroutine? change the PC. Return? Change it back. Better for a microcontroller than a general purpose computer, but interesting. And the built-in DMA made it possible for the hobbyist to build a self-sufficient computer without a ROM — it had what was basically a “program loading” mode. Put data on the bus, DMA IN, and it went to the first memory location, and incremented the address.

      Also…one of the first CMOS procs. But yes, slow. Eight clocks per machine cycle, two OR THREE machine cycles required per instruction, so yes, either 16 or 24 clocks per instruction. However, with a higher voltage, the clock speed could be over 6MHz, which was impressive in 1975 (and I’d have to dig for a manual to be sure, but I think with a little temp control, “Well over” 6MHz was possible). But at 16 to 24 clocks per instruction, still slow.

    2. Someone just mentioned Joseph Weisbecker. If I recall properly he created a sort of high level language for the 1802, and he described it in Byte. It was part of an CA some ngle board computer for 1802. The article in Byte made it seem a bit like Steve Wozniak’s “Sweet 16” 16bit nterpreter for the Apple Ii.

      Anyway it seemed like Joseph Weisbecker had written the interpreter too, leaving me wondering if the 1802 was designed to fit the language or the reverse.

      The 1802 was popular for hobbyists because of that DMA, no need for a complicated front panel like the Altair, and no need for a monitor in ROM.

    3. Please put it in perspective. The 1802 was not slow – and see the difference in FPGA now. It was the only CMOS 8 Bit Micro at the time in this new CMOS Technology – and did work in space as rad-hard version. If you want more details, have a look at the free PDF BMP802 I made for publication at http://www.cosmacelf.com/publications/books/design-ideas-book-for-the.pdf – a lot of cut and paste in there – scissors and glue – as you had to do in 1980 when I worked on it and published it with the help of many others. I probably own the last 2 printed book versions.

  6. While I never played with an 1802, I played with lots of others starting with the 8008 on a Mark-8, 8080, 6800, Z80, 6802, F8, SC/.MP, 6809, 80C196, and more. One of the “unique” characteristics of most of these (including the 6502 family) was the use of their unpublished instructions (mostly, that didn’t work as expected) and may or may not have been the result of “don’t cares” in their logic design tables, that were meticulously “reverse engineered” by hackers. I’ve never come across an explanation or list of these instructions, but I know that the original 6502 and its “true” licensed (mask) copies had a big following that used these “special” instructions in operational code. I’m curious if anyone knows more on the subject?

  7. Great memories! An Elf was the first computer I owned; I built in from a kit offered from Pop Electronics magazine. Built a gnarly case for it out of leftover wall paneling. Used it for many years!

Leave a Reply to RetepVCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

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