Close
0%
0%

PLACARD: homebrew computer built from 22V10 PLDs

8-bit CPU/GPU, 640x480 VGA, made of ATF22V10 PLDs and a handful of 74-series chips, all DIP through-hole.

Similar projects worth following
PLACARD is a complete 8-bit home computer designed from scratch around the 22V10 programmable logic device, the same family of PAL/PLD chips that glued together the computers of the 70s/80s. There is no single-chip processor, no FPGA in the final design: the CPU, the VGA video generator, sound, memory control and I/O are built from 20 ATF22V10C PLDs plus 13 ordinary 74-series and SRAM chips. Every part is a through-hole DIP that is still in production. It shows 640x480 VGA with up to 256 colors, plays 8-bit sound, takes a PS/2 keyboard and mouse and two SNES pads, and loads its ROM from a plug-in cartridge, and has native support for an SD card for hard drive storage. The whole machine runs today on a Basys 3 FPGA board, where each PLD is a VHDL model of its CUPL equations. Current status: KiCad schematics and layout for the 4-layer main board are ready for ordering. I'm submitting my order through PCBWay. I've used them many times and have great success with their boards.

Project goals:

  • Retrocomputer using 1970s/early 1980s type of technology
  • Through-hole only (strongly preferring DIP)
  • Only parts in active production (no ebay/shady distributors)
  • An instruction set that is fun to program 
    • No racing the beam
    • No counting instructions for timing
    • Bare-metal - no virtual machines to program
    • Therefore, a true von Neumann CPU (no Harvard)
    • Native storage so you can write and save programs on the machine itself
  • Fast as the day is long

Why PLDs?

The project started as a pure 7400-series computer, but to meet the goals I conceded it would take too many simple gate chips to achieve it.  So I swapped some gates for 22V10s.  The first PLA was on the market in 1970 - the first PLD in 1977, so thematically it still meets project goals.  It ended up 33 chips on the main board plus a 3.3 V regulator, and 3 on the cartridge.  

This computer was inspired by the ones which came before - the Gigatron, Ben Eater's, Novasaur, Isetta.  There are similarities in the architecture.

CPU

  • 8-bit data, 16-bit address, von Neumann, 25.175 MHz clock (the VGA pixel clock).
  • Instructions take 2, 3 or 4 clocks
  • Registers: accumulator, X, Y and D (immediate/memory operand), each a 74F377.
  • Controlled by a 4-state machine (FETCH, LOAD_IMM, LOAD_MEM, EXECUTE) in one PLD
  • ALU: two 22V10s, 4 bits each, with zero, sign and a carry flag (reminiscent of the obsolete -181 ALUs)
  • Program counter: two 8-bit loadable counter PLDs.
  • Address mux: four PLDs pick Program Counter, zero page, [Y,X] or the video address.
  • Addressing: immediate, [0,D] and [0,X] zero page, and [Y,X] 16-bit.
  • Instruction register is itself a PLD, which also holds a NOP while the cartridge loads so the CPU waits without gating the clock.

Video

  • 640x480 VGA at 60 Hz, generated by H counter, V counter and sync PLDs.
  • Uses RAM as raster memory (x6020-xFFFF)
  • Video runs automatically - stalls CPU when it needs to read from RAM
  • Colors modes are adjustable per line:
    • 640 monochrome pixels or
    • 320 4-color pixels or
    • 160 16-color pixels or
    • 80 256-color pixels
  • RAM can be conserved by select lines to repeat
    • 1x mode reads every line
    • 2x mode skips every other line (half of required RAM)
    • 4x mode skips 3 lines at a time (quarter of required RAM)
  • Modes mix freely down the screen: 80-column text above a 256-color picture, for example.
  • Each row can be tinted with another 8 colors
    • Gives colored text backgrounds and raster bars for free.
    • Provide some background color in monochrome mode
    • Provide color gradients in other color modes
  • Each RAM byte is processed by the Color Decoder PLD which turns it into RGB with a resistor DAC.

