sequence recognizer

Discussion in 'Homework Help' started by miklee, May 10, 2011.

  1. miklee

    miklee Thread Starter New Member

    Joined:
    Mar 27, 2011
    Messages:
    8
    I done a sequence recognizer for the string 1001 with FF JK

    The equations are:
    J1 = X' Q0
    K1 = X + Q0
    J0 = X + Q1
    K0 = X'
    Z = Q1 Q0 X

    Now I have to simulate it with LTspice, but it doesn't work. The output of the FFs is always 0. Can you help me?
    I simulated the circuit with an other logic simulator and it works, i don't know if I set some wrong value.
    Thank you.

    Attached Files:

  2. miklee

    miklee Thread Starter New Member

    Joined:
    Mar 27, 2011
    Messages:
    8
    I remake the circuit using D FF (i change cause may the jkff downloaded from LTspice group don't works).

    Equations:
    D1=Q1 Q0' X' + Q1' Q0 X'
    D0=X + Q1 Q0'
    Z=Q1 Q0 X

    I set the source V2 for the sequence 1001 (1st clock high value, 2nd and 3rd low value and 4th clock hight again). But when I start the simulation I have an error: "Analysis: Time step too small; time = 0.00012, timestep = 1.25e-019: trouble with dflop-instence a2"

    Thank you

    Attached Files:

  3. Georacer

    Georacer Moderator Staff Member

    Joined:
    Nov 25, 2009
    Messages:
    4,974
    Location:
    Athens, Greece (GMT +2)
    I ran your first circuit by hand and I disagree with something:
    You have the state 00 as the Reset state.
    With a '1' you go to 01 and you start reading the '1001' sequence.
    A '0' drives you to 10.
    Another 0 gets you to 11.
    And then with the final '1' you go to 01, which should be your final state but it has been used before.

    I understand that you tried to build a Mealy machine, but to be honest I don't trust them much in actual fast circuits. I would use a fifth state even though that would add another Flip Flop.

    That said, your JK circuit works in theory as you would like to, but I don't know what problems your software might cause. Maybe you could make the input last a bit longer, in order to avoid gate delays and propagation of them.

    For example, make a clock tick every 1ms and synchronize your input in the same period and make your '1's last at about half a ms.
Similar Threads
Forum Title Date
Homework Help fsm sequence recognizer Jun 27, 2007
Homework Help Constructing an input sequence for an S'R' latch with NAND gates Mar 24, 2015
Homework Help 3 bit counter following sequence 0>2>3>4>7>0 Feb 25, 2015
Homework Help Sequence detector Feb 14, 2015
Homework Help sequence detector Jan 3, 2015

Share This Page