home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s199 / 1.img / XORINV.ABL < prev   
Encoding:
Text File  |  1986-04-01  |  1.6 KB  |  44 lines

  1. module _xorinv    flag '-r0','-f'
  2. title 'Using an XOR PAL to obtain programmable output polarity
  3. Michael Holley      FutureNet - Data I/O      10 Jan 1986'
  4.  
  5. " This example shows how to program Q1 := (A & B & C # E & F & G)
  6. " into an active low device. The DeMorgans complement of this
  7. " equation will not fit into this device but XOR PALs can be 
  8. " tricked into acting as a programmable polarity device.
  9.  
  10. " An active low XOR output can be used as an active high output by
  11. " forcing a '1' into one side of the XOR gate.  The equation below 
  12. " for Q1 is the equivalent to  !Q1 := (A & B & C # E & F & G) $ 1.
  13. " The (G # !G) has to be used because the TRANFOR module converts
  14. " X $ 1 into !(X), which is the desired action in most other cases.
  15.  
  16. " If G is an unused input it may be tied either high or low.
  17. " However, if G has to be used, there is a possibility for glitching
  18. " on the input to the flip/flop (Q1).  In synchronous systems this
  19. " should not be a problem, but the fuses for G and !G (1064 and 1105 
  20. " in this example) could be blown to prevent this possibility. 
  21.  
  22.     xorinv    device 'P20X4';
  23.  
  24.     A,B,C,D,E,F,G        pin 2,3,4,5,6,7,8;
  25.     Clk,OE,Q1,Q2        pin 1,13,17,18;
  26.  
  27.     X,Ck    = .X., .C.;
  28.  
  29. fuses [1064,1105] = [1,1];
  30.  
  31. equations
  32.  
  33.     !Q1 := (A & B & C # D & E & F) $ (G # !G); "Active High
  34.  
  35.     !Q2 := (A & B & C # D & E & F);        "Active Low 
  36.     
  37. test_vectors
  38.        ([Clk,OE,A,B,C,D,E,F,G] -> [Q1,Q2])
  39.      [ Ck, 0,0,0,0,0,0,0,X] -> [ 0, 1];
  40.      [ Ck, 0,1,1,1,0,0,0,X] -> [ 1, 0];
  41.      [ Ck, 0,0,0,0,1,1,1,X] -> [ 1, 0];
  42. end
  43.  
  44.