|
大家帮看看有什么问题,我是新手大家多包涵。
Name stepper;
Partno CA0018;
Date 12/19/99;
Revision 02;
Designer Kahl;
Company Logical Devices, Inc.;
Assembly None;
Location None;
Device g16v8a;
/** Inputs **/
Pin 1 = clk; /* Counter clock */
Pin 2 = dir; /* Counter clear input */
Pin 11 = !oe; /* Register output enable */
/** Outputs **/
Pin [14..17] = [Q3..0]; /* Counter outputs */
/** Declarations and Intermediate Variable Definitions **/
field count = [Q3..0]; /* declare counter bit field */
$define S0 'b'1110 /* define counter states */
$define S1 'b'1100
$define S2 'b'1101
$define S3 'b'1001
$define S4 'b'1011
$define S5 'b'0011
$define S6 'b'0111
$define S7 'b'0110
$define up 'b'1
$define down 'b'0
/** Logic Equations **/
Sequenced count { /* free running counter */
present S0 if up next S1;
if down next S7;
present S1 if up next S2;
if down next S0;
present S2 if up next S3;
if down next S1;
present S3 if up next S4;
if down next S2;
present S4 if up next S5;
if down next S3;
present S5 if up next S6;
if down next S4;
present S6 if up next S7;
if down next S5;
present S7 if up next S0;
if down next S6;
} |
阿莫论坛20周年了!感谢大家的支持与爱护!!
知道什么是神吗?其实神本来也是人,只不过神做了人做不到的事情 所以才成了神。 (头文字D, 杜汶泽)
|