Memory

  • 64 KB RAM (two AS7C256 15 ns SRAMs) and 64 KB of ROM space behind the same addresses, in eight 8 KB sections; 
  • A 8-bank select register picks RAM or ROM per bank for reads (writes always go to RAM)
  • Dedicated I/O window at x5000-x53FF address space
  • The video reads the same RAM as the CPU: the video area is x6020-xFFFF, and the video circuit steals clock slots from the CPU in a fixed pattern, so software never has to time its code to the beam.

Sound

  • Borrows video automation counter to read one 8-bit sample per scan line (31.47 kHz, one frame), 
  • Load your sound table and sit back.  No worrying about getting the next sample ready in time.
  • Latched into a 74HCT574 and an R-2R ladder DAC to a line-out jack. 
  • Library ROM makes tones, notes, noise and sample playback.

I/O

  • PS/2 keyboard and PS/2 mouse (a PLD shifts in each byte).
  • Two SNES game pads.
  • SD card (SPI, FAT16/FAT32, read and write).
  • Four expansion slots with their own boot code hook (like the Apple II).
  • Cartridge slot: the cartridge holds the ROM image in a (slow) EEPROM 
    • Copies it into fast SRAM at power-up while it stalls the CPU. 
    • 32K and 64K cartridge boards are designed.

Software

  • Standard library in ROM with an append-only jump table: 16-bit math, multiply/divide, text console with line input, graphics, keyboard, mouse, pad and SD drivers, a FAT file reader/writer,...
Read more »

  • 20 × ATF22V10C-7PX Logic ICs / Programmable Logic: PLDs: CPU state machine, branch, PC, ALU, address mux, memory control, I/O decode, video timing, color decoder, IR, audio, ports, PS/2
  • 5 × SN74F377AN Logic ICs / Flip-Flops, Latches, Registers - D, AC, X, Y registers and the pixel buffer
  • 1 × CD74HCT377E Logic ICs / Flip-Flops, Latches, Registers - ROM/RAM map register
  • 3 × SN74F541N Logic ICs / Buffers, Drivers, Transceivers - Source bus drivers, video line read
  • 2 × AS7C256C-15PCN 32K 15ns RAM chips

