home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0020 - 0029 / ibm0020-0029 / ibm0028.tar / ibm0028 / CUPL21-4.ZIP / LOOKUP.PLD < prev    next >
Encoding:
CUPL PLD Program format  |  1986-03-02  |  2.4 KB  |  62 lines

  1. Name            Lookup;
  2. Partno          CA0017;
  3. Revision        01;
  4. Date            3/10/85;
  5. Designer        T. Kahl;     
  6. Company         Assisted Technology, Inc.;
  7. Location        San Jose, CA.;
  8. Assembly        Example;
  9. Device        ra8p8;
  10.  
  11. /****************************************************************/
  12. /*                                                              */
  13. /* This is an example of the TABLE format for CUPL.  The lookup */
  14. /* table input consists of a 6 bit number for the radius of a   */
  15. /* circle (R0-5) and the output is the value for the perimeter  */
  16. /* (2 x Pi x Radius) of the circle (P0-7).                      */
  17. /****************************************************************/
  18. /* Target Devices: 256 x 8 PROM  (RA8P8)                        */
  19. /****************************************************************/
  20.  
  21. /** Inputs **/
  22.  
  23. Pin [1..5,17] = [R0..5];    /* Radius of Circle */
  24.  
  25. /** Outputs **/
  26.  
  27. Pin [6..9,11..14] = [P0..7];    /* Perimeter of Circle */
  28.  
  29. /** Declarations and Intermediate Variable Definitions **/
  30.  
  31. Field Radius = [R5..0];
  32. Field Perimeter = [P7..0];
  33.  
  34. /** Logic Equations **/
  35.  
  36. Table  Radius => Perimeter {
  37.  
  38. /* Radius       Perimeter               Radius      Perimeter */
  39. /* ------       ---------               ------      --------- */
  40.    'd'00    =>   'd'000;        'd'01   =>   'd'006;
  41.    'd'02    =>   'd'013;        'd'03   =>   'd'006;
  42.    'd'04    =>   'd'025;        'd'05   =>   'd'019;
  43.    'd'06    =>   'd'040;        'd'07   =>   'd'031;
  44.    'd'08    =>   'd'050;        'd'09   =>   'd'044;
  45.    'd'10    =>   'd'063;        'd'11   =>   'd'069;
  46.    'd'12    =>   'd'075;        'd'13   =>   'd'082;
  47.    'd'14    =>   'd'088;        'd'15   =>   'd'094;
  48.    'd'16    =>   'd'101;        'd'17   =>   'd'107;
  49.    'd'18    =>   'd'113;        'd'19   =>   'd'119;
  50.    'd'20    =>   'd'126;        'd'21   =>   'd'132;
  51.    'd'22    =>   'd'138;        'd'23   =>   'd'145;
  52.    'd'24    =>   'd'151;        'd'25   =>   'd'157;
  53.    'd'26    =>   'd'163;        'd'27   =>   'd'170;
  54.    'd'28    =>   'd'176;        'd'29   =>   'd'182;
  55.    'd'30    =>   'd'188;        'd'31   =>   'd'195;
  56.    'd'32    =>   'd'201;        'd'33   =>   'd'207;
  57.    'd'34    =>   'd'214;        'd'35   =>   'd'220;
  58.    'd'36    =>   'd'226;        'd'37   =>   'd'232;
  59.    'd'38    =>   'd'239;        'd'39   =>   'd'245;
  60.    'd'40    =>   'd'251;  
  61. }
  62.