home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0020 - 0029 / ibm0020-0029 / ibm0028.tar / ibm0028 / CUPL21-4.ZIP / ADDER.SI < prev    next >
Encoding:
Text File  |  1986-03-02  |  1.6 KB  |  40 lines

  1. Name      Adder;
  2. Partno      CA0016;
  3. Date      10/08/85;
  4. Rev       01;
  5. Designer  Woolhiser;
  6. Company   Assisted Technology;
  7. Assembly  None;
  8. Location  None;
  9. Device    p16l8;
  10.  
  11. /****************************************************************/
  12. /*                                */
  13. /* Four bit adder using the CUPL function statement.        */
  14. /*                                 */
  15. /* 4-bit asynchronous adder implemented as a ripple-carry    */
  16. /* through four adder-slice circuits.  Each adder-slice        */
  17. /* takes a pair of 1-bit numbers (X, Y) and the carry from    */
  18. /* a previous slice (Cin) and produces their 1-bit sum (Z)    */
  19. /* and carry (Cout).  Each adder-slice circuit is defined    */
  20. /* using the CUPL function adder_slice(), which returns        */
  21. /* the product directly and the carry as Cout.            */
  22. /****************************************************************/
  23. /* Allowable Target Device Types :  PAL16L8                   */
  24. /****************************************************************/
  25.  
  26. Order: X4..1, %2, Y4..1, %4, Z4..1, %2, Carry, C3..1;
  27.  
  28. Vectors:
  29. $trace 3;
  30. '0' '0'  "0" L***    /* 0  + 0  = 0,   Z = 0,  C = 0 */
  31. '2' '1'  "3" L***    /* 2  + 1  = 3,   Z = 3,  C = 0 */
  32. '4' '2'  "6" L***    /* 4  + 2  = 6,   Z = 6,  C = 0 */
  33. '8' '3'  "B" L***    /* 8  + 3  = 11,  Z = B,  C = 0 */
  34. '7' '4'  "B" L***    /* 7  + 4  = 11,  Z = B,  C = 0 */
  35. 'A' '5'  "F" L***    /* 10 + 5  = 15,  Z = F,  C = 0 */
  36. 'D' '6'  "3" H***    /* 13 + 6  = 19,  Z = 3,  C = 1 */
  37. 'F' '7'  "6" H***    /* 15 + 7  = 22,  Z = 6,  C = 1 */
  38. 'F' '1'  "0" H***    /* 15 + 1  = 16,  Z = 0,  C = 1 */
  39. 'F' 'F'  "E" H***    /* 15 + 15 = 30,  Z = E,  C = 1 */
  40.