I am building an accessory for a 6502-based computer, and am trying to stick with (reasonably) period-era components. To this end I am using a GAL16v8 (specifically an ATF16V8C) to handle register selection, interrupt signaling, and resetting. Everything worked fine until I realized I needed to change how to signal clearing an interrupt. When I changed my logic equations to add the new functionality WinCUPL returned an error: "Excessive number of product terms: IRQTMP".
I am familiar with what this error means, however I am not sure how/if I can simplify the required logic. Is there a way to make this logic work on a GAL16V8?
The contents of my .pld file (minus the header info):
/* *************** INPUT PINS *********************/ PIN 1 = CLK ; /* */ PIN 2 = RW ; /* */ PIN 3 = CS1 ; /* */ PIN 4 = CS2 ; /* */ PIN 5 = RS0 ; /* */ PIN 6 = RS1 ; /* */ PIN 7 = RESET ; /* */ PIN 8 = IRQIN ; /* */ PIN 9 = INHIBITIN ; /* */ /* *************** OUTPUT PINS *********************/ PIN 11 = RESETIRQ ; /* */ PIN 12 = IRQ ; /* */ PIN 13 = IRQN ; /* */ PIN 14 = IRQTMP ; /* */ PIN 15 = INHIBIT ; /* */ PIN 16 = R2 ; /* */ PIN 17 = R1 ; /* */ PIN 18 = R3 ; /* */ PIN 19 = R0 ; /* */ /** Declarations and Intermediate Variable Definitions **/ ENABLE = (CS1 & !CS2); ACTIVER = (ENABLE & CLK & RW); ACTIVEW = (ENABLE & CLK & !RW); WRITER3 = (ACTIVEW & RS0 & RS1); /** Logic Equations **/ R0 = !(ACTIVER & !RS0 & !RS1); R1 = !(ACTIVER & RS0 & !RS1); R2 = !(ACTIVER & !RS0 & RS1); R3 = !(ACTIVER & RS0 & RS1); RN = (!(WRITER3 & RESETIRQ) & RESET); IRQTMP = (!IRQIN # (RN & IRQTMP)); RESETINHIBIT = (!RESET # (!INHIBITIN & WRITER3)); S = (INHIBITIN & WRITER3); INHIBIT = (!RESETINHIBIT & (S # INHIBIT)); IRQ = (IRQTMP & !INHIBIT); IRQN = !(IRQTMP & !INHIBIT); The logic diagram I am trying to create:
