home *** CD-ROM | disk | FTP | other *** search
- module _xorinv flag '-r0','-f'
- title 'Using an XOR PAL to obtain programmable output polarity
- Michael Holley FutureNet - Data I/O 10 Jan 1986'
-
- " This example shows how to program Q1 := (A & B & C # E & F & G)
- " into an active low device. The DeMorgans complement of this
- " equation will not fit into this device but XOR PALs can be
- " tricked into acting as a programmable polarity device.
-
- " An active low XOR output can be used as an active high output by
- " forcing a '1' into one side of the XOR gate. The equation below
- " for Q1 is the equivalent to !Q1 := (A & B & C # E & F & G) $ 1.
- " The (G # !G) has to be used because the TRANFOR module converts
- " X $ 1 into !(X), which is the desired action in most other cases.
-
- " If G is an unused input it may be tied either high or low.
- " However, if G has to be used, there is a possibility for glitching
- " on the input to the flip/flop (Q1). In synchronous systems this
- " should not be a problem, but the fuses for G and !G (1064 and 1105
- " in this example) could be blown to prevent this possibility.
-
- xorinv device 'P20X4';
-
- A,B,C,D,E,F,G pin 2,3,4,5,6,7,8;
- Clk,OE,Q1,Q2 pin 1,13,17,18;
-
- X,Ck = .X., .C.;
-
- fuses [1064,1105] = [1,1];
-
- equations
-
- !Q1 := (A & B & C # D & E & F) $ (G # !G); "Active High
-
- !Q2 := (A & B & C # D & E & F); "Active Low
-
- test_vectors
- ([Clk,OE,A,B,C,D,E,F,G] -> [Q1,Q2])
- [ Ck, 0,0,0,0,0,0,0,X] -> [ 0, 1];
- [ Ck, 0,1,1,1,0,0,0,X] -> [ 1, 0];
- [ Ck, 0,0,0,0,1,1,1,X] -> [ 1, 0];
- end
-