home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s199 / 1.img / BGATES.ABL < prev    next >
Encoding:
Text File  |  1986-02-04  |  1.1 KB  |  64 lines

  1. module BGATES flag '-v'
  2. title 'Basic Gates example from MMI PAL handbook
  3. Michael Holley     Data I/O Corp      08 Mar 1984'
  4.  
  5.         P7000    device    'P12H6';
  6.     A,C,D,F,G,I,J,K,M,N,P,Q     pin 19,1,2,3,4,9,11,12,5,6,7,8;
  7.     B,E,H,L,O,R         pin 18,17,16,13,15,14;
  8.  
  9. equations
  10.      B = !A;    " Inverter
  11.  
  12.      E = C & D;    " And Gate
  13.  
  14.      H = F # G;    " Or Gate    
  15.  
  16.     !L = I & J & K;    " Nand Gate
  17.  
  18.     !O = M # N;    " Nor Gate
  19.  
  20.      R = P $ Q;    " Exclusive Or Gate
  21.  
  22. test_vectors 'Test Inverter'
  23.           ( A -> B ) 
  24.         0 -> 1;
  25.         1 -> 0;
  26.  
  27. test_vectors  'Test And Gate'
  28.           ( [C,D] -> E )
  29.         [0,0] -> 0;
  30.         [0,1] -> 0;
  31.         [1,0] -> 0;
  32.         [1,1] -> 1;
  33.  
  34. test_vectors  'Test Or Gate'
  35.           ( [F,G] -> H )
  36.         [0,0] -> 0;
  37.         [0,1] -> 1;
  38.         [1,0] -> 1;
  39.         [1,1] -> 1;
  40.  
  41. test_vectors  'Test Nand Gate'
  42.           ( [I,J,K] -> L )
  43.         [0,0,0] -> 1;
  44.         [1,0,0] -> 1;
  45.         [0,1,0] -> 1;
  46.         [0,0,1] -> 1;
  47.         [1,1,1] -> 0;
  48.  
  49. test_vectors  'Test Nor Gate'
  50.           ( [M,N] -> O )
  51.         [0,0] -> 1;
  52.         [0,1] -> 0;
  53.         [1,0] -> 0;
  54.         [1,1] -> 0;
  55.  
  56. test_vectors  'Test Exclusive Or Gate'
  57.           ( [P,Q] -> R )
  58.         [0,0] -> 0;
  59.         [0,1] -> 1;
  60.         [1,0] -> 1;
  61.         [1,1] -> 0;
  62. end BGATES
  63.  
  64.