#Script: tr -d '\r' < 1.txt > 1nl.txt #replace HP-16500C "0D 0A" newline with UNIX "0A" newline tr -d '\r' < 2.txt > 2nl.txt #replace HP-16500C "0D 0A" newline with UNIX "0A" newline la2vcd -td 1us -r 16 1nl.txt -r 16 2nl.txt -o vcd-out.vcd #convert HEX HP-16500C output into binary for expresso: awk 'BEGIN { FS = "" a["F"]="1111" a["E"]="1110" a["D"]="1101" a["C"]="1100" a["B"]="1011" a["A"]="1010" a["9"]="1001" a["8"]="1000" a["7"]="0111" a["6"]="0110" a["5"]="0101" a["4"]="0100" a["3"]="0011" a["2"]="0010" a["1"]="0001" a["0"]="0000" } { getline < "1nl.txt"; for (i=1;i<=length($0);i++) printf a[($i)]; print "" }' 1nl.txt > 1nlb.txt #convert HEX HP-16500C output into binary for expresso: awk 'BEGIN { FS = "" a["F"]="1111" a["E"]="1110" a["D"]="1101" a["C"]="1100" a["B"]="1011" a["A"]="1010" a["9"]="1001" a["8"]="1000" a["7"]="0111" a["6"]="0110" a["5"]="0101" a["4"]="0100" a["3"]="0011" a["2"]="0010" a["1"]="0001" a["0"]="0000" } { getline < "2nl.txt"; for (i=1;i<=length($0);i++) printf a[($i)]; print "" }' 2nl.txt > 2nlb.txt #Merge pattern and PAL-output files: awk '{ getline a < "1nlb.txt"; getline b < "2nlb.txt"; print a, " ", b}' 2nlb.txt > out.txt #Insert following lines on top of out.txt: .i 16 # .i specifies the number of inputs .o 8 # .o specifies the number of outputs .ilb PG15 PG14 PG13 PG12 PG11 PG10 PG9 PG8 PG7 PG6 PG5 PG4 PG3 PG2 PG1 PG0 # This line specifies the names of the inputs in order .ob LA7 LA6 LA5 LA4 LA3 LA2 LA1 LA0 # This line specifies the names of the outputs in order #Espresso solver: espresso -Dd1merge -s out.txt > out2.txt #simplify to reduce time espresso2 -D exact -o eqntott -s out2.txt #find exact solution espresso2 -D exact -o eqntott -s out2.txt > solved.txt #find exact solution PAL16L8-Pinout/Pattern/Logic-Connections ------------------ PG0---|1-I 20-VCC|---VCC PG1---|2-I 19-O|---LA7 PG2---|3-I 18-IO|---PG15/LA6 PG3---|4-I 17-IO|---PG14/LA5 PG4---|5-I 16-IO|---PG13/LA4 PG5---|6-I 15-IO|---PG12/LA3 PG6---|7-I 14-IO|---PG11/LA2 PG7---|8-I 13-IO|---PG10/LA1 PG8---|9-I 12-O|---LA0 GND---|10-GND 11-I|---PG9 -----------------