Lion FPGA CPU/Computer

A 16-bit FPGA CPU I call Lion CPU and a computer, the Lion computer. Everything built from scratch.

Similar projects worth following
I started to explore FPGAs and made a CPU, then when I realized that it really works I set a goal to make a computer like the 80's home computers I used as a kid and I think I did it.

I built a video controller, a UART, wrote an assembler and ported PA Tiny Basic adding fixed point and more. It started to feel like a home computer. I added SPI to use a SD Card and wrote simple FAT system support. For sound I added two audio channels and a noise channel.
Then I added one color hardware sprites.
I made a generator for Lion CPU code to the Java Grinder open source project and so I have a simple Java Compiler for Lion. Then I wrote a simple demo game in Java. Of course I have added joystick port.
Last addition was a second video mode, 16 colors & 45 multicolor sprites.
Also Manos wrote a windows emulator of Lion in C#.
Still more to do both in hardware and software but it already is a working computer.
Leon (Theodoulos Liontakis)

Current Specs

CPU : Lion 16bit  @50Mhz

Memory:  8K rom + 56K ram + 32K video ram + 12K sprites ram + 64K extended memory

Video Mode 0  (text optimized):  640x240 pixels, 30x80 chars, 16 colors (2 per char)

Video Mode 1  (graphics optimized):  320x200 pixels, 25x53 chars, 16 colors

Sprites: 45 colorful 16x16 pixels hardware sprites, double buffered.

Storage: basic FAT support in SD card 30Mbytes

Sound: 2 channels + 1 noise channel

Ports:   2x joystick, 1x Serial, 1x VGA, 1x PS/2 keyboard (works as serial)

Software: Assembler, Palo Alto Tiny Basic (with fixed point arithmetic),

                 Java Grinder Compiler (with floating point support), Astro java game.

And a Lion Windows emulator written by Manos in C# see github project link.

Source code availiable at github (CPU+system VHDL/schematic, assembler, Rom+TBasic assembly)

More information and assembly description at my website (first project page).

  • 1 × Cyclone IV EP4CE15 board
  • 1 × AS7C31026B-10TCN Memory SRAM IC
  • 1 × SD Card board with SPI interface
  • 1 × PS/2 Keyboard to serial board (Optional)
  • 1 × Power supply 9V dc 15W (for LCD) or 5V (without LCD support)

View all 9 components

  • Keyboard

    Leon05/24/2019 at 16:49 0 comments

    Fixed some issues with the keyboard, now Shift and Caps Lock work well, although I cannot turn the Caps led on due to the external controller board I use limitations. Maybe I have to build my own as i did with everything else although I find it not so interesting.

  • Upgraded text mode 0

    Leon01/08/2019 at 15:17 0 comments

    Since I made a second video mode for graphics and added more vram I used the extra ram to also upgrade the first video mode for text so its now 640x240 pixels and with a 8x8 font can display 30x80 characters in two colors per character from 16 available.

  • Second sprite controller

    Leon01/03/2019 at 16:19 0 comments

    Added a second parallel sprite engine so now 28 sprites are available for mode 1 in 8k sprite ram. It is synchronized using the vertical synch signal with the video controller that generates the first 14 sprites. Sprite ram is now split in two 4k independently addressed units so each sprite controller has its own ram. Sprite ram is mapped in I/O space at address 16384.

    I can any time easily add one or two more sprite controllers to have 42 or 56 sprites.

  • 16 sprites

    Leon01/02/2019 at 21:54 0 comments

    Number of mode 1 sprites increased from 10 to 16.

  • Older Logs

    Leon12/28/2018 at 13:18 0 comments

    Older project logs can be found in the first Lion project page at

  • Load screen & extended memory

    Leon12/25/2018 at 21:37 0 comments

    I added a INT 5, A0=13  system routine that loads in screen memory, files directly from the SDCard so I can easily display saved screens. Also I added a command LSCRN "filename", address in Tiny Basic.

    I added also a command XMOV in CPU/assembly that can move data to and from "extended memory" so now Lion can access more memory than the 64K ram (currently 128K). The "extended" memory can be used only for data not for programs.

View all 6 project logs

Enjoy this project?



Dusan Petrovic wrote 03/25/2019 at 12:32 point

This project is a great addition to the #Homebrew CPU list. Thanks Leon!

  Are you sure? yes | no

Leon wrote 03/25/2019 at 19:09 point

thank you

  Are you sure? yes | no

f4hdk wrote 03/24/2019 at 14:37 point

  Are you sure? yes | no

Leon wrote 03/25/2019 at 01:18 point

thanks for the tip

  Are you sure? yes | no

Goran Mahovlic wrote 01/08/2019 at 10:15 point

It would be great to see your console on our FPGA :)

  Are you sure? yes | no

Leon wrote 01/08/2019 at 14:59 point

Nice board!

  Are you sure? yes | no

Goran Mahovlic wrote 01/08/2019 at 22:43 point

Tnx, it was made for university in Zagreb(Croatia), and at some point we will try to push it to market.

  Are you sure? yes | no

Leon wrote 01/08/2019 at 00:56 point

thank you Goran

  Are you sure? yes | no

Goran Mahovlic wrote 01/07/2019 at 14:45 point

Great work!!!

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates