Follow along with the video below to see how to install our site as a web app on your home screen.
Nota: This feature currently requires accessing the site using the built-in Safari browser.
Publica el código, de manera que quién trabaje con Wincup pueda leer lo que escribiste y colaborar contigoTengo un problema con Wincupl, al hacer una secuencia no logro hacer que el if me mande a otra parte del codigo y solo hace una parte, saben como puedo llamar otra parte del codigo usando if ?
Name cuenta ;
PartNo 00 ;
Date 19/01/2021 ;
Revision 01 ;
Designer Engineer ;
Company None ;
Assembly None ;
Location ;
Device g22v10 ;
/* *************** INPUT PINS *********************/
PIN 2 = reset ; /* */
PIN 3 = A ; /* */
PIN 4 = B ; /* */
PIN 5 = C ; /* */
/* *************** OUTPUT PINS *********************/
PIN 23 = q0 ; /* */
PIN 22 = q1 ; /* */
PIN 21 = q2 ; /* */
PIN 20 = q3 ; /* */
PIN 19 = q4 ;
PIN 18 = q5 ;
PIN 17 = q6 ;
PIN 16 = q7 ;
PIN 15 = q8 ;
c1 = A&B&C;
c2 = !A&B&C;
c3 = !A&!B&C;
field reg = [q0,q1,q2,q3];
$define s0 'b' 0000
$define s1 'b' 0001
$define s2 'b' 0010
$define s3 'b' 0011
$define s4 'b' 0100
$define s5 'b' 0101
$define s6 'b' 0110
$define s7 'b' 0111
$define s8 'b' 1000
$define s9 'b' 1001
$define s10 'b' 1010
sequence reg
{
present s0 if reset next s0 ;
if c3 next s1;
present s1 if reset next s0;
if c3 next s2;
present s2 if reset next s0;
if c3 next s3;
present s3 if reset next s0;
if c3 next s4;
present s4 if reset next s0;
if c3 next s5;
present s5 if reset next s0;
if c3 next s6;
present s6 if reset next s0;
if c3 next s7;
present s7 if reset next s0;
if c3 next s8;
present s8 if reset next s0;
if c3 next s9;
present s9 if reset next s0;
if c3 next s10;
present s10 if reset next s0;
if c3 next s0;
}
ese es el código que tengo, pero necesito que cuando c2 sea verdadero pueda hacer la cuenta ascendente en binario en q4,q5,q6,q7 pero sin cambiar el valor que ya tenia q0,q1,q2,q3. ¿sabes como hacerlo? :cPublica el código, de manera que quién trabaje con Wincup pueda leer lo que escribiste y colaborar contigo
El error que tiene ese código es que en sequence no vas a poder resetear mientras sea c3=1 y que te falta el default.......
ese es el código que tengo, pero necesito que cuando c2 sea verdadero pueda hacer la cuenta ascendente en binario en q4,q5,q6,q7 pero sin cambiar el valor que ya tenia q0,q1,q2,q3. ¿sabes como hacerlo? :c
present s1
if reset next s0 ;
if !reset&c3 next s2 ;
default next s1 ;
PIN 1 = CLK;
PIN 2 = dir;
PIN 23 = QZ;
PIN 22 = QY;
PIN 21 = QX;
PIN 20 = QW;
PIN 19 = QD;
PIN 18 = QC;
PIN 17 = QB;
PIN 16 = QA;
$REPEAT i = [0..100]
$DEFINE s{i} {i}
$REPEND
FIELD contador = [QZ,QY,QX,QW,QD,QC,QB,QA];
SEQUENCE contador
{
present s0
if dir next s1;
if !dir next s99;
$REPEAT i = [1..99]
present s{i}
if dir next s{(i+1)%100};
if !dir next s{(i-1)%100};
$REPEND
}
Ah, cierto. Muchísimas gracias, ya funcionó.Hola.
¿Probaste habilitar la minimización Quine-McCluskey en las opciones de compilación?
Saludos.
/entradas/
PIN 1=CLK;
PIN 2= A;
PIN 3= B;
PIN 4= C;
PIN 5= D;
/salidas/
PIN 23=!Q0;
PIN 22=!Q1;
PIN 21=!Q2;
PIN 20=!Q3;
PIN 19=!Q4;
PIN 18=!Q5;
PIN 17=correcto;
PIN 16=incorrecto;
/definicion de estados/
$define S0 'b' 000000
$define S1 'b' 000001
$define S2 'b' 000010
$define S3 'b' 000100
$define S4 'b' 001000
$define S5 'b' 010000
$define S6 'b' 100000
field entrada=[A, B, C, D];
field estados=[Q0, Q1, Q2, Q3, Q4, Q5];
Qd = !Q0 & !Q1 & !Q2 & !Q3 & !Q4 & !Q5 & !D & !C & !B & A;
APPEND Qd = Q0 & !Q1 & !Q2 & !Q3 & !Q4 & !Q5 & !D & !C & B & !A;
APPEND Qd = !Q0 & Q1 & !Q2 & !Q3 & !Q4 & !Q5 & !D & !C & B & A;
APPEND Qd = !Q0 & !Q1 & Q2 & !Q3 & !Q4 & !Q5 & !D & C & !B & !A;
APPEND Qd = !Q0 & !Q1 & !Q2 & Q3 & !Q4 & !Q5 & !D & C & !B & A;
APPEND Qd = !Q0 & !Q1 & !Q2 & !Q3 & Q4 & !Q5 & !D & C & B & !A;
sequence incorrecto{
present 'b' 0
if Qd next 'b' 0;
if !Qd next 'b' 1;
present 'b' 1
default next 'b' 1;
}
sequence estados {
PRESENT Q0
IF b NEXT Q1;
DEFAULT NEXT Q0 ;
PRESENT Q1
IF b NEXT Q2;
DEFAULT NEXT Q0 ;
PRESENT Q2
IF b NEXT Q3;
DEFAULT NEXT Q0 ;
PRESENT Q3
IF b NEXT S4;
DEFAULT NEXT Q0 ;
PRESENT Q4
IF b NEXT Q5;
DEFAULT NEXT Q0 ;
PRESENT Q5
DEFAULT NEXT Q0 ;
}