# C128 PLA minimization and analyzis with the boolean
# minimizer espresso.
#
# Done 2003-01-21 by Wolfgang Moser <http://d81.de>
#
# Based upon the work of Nicolas Welte, who 'read' out the
# contents of the C128-PLA into a huge binary dump, check
# out the file 8721.ZIP at:
#  http://www.funet.fi/pub/cbm/firmware/computers/c128/
#
# For espresso see:
#  http://archives.seul.org/geda/dev/Apr-2002/msg00060.html
#  ftp://ftp.cs.man.ac.uk/pub/amulet/balsa/other-software/espresso-ab-1.0.tar.gz
#  http://www.cs.indiana.edu/classes/c421/man/espresso.1.html
#  http://www.fke.utm.my/downloads/espresso/
#
# This file describes the (partly) minimized PLA contents
# in Berkeley PLA standard format, see:
#  http://bear.ces.cwru.edu/eecs_cad/man_octtools_espresso_inputs.html
#  http://css.engineering.uiowa.edu/~switchin/espresso.5.html
# for more.


# This file describes only 17 of the 18 used outputs of the
# C128 PLA chip. For complexity reasons, the line CASENB has
# been taken out. This reduces the number of (shared) product
# terms from 356 to 102.
# It should be used for further optimizations, later the
# CASENB signal could be added again, so that it also
# (re)uses the outputs of all other equations as input
# again.


# Attention CASENB is missing in the output bits !!!
#
# 27 Inputs, in this order
#
# PLA signal   position in word dump / byte dump
# pin          (based onto Nicolas' plain PLA dump)
# 27  128/256           A27              A26
#  8  DMAACK            A26              A25
#  7  VICFIX            A25              A24
# 15  64/128            A24              A23
# 13  Z80 EN            A23              A22
# 14  Z80 I/O           A22              A21
#  1  A15               A21              A20
#  2  A14               A20              A19
#  3  A13               A19              A18
#  4  A12               A18              A17
#  5  A11               A17              A16
#  6  A10               A16              A15
#  9  AEC               A15              A14
# 10  R/W               A14              A13
# 11  GAME              A13              A12
# 12  EXROM             A12              A11
# 16  I/O SE            A11              A10
# 17  ROMBANKHI         A10              A9
# 18  ROMBANKLO         A9               A8
# 19  VMA4              A8               A7
# 20  VMA5              A7               A6
# 21  BA                A6               A5
# 22  LORAM             A5               A4
# 23  HIRAM             A4               A3
# 25  CHAREN            A3               A2
# 26  VA14              A2               A1
# 47  CLK               A1


# 17 Outputs, in this order
#
# PLA signal   position in word dump / byte dump
# pin          (based onto Nicolas' plain PLA dump)
# 29  /SDEN                              D3
# 34  /ROM4                              D2
# 36  /ROM2                              D1
# 39  DIR                                D0
# 30  /ROML             D13
# 31  /ROMH             D12
# 32  CLRBNK            D11
# 33  /FROM             D10
# 35  /ROM3             D9
# 37  /ROM1             D8
# 38  /I/O CS           D7
# 40  DWE               D6
# 42  /VIC              D4
# 43  /I/O ACC          D3
# 44  GWE               D2
# 45  /COLRAM           D1
# 46  /CHAROM           D0
#
# (this term has taken out to reduce complexity: 41  CASENB            D5)

# Power supply and N.C.
#
# 48  VCC
# 24  VSS
# 28  N/C

