Hex to 7-Segment decoder PLD

I was getting annoyed that I cannot find a non-obsolete Hex to 7-Segment decoder chip but plenty of BCD to 7-Segment decoders so I resorted to creating my own using an Atmel ATF16V8B PLD (Found on Digikey for C$1.38 ATF16V8B-15PU-ND).

Alternatively this can be achieved using a ROM (EPROM and EEPROM too) with the techniques on the “using ROM as combinational logic” page.

I chose this device because it is an actively stocked device on Digikey and is supported by the miniPro TL866 programmer.

I started doing the Boolean algebra and kept getting errors so I finally settled on using fields and tables.

Compiled JED file can be downloaded here:  this can be burned directly into the chips without the need of having to compile it yourself.


Below is the WinCUPL source code, it is currently set to common Anode. For common Cathode, swap the tables and recompile.

Name 7segDecoder ;
PartNo 00 ;
Date 5/17/2019 ;
Revision 01 ;
Designer Peter Murray ;
Company N/A ;
Assembly None ;
Location Right here ;
Device g16v8 ;

/*
Hex to 7-segment LED display converter
The default mode is common Anode, but you can swap the tables out below to make it common cathode

+----\/----+
I0 | 1 20 | Vcc
I1 | 2 19 | Segment A
I2 | 3 18 | Segment B
I3 | 4 17 | Segment C
N/C | 5 16 | Segment D
N/C | 6 15 | Segment E
N/C | 7 14 | Segment F
N/C | 8 13 | Segment G
N/C | 9 12 | N/C
GND | 10 11 | N/C
+----------+

This is designed for the Atmel ATF16V8B (Digikey: ATF16V8B-15PU-ND )

This file is free for anyone to use for whatever reason, no warranty implied.
(C)Peter Murray 2019 - 39k.ca
*/

/* *************** INPUT PINS *********************/
PIN 1 = I0 ; /* */ 
PIN 2 = I1 ; /* */ 
PIN 3 = I2 ; /* */ 
PIN 4 = I3 ; /* */ 
/* *************** OUTPUT PINS ******************** */
PIN 19 = A;
PIN 18 = B;
PIN 17 = C;
PIN 16 = D;
PIN 15 = E;
PIN 14 = F;
PIN 13 = G;

FIELD INPUT = [I0,I1,I2,I3]; /* Defines input array */
FIELD OUTPUT = [A,B,C,D,E,F,G]; /* Defines output array */
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;
}

/* Use this table for common cathode displays
{
'b'0000 => 'b'1111110;
'b'0001 => 'b'0110000;
'b'0010 => 'b'1101101;
'b'0011 => 'b'1111001;
'b'0100 => 'b'0110011;
'b'0101 => 'b'1011011;
'b'0110 => 'b'1011111;
'b'0111 => 'b'1110000;
'b'1000 => 'b'1111111;
'b'1001 => 'b'1110011;
'b'1010 => 'b'1110111;
'b'1011 => 'b'0011111;
'b'1100 => 'b'1001110;
'b'1101 => 'b'0111101;
'b'1110 => 'b'1001111;
'b'1111 => 'b'1000111;
}
*/