home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s078 / 1.img / FLOPS.PLD < prev    next >
Encoding:
CUPL PLD Program format  |  1991-12-08  |  2.4 KB  |  74 lines

  1. Name            Flops;
  2. Partno          CA0002;
  3. Revision        02;
  4. Date            9/12/83;
  5. Designer        G. Woolhiser;
  6. Company         Assisted Technology, Inc.;
  7. Location        San Jose, CA.;
  8. Assembly        Example;
  9.  
  10. /****************************************************************/
  11. /*                                                              */
  12. /*      This example demonstrates the use of D-type flip-flops, */
  13. /*      and flexibilty of expression with CUPL.  The following  */
  14. /*      are four implementations of a two bit counter, which    */
  15. /*      use the following timing diagram.                       */
  16. /*                ______    ______    ______    _____     ___   */
  17. /*   clock      __|    |____|    |____|    |____|    |____|     */
  18. /*              ___         ___________         ___________     */
  19. /*      q0        |_________|         |_________|         |__   */
  20. /*              ___                   _____________________     */
  21. /*      q1        |___________________|                   |__   */
  22. /*                                                              */
  23. /****************************************************************/
  24. /*      Taget Devices:  PAL16R8, PAL16RP8, EP300                */
  25. /****************************************************************/
  26.  
  27.  
  28. Pin 1 =  clock;
  29. Pin 2 =  reset;
  30. Pin 11 = !enable;
  31.  
  32. /*
  33.  * Outputs:  define outputs and output active levels
  34.  */
  35.  
  36. Pin 19 = qa0; Pin 18 = qa1;
  37. Pin 17 = qb0; Pin 16 = qb1;
  38. Pin 15 = qc0; Pin 14 = qc1;
  39. Pin 13 = qd0; Pin 12 = qd1;
  40.  
  41. /*
  42.  * Logic:  examples of two-bit counters using d-type flip-flops
  43.  */
  44.  
  45. /* two-bit counter example no. 1 */
  46. /* using software emulated exclusive or's */
  47.  
  48. qa0.d = !reset & !qa0;
  49. qa1.d = !reset & (qa1 $ qa0);
  50.  
  51. /* two-bit counter example no. 2 */
  52. /* using expanded exclusive or's */
  53.  
  54. qb0.d = !reset & (!qb0 & !qb1
  55.                 # !qb0 & qb1);
  56. qb1.d = !reset & (!qb0 & qb1
  57.                 # qb0 & !qb1);
  58.  
  59. /* two-bit counter example no. 3 */
  60. /* using bit fields on the right hand side of the equals sign */
  61.  
  62. field state = [qc1,qc0];
  63.  
  64. qc0.d = !reset & (state:0 # state:2);
  65. qc1.d = !reset & (state:1 # state:2);
  66.  
  67. /* two-bit counter example no. 4 */
  68. /* using bit fields on the left hand side of the equals sign */
  69.  
  70. field q = [qd0,qd1];
  71.  
  72. q.d = !reset & ([!qd0,qd1] & [!qd1,!qd0]
  73.               # [!qd0,!qd1] & [qd1,qd0]);
  74.