View all 9 components

  • Video modes

    Justin Davis • 5 days ago • 0 comments

    I wanted to do 640x480x256 colors, but there just isn't enough RAM.  So I had to choose which way to go - more colors with lower resolution or fewer colors with high resolution.  I figured why not both?  Let the user decide which they need for their own application needs.  At the beginning of each line, a byte is read from RAM which holds the video mode for that line.  The Atari 8-bit computers do something like this - the rows are divided into regions of different video resolution.  It's 480 bytes that are used in RAM, so even more RAM is dedicated for video.  

    Each video byte then can represent 8 pixels, or 4 pixels, or 2 pixels, or 1 pixel.  So I need to do two things at once - first choose which of those pixels I'm drawing, and then what color it needs to be.  I do both in one PLD -  the color decoder.  I have to feed into it the 8-bit pixel byte and the three lowest horizontal count values so it knows which pixel to draw within the byte.  And it needs the color mode.  So it needs 8 inputs for the data, 3 for the which pixel to draw, and 2 for the color mode.  That's 13 inputs.  And it needs 8-bits to output the color value.  It's the normal resistor ladder DAC.  I chose 3 bits for red and green, and 2 bits for blue.  I also have one more input to black the video out during video-off times.  

    I did one more thing to save RAM.  I added the option to repeat a line.  Then you can use that video RAM for something else.  It halves the amount of RAM used for video.  And then I added another option to repeat 4x to free up even more RAM.

    At the end, I had four extra bits in the video mode register.  So I added a few more resistors onto the DAC to pull the black level up.  Then I could get 8 colors in a line to make the monochrome mode a little more colorful.  And then I added one more bit to blank the entire line - just in case you don't need that line, it will draw it black by using the video active mode input to the color decoder.  That saves the RAM of that whole line if needed.

    So in short, lots of places to get that RAM back from the video.  Lots of options for software developers.

  • Raster memory

    Justin Davis • 5 days ago • 0 comments

    I mentioned I wanted the raster video in the upper region of RAM, but I do it differently that just about everyone else.  Since the raster video takes so much video space (38,000 bytes) I want as much *consecutive* memory space as possible for CPU instructions.  Most people use the horizontal count for the lower bits and vertical for the upper bits, but I swap them.  You can see below the green area which is the consecutive RAM.  This makes the consecutive RAM area go from about 4k to 24k. 

    This makes for a confusing memory organization because now each consecutive RAM address is the next row instead of the next column.  So if you want to print a string of characters, you can't just add one for each character.  Instead, you have to add 0x0200 to get to the next one.  But that's just as fast as as adding one in my architecture.  I'm not sure why no one else has done it this way....

  • Video circuit

    Justin Davis • 5 days ago • 0 comments

    Boards are ordered!   While I wait, I figure I can describe the video circuit.  It's the same as others out there, but implemented differently.  I have to keep track of horizontal and vertical count.  And those counts feed the RAM address for raster data.  Since I'd like to do the full 640x480 of active video, I need 800x525 lines total.  The extras count past the blanking areas.  For both the count 800 and 525 I need a 10-bit counter.  Since most counters only come in 8-bit, then you need multiple ones.  And there's the added difficulty that you have to decode the output in order to reset in time.

    However, I don't want my address to start at 0x0000.  I'd prefer to have it in the upper memory region.  So instead, I count up to the maximum and reload at a non-zero value.  So the horizontal counter starts at 224 and counts to 1023 (800 counts).  And the vertical counter starts at 499 and counts to 1023 (525 counts).

    I need to use the horizontal terminal count to feed to the vertical counter, so that has to be output.  And I need a signal to indicate when the counters are within the active video range.  And I need to know when the two syncs must be generated.  That's a lot of decoding.  And that's one reason why I'd prefer a PLD.  

    The PLDs can have up to 10 outputs (each with a register).  So they make for a perfect 10-bit counter.  However, I can't do the decoding then because I'm out of outputs.  So I need a separate PLD for decoding the syncs.  In total I use 3 PLDs - one for horizontal, one for vertical, and one for syncs.  

    There's several nuances where I optimized them.  I ended up putting the lowest 3-bits of the horizontal counter into the sync PLD instead, and use the horizontal PLD to do its own decoding.  Again, because of limits of the inputs/outputs of the PLDs.  I can't feed the whole horizontal and vertical count into the sync chip.  So I mostly use it to decode the vertical count instead.  But these three chips are all that's needed to get a VGA monitor to lock onto the signal.

  • 4-bit ALU

    Justin Davis • 11/04/2026 at 01:46 • 0 comments

    As I'm waiting for boards to get delivered, I figure I'd explain a few parts of the PLACARD.  The ALU was designed to resemble the old 74LS181 ALU.  It has two 4-bit inputs and a 4-bit output.  It doesn't have all the functions of the -181, but it has enough important ones.  Since the PLD has 23 pins (13 inputs, 10 input/outputs) it has just enough pins.  I needed to chain two together, so it needs a carry-in and a carry-out.  

    I first looked at the most used instructions in CPUs and supported the top ones.  Some I didn't need like NOT because XOR could do it.  And shift-left I didn't need because I can add the same number to itself to get a shift-left.  But shift-right is much harder, so I wanted to implement that one.  However, there was no way to pass backward from the MSB to the LSB chip, so I needed to add another input exclusively for what bit gets shifted in.  I found you don't really need more than these core instructions - the utilization goes way down after these.  So I only really needed 8 instructions which was perfect.

    S2 S1 S0FunctionF =COUTCPU Instructions
    000Pass BB0ld
    001ANDA AND B0and
    010ORA OR B0or
    011XORA XOR B0xor, not (XOR FFh), clr (XOR AC with itself)
    100AddA + B + CINcarryadd, inc (+1), shl (AC + AC)
    101SubtractA - B - CINborrowsub, dec (-1)
    110Shift rightA >> 1bit shifted outshr
    111Pass AA0jmp and all branches

    I also needed two PASS options to support loading when the ALU is not used at all (PASS B).  And then a way to get the accumulator value out to evaluate for branches (PASS A).  The accumulator is on input A.  The branches use the flag outputs - zero (Z), sign (NEG), and carry (COUT).

    This was part of the inspiration to use PLDs.  I found an easy way to (mostly) replicate the obsolete -181 chip and bring the chip count of a hand-made ALU way down.  And I didn't want to go down the path of ROM-ALU.  

    The propagation delay through the chip is 7.5ns.  However, the ADD command was a ripple-carry adder at first.  I learned that hits the 7.5s for every bit (30ns for the whole chip - 60ns for the whole byte).  I only have ~39ns to meet timing, so I had to change it to a fast-carry adder instead to keep the 7.5ns timing, but fortunately I had enough resources left to pull it off.

  • SNES connectors

    Justin Davis • 11/02/2026 at 02:43 • 0 comments

    I received the last thing I was waiting on to finish the board layout - the SNES connectors.  I had to order them from China.  There's no datasheet for them that I could find and I needed to be certain of the dimensions for the layout.  I believe I can finish the layout tomorrow and get some quotes.  Although PCBWay did say they were interested in sponsoring them.  I've used them many times in the past and have never had any issues.  But then I never really put their capabilities to the test.  And I probably won't with this board either - 25.175MHz isn't too tough.  And it won't stress their minimums at all as far as trace width or via size.  I expect there to be no issues with the fabrication.

    I'm planning on testing my step-by-step bring up procedure, so no assembly this time.  I'd like to insert one chip at a time and have some active verification whether it's measuring a voltage or frequency, or see something on the screen.  

  • Benchmarks

    Justin Davis • 10/28/2026 at 02:07 • 0 comments

    The CPU runs at 25.175MHz, but skips every 8th clock when drawing the active area of the screen.  Each instruction is either 2,3, or 4 clocks.  On average it runs about 7 million instructions per second depending on the application.  It's screaming fast, but doesn't have much in the way of graphics acceleration (other than the fact it doesn't stall the CPU very much).  But that's ok - there's plenty of CPU time to do some graphics help as needed.

    Pi spigot

    • 1000 exact digits of pi with integer arithmetic only, printed as they come out. 
    • 69.9s
    • Other systems:
      • C64: 295.57s
      • Atari 800XL: 181.69s
      • Apple IIgs: 108.57s

    Mandelbrot

    • Monochrome 640 x 480 points: 81.0 s
    • 4-color 320x240 points: 20.4s
    • 16-color 160x120 points: 5.2s
      • Gigatron: 8,243s
      • C64: 160x200 points: 190s
      • Atari 800: 160x100 points: 24s
    • 256-color 80x60 points: 1.3s

    Game of Life

    • 640 x 480 cells on a torus
    • 1000 generations
    • 282s
    • 1 million cells per second
      • C64: 2,250 cells per second

  • Holding off

    Justin Davis • 10/28/2026 at 00:50 • 0 comments

    I've waited to open the project up until the last minute.  I wanted to get boards in hand before going public, but I want to submit to this year's retrocomputer challenge.

    I wanted to verify the timing and logic of the design in VHDL before I started with chips.  It's much easier to make design changes with a few lines of code than rewiring solderless breadboards.  I can load the ROM as a memory initialization file.  I made the top-level VHDL code structural to represent the schematic for the board.  I wanted each PLD a module with only its equations inside.  Some registers are just processes, but that's ok.  The Basys3 is an easy board for this since it has a VGA output and plenty of LEDs/buttons to simulate functions.  It has a USB port to simulate a PS/2 keyboard or mouse.

    Everything is fully operational on the FPGA.  Software development can continue on the FPGA for the library and demos/benchmarks.  It should perform the same as the board.

    Of course, the end goal is getting a board made.  So I have the KiCad main board and cartridge schematics finished.  The board is 95% routed, so I should be ordering boards any day now.  

View all 7 project logs

Enjoy this project?

Share

Discussions

Does this project spark your interest?

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