You are on page 1of 2

Name eje01;

Partno 01;
Date ;
Revision 01;
Designer san;
Company unprg;
Assembly None;
Location cx;
Device g16v8;

/** Entradas **/


Pin 1 = clk;
pin 2 = clr
Pin 11 = !oe;

/** Salidas **/


Pin [14..15] = [Q1..0];

/** Declaracion de variables Internas **/


field conta = [Q1..0];
$define S0 'b'00
$define S1 'b'01
$define S2 'b'10
$define S3 'b'11

/** Ecuacion Logica **/


$ifdef configura
conta.OE = oe;
conta.AR = 'b'00;
conta.SP = 'b'00;
$endif

sequenced conta {

present S0
next S1;
present S1
next S2;

present S2
next S3;

present S3
next S0;

}
*************** INPUT PINS *********************/
PIN 1 = clk ; /* */
PIN 2 = clr ; /* */
PIN 3 = dir ; /* */
PIN 11 = !oe ; /* */

/* *************** OUTPUT PINS *********************/


PIN 14 = Q3 ; /* */
PIN 15 = Q2 ; /* */
PIN 16 = Q1 ; /* */
PIN 17 = Q0 ; /* */

field conta = [Q3..0];


$define S0 'b'0000
$define S1 'b'0010
$define S2 'b'0100
$define S3 'b'1000

field modo = [clr,dir];


up = modo:0;
down = modo:1;
clear = modo:[2..3];

$ifdef configura
conta.OE = oe;
conta.AR = 'b'0000;
conta.SP = 'b'0000;
$endif

sequenced conta {
present S0 if up next S1;
if down next S3;
if clear next S0;
present S1 if up next S2;
if down next S0;
if clear next S0;
present S2 if up next S3;
if down next S1;
if clear next S0;
present S3 if up next S0;
if down next S2;
if clear next S0;
}

You might also like