# 18 Outputs, product term analysis
#
# PLA signal  No PTs used
# pin          
#------------------------------------------
# 29  /SDEN       5
# 34  /ROM4      18
# 36  /ROM2      12
# 39  DIR        32
# 30  /ROML      27
# 31  /ROMH      27
# 32  CLRBNK      3
# 33  /FROM      14
# 35  /ROM3      18
# 37  /ROM1      28
# 38  /I/O CS    25
# 40  DWE        16
# 42  /VIC       27
# 43  /I/O ACC   25
# 44  GWE        17
# 45  /COLRAM    26
# 46  /CHAROM    28
.i 27
.o 17
.p 102
-------------00000000000000 00000000000100000
----001101----00-------00-- 00010000000000000
----001101--1-1-------00--- 00010000000000001
---11-1101-1----0----1----- 00010000000000000
----001101-----0------00--- 00010000000000000
---0--1101-1---------11-1-- 00010000000000000
----0-000100----0---------- 00010000000000000
----001101-----------0--1-- 00010000000000000
---0--11-1-1---------1-11-- 00010000000000000
---000-1------01-----0----- 00010000000000000
---1001101--1-------------- 00011000100000001
----010000--1----00-------- 00111101101011111
---0--100------0------11--- 00010100010000000
---0---1---1--01-----1----- 00010000000000000
---0-1-1----1--0------00--- 00000000001011010
---0-1-1----1-1-------00--- 00000000001011011
---1--1-----1---101-------- 00010000000000001
---0--101-----0--------1--- 00011000010000000
---1--1---------110-------- 00010000000000000
---1--1101--1---0---------- 01001101110000001
---1--01---------00-------- 00010000000000000
---0--0--1----01----------- 00010000000000000
---01-------1--0------00--- 00000000001011010
---0--1-1-------------11--- 00010000000000000
---0---1-0----01----------- 00010000000000000
---0--10----1-01----------- 00010100010000000
---0-1-1----1-1---------0-- 00000000001011010
---0-1-1----1--0--------0-- 00000000001011010
---1--1--0-------01-------- 00010000010000000
---1--1-1--------01-------- 00010000010000000
---01-------1-1-------00--- 00000000001011011
---0--111--------------1--- 01010000000000000
--------010-1---1---------- 01000000010000110
---11-11----1---1---------- 00001000101011010
---0--1-0-----11----------- 00001100010000000
---01-------1-1---------0-- 00000000001011010
-----1-1----11-------0----- 00000000001011010
---01-------1--0--------0-- 00000000001011010
---1--1--0--------0-------- 00010000000000000
---1--1-1---------0-------- 00010000000000000
---10111----1-------------- 00001000101011011
---1--10----------0-------- 00010000000000000
---0--------1-0--------0--- 00000000000000001
---0----0------0------0---- 00001100000000000
---1--1----------00-------- 00101101000000000
---0----1-----01----------- 00011000010000000
---1--10---------0--------- 00010100010000000
--01--------0-------------- 00000000000000001
---1--------0-----------1-- 00000000000000001
---0--1--------0-------0--- 00001100010000000
----1-------11-------0----- 00000000001011010
---0--------0------------0- 00000000000000001
---0----------01----------- 00000000000000001
------10--------------0---- 00000000010000000
-------0--1-1-------------- 00000000000000110
---0---1-------0----------- 00000100000000000
---0----1--------------0--- 01000000010000000
---0--------1-----------1-- 00000000000000001
---0----1-----1------------ 00001100000000000
--------011---------------- 01000000010010000
---0---10---1-------------- 01001100010000000
-------1--0-1-------------- 00000000000000110
------------0----------1--- 00000010000000000
-------------1------------1 00000000000100000
-------------1-----------1- 00000000000100000
-------------1-----1------- 00000000000100000
-------------1------1------ 00000000000100000
-------------1---1--------- 00000000000100000
-------------1--------1---- 00000000000100000
-------------1-------1----- 00000000000100000
-------------1--1---------- 00000000000100000
-------------1----------1-- 00000000000100000
-------------1---------1--- 00000000000100000
-------------1-1----------- 00000000000100000
-------------11------------ 00000000000100000
------------1---------1---- 00000010000000000
------------0-1------------ 10000100000000000
1--1----------------------- 00000000010000000
------------0--0----------- 10000100000000000
1-----0-------------------- 00000000110000000
---1--------0-------------- 10000100000000000
-----000-0--1-------------- 01101101111011111
-------------0-0----------- 00001100000000000
------------0------0------- 10000100000000001
---1---------0------------- 00001100000000000
------0--0--1-----1-------- 00001100011011111
------11-0--1-------------- 00001000101011111
------111---1-------------- 00001000101011111
-------------1----1-------- 01100001100100000
-----------11-------------- 00000000000010110
---1--------1----1--------- 01101100110000001
------0--0--1----1--------- 01001101011011111
------00-1--1-------------- 01101101111011001
-------------1------------- 00000000000000100
------10----1-------------- 01000000001011111
----1-00----1-------------- 01101101111011111
------001---1-------------- 01101101111011111
---0----------------------- 00100011100000000
------------10------------- 01110001110000001
------01----1-------------- 01001101011011111
------------0-------1------ 01111001111111101
------------0-------0------ 11111101111111100
.e
