One of those recurring topics for basic single board computers is displaying addresses and data. Using seven segment LED displays seems simple, until you find that converting nybles to 7 segments is not trivial. Hex to 7 segment decoder chips were discontinued years ago and displays with integrated decoders are expensive. Discrete logic solutions take up a good deal of space, and microcontrollers, while effective, seem somehow...inelegant. I'm working on a front panel, so driving the display with a I/O chip (as the KIM-1 does) is not right either.
There have been previous suggestions to use a small PLD for this purpose. Here's my solution;
Code:
Name sevenseg;
Partno AN001;
Revision 01;
Date 1/14/19;
Designer M. Bakula;
Company Tristate Mechatronics;
Location Lake Mary, FL;
Assembly Front Panel;
Device g16v8a;
/******************************************************/
/* */
/* sevenseg - hex to seven segment decoder. */
/* */
/* binary on pins 2-5 produces segment outputs */
/* 7 segment on pins 12 -18. */
/* */
/******************************************************/
/** Inputs **/
Pin [2..5] = [I0..3];
/** Outputs **/
Pin [12..18] = [Q0..6];
/** Var Declarations **/
Field input = [I3..0];
Field output = [Q6..0];
/** Logic Equations **/
Table input => output {
'b'0000 => 'b'0000001;
'b'0001 => 'b'1001111;
'b'0010 => 'b'0010010;
'b'0011 => 'b'0000110;
'b'0100 => 'b'1001100;
'b'0101 => 'b'0100100;
'b'0110 => 'b'0100000;
'b'0111 => 'b'0001111;
'b'1000 => 'b'0000000;
'b'1001 => 'b'0001100;
'b'1010 => 'b'0001000;
'b'1011 => 'b'1100000;
'b'1100 => 'b'0110001;
'b'1101 => 'b'1000010;
'b'1110 => 'b'0110000;
'b'1111 => 'b'0111000;
}
Pins 5 to 2 are MSB to LSB inputs, and pins 18 to 12 are segments a-g in order. The outputs are low-active for a common anode display.
I compiled this with WinCUPL, and programmed an Atmel ATF16V8B-15PU with the resulting .jed file, using a MiniPro TL866CS. The attached photo shows the results. Other than WinCUPL crashing (I think due to issues with Windows 10, but I'm not a Windows person,) it was quite simple to create the chip. When my planned LED displays come in, I'll probably play with the pin assignments to make integration on a breadboard easier.