Alternate Decoder Logic using a GAL


Glue Logic using a GAL16V8

The glue logic perfectly fits in a small GAL. The only inputs needed are

A0, BUFCTL, SCTL, LAIO0, LAIO1, LAIO2, LAIO3, LBS0, LBS1

and the outputs the GAL generates are

OE, WEL, WEU, GPREAD, CE, IO

The SBC has a socket U18 prepared that can be used to install the GAL with the following equations. Note that if you install the GAL you don’t have to install the other six TTL logic devices U4, U7, U8, U10, U13, U14. The GAL completely replaces them. Also when installing the GAL you should use a socket as you cannot programm the GALs in-circuit and later cards that go into the expansion slot will take over the decoding alltogether.

Design File for the GAL16V8

Here you have the source code for the GAL. This design file is intended to be used with WinCUPL. WinCUPL can be downloaded from the Microchip web site and is free.

https://www.microchip.com/en-us/products/fpgas-and-plds/spld-cplds/pld-design-resources

Name      DCJ11 SBC Decoder;
Partno    GAL;
Date      13/04/2025;
Rev       1.3.0;
Designer  cbscpe;
Company   Netzwerk & Design GmbH;
Assembly  None;
Location  None;
Device    G16V8;

/*
	Decoder GAL for the DCJ11 SBC V1.3
	
	This GAL replaces the six TTL logic ICs normally used
	to decode the minimal signals on the SBC. But to make
	things simpler a GAL has been fitted to the PCB. You
	either install the six TTL logic ICs or the GAL but
	never both at the same time as they are connected in
	parallel. The TTL logic ICs still exist for those who
	want to build the SBC but have no access to a GAL or
	GAL programmer.
	
	GALs are no longer produced, only Microchip produces
	pin replaceable EEPLDs. There are some major differences
	between those EEPLDs and GALs. EEPLDs support only about
	hundred erase cycles, where as GALs support thousands.
	Second the programming algorithm for the EEPLDs is not
	documented and I suppose the programmers that support
	the EEPLDs are using reverse engineered algorithms.
	
	To compile this PLD design file I use a batch file that
	invokes the command line tools that come with WinCUPL.

	.\cupl.bat Z:\DCJ11SBC\DCJ11SBC.PLD

	To program the GAL I use a T48 programmer from XGecu
	and the open source program minipro which runs on Linux
	and macOS.

	minipro -p GAL16V8D -w DCJ11SBC.jed
 */
PIN         1 =  LAIO3;
PIN         2 =  LAIO2;
PIN         3 =  LAIO1;
PIN         4 =  LAIO0;
PIN         5 =  LBS0;
PIN         6 =  LBS1;
PIN         7 = !SCTL;
PIN         8 = !BUFCTL;
PIN         9 =  A0;

PIN        12 = !OE;

PIN        15 = !WEL;
PIN        16 = !WEU;
PIN        17 = !CE;
PIN        18 = !IO;
PIN        19 = !GPREAD;

OE            =  LAIO3 &  LAIO2 & !LAIO1 & !LAIO0          &  BUFCTL
              #  LAIO3 & !LAIO2                            &  BUFCTL;
          
CE            = !LBS1  & !LBS0;

IO            =  LBS1  & !LBS0;

WEL           = !LAIO3 & !LAIO2 & !LAIO1                   & !BUFCTL &  SCTL
              # !LAIO3 & !LAIO2 &  LAIO1          & !A0    & !BUFCTL &  SCTL;

WEU           = !LAIO3 & !LAIO2 & !LAIO1                   & !BUFCTL &  SCTL
              # !LAIO3 & !LAIO2 &  LAIO1          &  A0    & !BUFCTL &  SCTL;

GPREAD        =  LAIO3 &  LAIO2 &  LAIO1 & !LAIO0          &  BUFCTL;

To program the GAL I use a XGecu T48 universal programmer and the minipro tool available on github

https://gitlab.com/DavidGriffith/minipro/

peter@MacBook-Air-von-Peter DCJ11SBC % minipro -p GAL16V8D -w DCJ11SBC.jed         
Found T48 01.1.32 (0x120)
Warning: T48 support is experimental!
Warning: Firmware is newer than expected.
  Expected  01.1.31 (0x11f)
  Found     01.1.32 (0x120)
Device code: 4CA19008
Serial code: MH1N82RUHS50LESSGTD27227

VPP=16V
Declared fuse checksum: 0x2C03 Calculated: 0x2C03 ... OK
Declared file checksum: 0xBBD1 Calculated: 0xBBD1 ... OK
JED file parsed OK

Erasing... 0.82Sec OK
Writing jedec file...  3.37Sec  OK
Reading device...  0.08Sec  OK
Verification OK
peter@MacBook-Air-von-Peter DCJ11SBC % 

Update Version 1.3.2

Revision 1.3.2 of the project makes some more signals available to the GAL. Of course it includes the missing connection of the TEST input of the DC319, corrected in revision 1.3.1. The following signals have been added

  • NXM
  • CONT
  • MISS
Name      DCJ11 SBC Decoder;
Partno    GAL;
Date      13/04/2025;
Rev       1.3.2;
Designer  cbscpe;
Company   Netzwerk & Design GmbH;
Assembly  None;
Location  None;
Device    G16V8;

/*
	Decoder GAL for the DCJ11 SBC V1.3.2
	
	This GAL replaces the six TTL logic ICs normally used
	to decode the minimal signals on the SBC. But to make
	things simpler a GAL has been fitted to the PCB. You
	either install the six TTL logic ICs or the GAL but
	never both at the same time as they are connected in
	parallel. The TTL logic ICs still exist for those who
	want to build the SBC but have no access to a GAL or
	GAL programmer.
	
	GALs are no longer produced, only Microchip produces
	pin replaceable EEPLDs. There are some major differences
	between those EEPLDs and GALs. EEPLDs support only about
	hundred erase cycles, where as GALs support thousands.
	Second the programming algorithm for the EEPLDs is not
	documented and I suppose the programmers that support
	the EEPLDs are using reverse engineered algorithms.
	
	To compile this PLD design file I use a batch file that
	invokes the command line tools that come with WinCUPL.

	.\cupl.bat Z:\DCJ11SBC\DCJ11SBC-V1-3-2.PLD

	To program the GAL I use a T48 programmer from XGecu
	and the open source program minipro which runs on Linux
	and macOS.

	minipro -p GAL16V8D -w DCJ11SBC-V1-3-2.jed
 */
PIN         1 =  LAIO3;
PIN         2 =  LAIO2;
PIN         3 =  LAIO1;
PIN         4 =  LAIO0;
PIN         5 =  LBS0;
PIN         6 =  LBS1;
PIN         7 = !SCTL;
PIN         8 = !BUFCTL;
PIN         9 =  A0;
PIN        11 =  NXM;

PIN        12 = !OE;
PIN        13 = !MISS;
PIN        14 = !CONT;
PIN        15 = !WEL;
PIN        16 = !WEU;
PIN        17 = !CE;
PIN        18 = !IO;
PIN        19 = !GPREAD;

OE            =  LAIO3 &  LAIO2 & !LAIO1 & !LAIO0          &  BUFCTL
              #  LAIO3 & !LAIO2                            &  BUFCTL;
          
CE            = !LBS1  & !LBS0;

IO            =  LBS1  & !LBS0;

WEL           = !LAIO3 & !LAIO2 & !LAIO1                   & !BUFCTL &  SCTL
              # !LAIO3 & !LAIO2 &  LAIO1          & !A0    & !BUFCTL &  SCTL;

WEU           = !LAIO3 & !LAIO2 & !LAIO1                   & !BUFCTL &  SCTL
              # !LAIO3 & !LAIO2 &  LAIO1          &  A0    & !BUFCTL &  SCTL;

GPREAD        =  LAIO3 &  LAIO2 &  LAIO1 & !LAIO0          &  BUFCTL;

/*
	Assert !MISS only for non-existant RAM, this will shorten the
	memory read cycles to 4 clock cycles and make the DCJ11 think
	that these are cache hits. You need to install RAM with an 
	access time of 70ns or less.
 */

MISS          = !LBS1 & !LBS0 &  NXM;

/*
	Modify !CONT to stretch the CPU cycles for writes to external
	IO registers so that the write impulse for the DC319 or CDP6402
	is increased to match the requiremenets even for clock rates 
	above 10MHz. By delaying CONT with SCTL for writes to external
	IO registers the write pulse will be increased from 1 to 3 
	clock cycles. 

	For memory access we also have to assert CONT as read-modify-write
	memory cycles use a stretched read cycle.
 */
 
 CONT          = !LBS1 & !LBS0 & !NXM
               # !LBS1 & !LBS0 &  NXM &  SCTL
               # !LBS1 &  LBS0
               #  LBS1 & !LBS0        &  SCTL
               #  LBS1 &  LBS0;

Some remark regarding GAL

GAL are long obsolete and no longer produced. However in retrocomputing they are quite handy. For a long time I was not very interested in using GALs again, but since I found out that the T48 from XGecu is able to program the ATF SPLDs from Atmel/Microchip and as the ATF16V8 and ATF22V10 are still available even in DIL packages I again started to use GAL or in this case EEPLDs, as the ATF family is named. I still have a large stock of GAL and for simple decoding jobs they are perfect in retrocomputing projects. For more complex tasks however I normally use the ATF150x CPLDs from Atmel/Microchip. Good thing is that all these devices are still available for 5V.

Note that even so the EEPLDs from Microchip are one-to-one replacements for the former Lattice GAL there is one huge difference as EEPLDs can only be reprogrammed approx 100 times whereas GALs supported at least 10'000 write cycles.