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

  1. module mux12t4 
  2. title '12 to 4 multiplexer   24 Feb 1984
  3. Charles Olivier & Dave Pellerin  Data I/O Corp.  Redmond WA'
  4.  
  5. "declarations
  6.  
  7.     IC1m        device    'P14H4';
  8.  
  9.     a0,a1,a2,a3    pin    1,2,3,4;
  10.     b0,b1,b2,b3    pin    5,6,7,8;
  11.     c0,c1,c2,c3    pin    9,11,12,13;
  12.  
  13. "define select inputs
  14.  
  15.     s1,s0    pin    18,19;
  16.  
  17. "define output
  18.  
  19.     y0,y1,y2,y3    pin    14,15,16,17;
  20.  
  21.     H    =    [1,1,1,1];
  22.     L    =    [0,0,0,0];
  23.     X    =    [.x.,.x.,.x.,.x.];
  24.     select    =    [s1, s0];
  25.     y     =    [y3,y2,y1,y0];
  26.     a    =    [a3,a2,a1,a0];
  27.     b    =    [b3,b2,b1,b0];
  28.     c    =    [c3,c2,c1,c0];
  29.     
  30. equations
  31.  
  32.     y  = (select == 0) & a #
  33.          (select == 1) & b #
  34.          (select == 2) & c #
  35.          (select == 3) & c ;
  36.     
  37. test_vectors ([select, a, b, c] -> y)
  38.               [0     , 1, X, X] -> 1; "select = 0, gates line a to output
  39.           [0     ,10, H, L] -> 10;
  40.           [0     , 5, H, L] -> 5;
  41.  
  42.           [1     , H, 3, H] -> 3; "select = 1, gates line b to output
  43.           [1     ,10, 7, H] -> 7;
  44.           [1     , L,15, L] -> 15;
  45.         
  46.           [2     , L, L, 8] -> 8; "select = 2, gates lines c to output
  47.           [2     , H, H, 9] -> 9;
  48.           [2     , L, L, 1] -> 1;
  49.  
  50.           [3     , H, H, 0] -> 0; "select = 3, gates lines c to output
  51.           [3     , L, L, 9] -> 9;
  52.           [3     , H, L, 0] -> 0;
  53.  
  54. end mux12t4 
  55.  
  56.