home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1996 September
/
pcwk_09_96.iso
/
demo
/
elmark
/
cupl
/
demo1
/
gates.pld
< prev
next >
Wrap
Text File
|
1989-01-10
|
2KB
|
55 lines
Name Gates;
Partno CA0001;
Revision 03;
Date 9/12/83;
Designer S. Baird;
Company Logical Devices, Inc.;
Location None;
Assembly None;
/****************************************************************/
/* */
/* This is an example to demonstrate how CUPL */
/* compiles simple gates. */
/* */
/****************************************************************/
/* Target Devices: P16L8, P16LD8, P16P8, EP300, and 82S153 */
/****************************************************************/
/*
* Inputs: define inputs to build simple gates from
*/
Pin 1 = a;
Pin 2 = b;
/*
* Outputs: define outputs as active HI levels
*
* Note: For PAL16L8 and PAL16LD8, DeMorgan's Theorem is applied to
* invert all outputs due to fixed inverting buffer in the device.
*/
Pin 12 = inva;
Pin 13 = invb;
Pin 14 = and;
Pin 15 = nand;
Pin 16 = or;
Pin 17 = nor;
Pin 18 = xor;
Pin 19 = xnor;
/*
* Logic: examples of simple gates expressed in CUPL
*/
inva = !a; /* inverters */
invb = !b;
and = a & b; /* and gate */
nand = !(a & b); /* nand gate */
or = a # b; /* or gate */
nor = !(a # b); /* nor gate */
xor = a $ b; /* exclusive or gate */
xnor = !(a $ b); /* exclusive nor gate */