home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 13 / 13.iso / p / p078 / 7.img / TUTOR.PLB / AUTOPIN.PLD < prev    next >
Encoding:
Text File  |  1990-12-11  |  1.5 KB  |  32 lines

  1.                    AUTOMATIC PIN ASSIGNMENT IN PAL22V10
  2.  
  3. An 8-bit up/down counter requires 16 product terms for Q7, 14 product
  4. terms for Q6, down to 2 product terms for Q0.  On the PAL22V10, the number
  5. of product terms varies, with 16 on some pins, 14 on others, and so forth.
  6. The 22V10 is therefore suitable for use as an 8-bit up/down counter, if
  7. only the pins are assigned properly.
  8.  
  9. Pin assignment can be done automatically by the PLD compiler on the
  10. PAL22V10.  This example has signals Q[7..0] assigned to the io pins in
  11. numeric order, without regard to the number of product terms needed or
  12. available.  The configuration statement at the end of the source informs
  13. the compiler that signals Q[7..0] are unassigned.  That is, the pins they
  14. are attached to are free to be changed.  When this is compiled, therefore,
  15. signals Q[7..0] will be assigned by the compiler according to the number
  16. of product terms in their equations.  The algorithm preserves as many of
  17. the original pin assignments as possible.
  18.  
  19. For best results, this should be compiled with inversion off (/i0 on the
  20. command line).
  21.  
  22. |PAL22V10 io:Q[7..0], in:(UP, RESET), clock:CLK
  23. |
  24. | i=7..1:  Q[i] = CLK // RESET' & ( ((Q[i] ## Q[i-1..0]==-1) & UP)
  25. |                                 # ((Q[i] ## Q[i-1..0]== 0) & UP') )
  26. |
  27. | i=0:     Q[i] = CLK // RESET' & (Q[i] ## 1)
  28. |
  29. | Configuration:  "Unassigned", Q[7..0]
  30. | Reduction 1:     Q[7..0]
  31.  
  32.