Name ay38910control;
Partno hbc5601;
Revision 02;
Date 8/8/2021;
Designer Troy Schrapel;
Company Troy Schrapel;
Location Australia;
Assembly None;
Device g16v8;

/*
 * Input pins
 */
Pin 1 = a0;
Pin 2 = a1;
Pin 3 = a2;
Pin 4 = !a3;
Pin 5 = !a4;
Pin 6 = !a5;
Pin 7 = a6;
Pin 8 = !a7;
Pin 9 = !ior;
Pin 11 = !w;


/*
 * Output pins
 */
Pin 19 = bc1;
Pin 18 = dir1;

Pin 17 = bc2;
Pin 16 = dir2;

/*
 * Common logic
 */
cardsel = ior & a3 & a4 & a5 & a6 & a7;
chip1sel = cardsel & !a2;
chip2sel = cardsel & a2;

dir = w & !a1;
bc = ((!w & a1) # (!a0 & !a1 & w));

/*
 * Output logic
 */
bc1 = chip1sel & bc;
dir1 = chip1sel & dir;

bc2 = chip2sel & bc;
dir2 = chip2sel & dir;
