Page 1 of 1

GAL programming conundrum.

Posted: 11 Nov 2026 21:33
by stephen_usher
Here's a problem:

A set of signals select the enable for an output.

Later another signal pulses high then low after this is enabled.

The output selected must then be disabled on the falling edge of the second signal. The state is reset when the selection terminates.

How would I go about doing this using an ATF16V8B GAL?

It would have to go into register mode I would imagine.

Any experts here?

Re: GAL programming conundrum.

Posted: 11 Nov 2026 23:58
by exxos
I've pretty much forgot gal stuff.. So here's a AI verbose instead :P

Code: Select all

Name     SELLATCH;
PartNo   00;
Date     11/11/2026;
Revision 01;
Designer exxos;
Company  exxos;
Assembly None;
Location None;
Device   g16v8ma;   /* complex mode: async logic with I/O feedback */

/* Inputs */
Pin 2 = S0;         /* select code bit 0          */
Pin 3 = S1;         /* select code bit 1          */
Pin 4 = EN;         /* selection active (high)    */
Pin 5 = PULSE;      /* second signal              */

/* Outputs */
Pin 12 = OUT0;
Pin 19 = OUT1;
Pin 13 = OUT2;
Pin 14 = OUT3;

/* Internal latches, must be on 13-18 for feedback in complex mode */
Pin 15 = ARM;
Pin 16 = DONE;

/* ARM: set by PULSE high, held while selected, cleared when EN drops */
ARM  = EN & PULSE
     # EN & ARM;

/* DONE: set by PULSE low after ARM, held while selected */
DONE = EN & ARM & !PULSE
     # EN & DONE;

/* Decoded outputs, killed by DONE */
OUT0 = EN & !S1 & !S0 & !DONE;
OUT1 = EN & !S1 &  S0 & !DONE;
OUT2 = EN &  S1 & !S0 & !DONE;
OUT3 = EN &  S1 &  S0 & !DONE;