Sequential Devices have STATES!!

Which brings us to the PROGRAM to WRITE.

There are several languages that one can use.

 

THE PROGRAM CUPL  HAS FOUR PARTS.  [You will type the program in a TEXT processor, and save it with the *.pld extension.  ]

----------------------------------------------------------------

1.  Header info  [name, device format:  leave Device and Format, make NAME same as your file]

2.        Inputs:  clock and maybe one other

3.        Outputs:  you have 2 states and 7 LED pins

4.        LOGIC: 

A.      You have to name your states

B.       You have to give the present/next/out equations

--------------------------------------------------------------------------------

Name    scroll;

Device    G22V10;

Format   j;

 

/**  Inputs  */

 

Pin 1 = Clock;

Pin 2 = Stop;

 

/**  Outputs  **/

 

pin [14..15] = [Q1..Q0];

pin 16 = a;

pin 17 = b;

pin 18 = c;

pin 19 = d;

pin 20 = e

pin 21 = f;

pin 22 = g;

 

field count = [Q1..Q0];

 

$define S0  'b' 00

$define S1   'b' 01

$define S2 'b' 10

$define S3  'b' 11

 

/**  Logic Equations  */

Sequenced scroll   {

present S0  next S1   out a,b,c;

 

present S1  next S2  out b,c,d;

present S2  next S3;

present S3  next S0;                  }

---------------------------------------------

Once you type the program as myfile.pld, the remaining steps:

1.  Compile using the CUPL compiler [which is on all computers in LAB].  The compiler will generate a *.jed file,   --  which will have the ONES/ZEROES that you'll need.

  1. Take the myfile.jed file and use the ALLPRO or BK844 programming software, load the bits on the chip [steps…  select device, load *.jed program, burn chip].
  2. Wire chip and test on BREADBOARD!