Gast
#1740421
Moin,
also ich habe folgendes Problem ich muss ein Zähler realieseiren der von
0 bis 6 zählt also würden ja 3 FF reichen aber der Knackpunkt an der
sache ist das 6 Ausgangsbits bei jedem Takt gesetzt werden müssen.. Den
Takt soll der Zähler von einer Lischtschranke bekommen, also wenn sie
unterbochen wird dann soll er einen Schritt weiter zählen.
hier mal die Wahrheitstabelle
Takt Q0 Q1 Q2 Q3 Q4 Q5
1 | 0| 0| 0| 0| 0| 0
1 | 0| 0| 0| 1| 0| 0
1 | 0| 0| 0| 1| 1| 0
1 | 0| 0| 0| 1| 1| 1
1 | 1| 0| 0| 1| 1| 1
1 | 1| 1| 0| 1| 1| 1
1 | 1| 1| 1| 1| 1| 1
habe schon mal was in WinCupl probiert aber keine Ahung ob das so
stimmt..
Name ;
Partno CA0018;
Date 12/19/99;
Revision 02;
Designer ;
Company Logical Devices, Inc.;
Assembly None;
Location None;
Device g16v8a;
/** Inputs **/
Pin 1 = clk; /* Counter clock */
Pin 2 = clr; /* Counter clear input */
Pin 3 = dir; /* Counter direction input */
Pin 11 = !oe; /* Register output enable */
/** Outputs **/
Pin [12..17] = [Q5..0]; /* Counter outputs */
Pin 19 = carry; /* Ripple carry out */
/** Declarations and Intermediate Variable Definitions **/
field count = [Q5..0]; /* declare counter bit field */
$define S0 'b'000000 /* define counter states */
$define S1 'b'000100
$define S2 'b'000110
$define S3 'b'000111
$define S4 'b'100111
$define S5 'b'110111
$define S6 'b'111111
field mode = [clr,dir]; /* declare mode control field */
up = mode:0; /* define count up mode */
down = mode:1; /* define count down mode */
clear = mode:[2..3]; /* define count clear mode */
/** Logic Equations **/
Sequenced count { /* free running counter */
present S0 if up next S1;
if down next S6;
if clear next S0;
if down out carry;
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 S4;
if down next S2;
if clear next S0;
present S4 if up next S5;
if down next S3;
if clear next S0;
present S5 if up next S6;
if down next S4;
if clear next S0;
present S6 if up next S0;
if down next S5;
if clear next S0;
if up out carry;
/* assert carry output */
}

