JK flip-flops up-down counter from 0 to 9

Discussion in 'Homework Help' started by nadia23, Sep 17, 2014.

  1. nadia23

    Thread Starter New Member

    Sep 29, 2013
    25
    0
    It is not my exact assignment, I just simplify things to start the assignment, I really appreciate any help plz

    I have drawn the 0-9 up-down counter but it has got some issues which can't give me the right result. however counting up it gives up to number 10(A) but counting down doesn't work properly.
     
  2. MrChips

    Moderator

    Oct 2, 2009
    12,421
    3,357
    How did you arrive at that circuit? Show your work.
    You have J-K flip-flops wired as T-type flip-flops. That is not an efficient way to use J-K flip-flops. Use both the J and K functions and you will have a simpler solution.
     
    nadia23 likes this.
  3. nadia23

    Thread Starter New Member

    Sep 29, 2013
    25
    0
  4. nadia23

    Thread Starter New Member

    Sep 29, 2013
    25
    0
    thanks for ur reply
     
  5. MrCarlos

    Active Member

    Jan 2, 2010
    400
    134
    Hello nadia23

    How everything are going on ??

    I can see that your Up-Dn counter 0-9 is a synchronous counter. According to the pictures you attached
    Also look that you are not using the Flip-Flip's like J-K but as Toggle.
    Using them as type T it is easier to develop that counter.
    As shown in the accompanying x.PDF documents.

    There are some things I want to mention:
    Counting Up, when you get HEX A You must reset to 0 and continue counting.
    Counting Dn, when you get HEX F You must reset to 9 and continue counting.
    This last part is a bit more complicated. Keep all this in mind.

    Counting Up I use the Q outputs of the flip-flop's.
    Counting Dn I Use the ‘Q outputs of Flip-Flop's.
    You can use either: LED’s (Lights) or HEX's 7 segment Display.

    Surely you can put together these two schemes that I attached to form your counter Up-Dn 0-9.
    It's not that difficult. You can use OR gates to select a mode counting Up or Dn.
    Also to reset it to 9 or 0.

    You can find a brief description of the Flip-Flop's type: T, R-S, J-K and D, at this link.
    http://en.wikipedia.org/wiki/Excitation_table
    but you can find much more information by browsing the WEB.
    Like for example in this link where just discussed regarding the J-K F-F.
    http://www.electronics-tutorials.ws/sequential/seq_2.html
    Another way is to use the J and K inputs of the Flip-Flip's. And through them set the next state of the Flip-Flip's.
    And with an extra BIT you can tell the counter that counts Up or Dn.
    As you know, your counter has 4 BIT's: Q8, Q4, Q2 and Q1.
    And complementary BIT's that would: 'Q8, 'Q4, Etc.

    If the counter is counting Up and the current state is 9 My next state should be 0.
    But the counter advances to HEX A. so when I get HEX A must be reset to 0.

    If the counter is counting Dn and the current state is 0 My next state should be 9.
    But the counter advances to HEX F. so when I get HEX F must be reset to 9.

    To achieve all this stuff you can use a computer program called Boole-Deusto. You can download and install this program on your PC from this link: http://sourceforge.net/projects/boole-deusto/
    But first you have to develop the transition table for your counter. You will use besides the 4 BIT's an extra one for the count direction.
    Let's assume that when the extra BIT is 0 the counter must count Up. Otherwise count down.
    Then the transition table must contain at least 3 columns:
    Extra BIT, current state, future state.

    In this talk we can define:
    If (E-BIT = 0) and (Current state = 0), then (future state = 1).
    . . . . . .
    If (E-BIT = 0) and (current state = 9), then (future state = 0).

    but:
    If (E-BIT = 1) and (current state = 9), then (future state = 8).
    . . . . . .
    If (E-BIT = 1) and (current state = 0), then (future state = 9).
    The numbers above you can write in binary code 4 BIT's

    One last thing: if you know the transition table of J-K Flip-Flip you can define that: The state of the Q takes the state of Its J by applying a pulse to its clock input. Their K state should be complemented by Its J.

    I hope I have helped you with this wording.
     
    nadia23 and absf like this.
  6. nadia23

    Thread Starter New Member

    Sep 29, 2013
    25
    0
    Thanks a lot Mrcarlos Your explanation is amazing, it really makes sense. I am not really good in this subject:( ,but trying my best to do this assignment.

    I have tried many other ways but, didn't get the last result. I followed the files that you have sent me, thanks a lot for that ,but for some reason it didn't work for me, I am not sure I did the wiring part wrong or the software I am using is not good enough. the software name is CEDAR.

    The one that I tried to sort it out; the count up working fine, but count down starts from 7, I couldn't figure out the issue. If you can please assist me in that.

    The actual assignment is to make a a 3-minute Digital Timer and the details are as follows

    1-When the number of seconds reaches 0 the 10-seconds counter must be
    decremented by 1 unless it equals 0, and the seconds counter reset to 9.
    When the 10 seconds display reaches 0, the display must reset to 5 and the
    minutes display must decrement by 1 unless it already equals 0.
    2. When the number of minutes reaches 0 the minutes must reset to 9 and the 10
    minutes display must decrement by 1 unless it equals 0.
    3. When the timer is equal to 00:00, the counter stop running and must activate an
    alarm signal (an LED).
    4. A run/stop switch which toggles between the count-down function and the time set
    function, and a reset switch which sets the timer to 03:00 (3 minutes) if pressed
    while in stop mode.
    The run/stop switch must change the counter direction such that each digit can be
    manually incremented while the timer is stopped, but counts down when in run mode.
    6. While in stop mode 4 manual time-set switches: Secs, 10-secs, Mins, 10-mins are enabled. When pressed each increments the relevant digit by 1. If the new

    To get only pass I have to complete these 1-6 steps and I don't have much time too.

    so I am trying to solve the 9-0 and 0-9 counter first then the 0-5 and 5-0 and connect them together to get a basic timer at the beginning.



    im2.jpg im1.jpg
     
  7. MrCarlos

    Active Member

    Jan 2, 2010
    400
    134
    Hello nadia23

    ! Oh! is more complex than I thought.
    Give me some time to do something.
    I hope we reach the time to do it.
     
    nadia23 likes this.
  8. MrCarlos

    Active Member

    Jan 2, 2010
    400
    134
    Hello nadia23

    If You studied the documents I enclose you, you can define that a circuitry is required to select connections either:
    Up Counter 0-9 JK.
    OR (This means OR Gate).
    Dn Counter 9-0 JK ,

    Study carefully the circuit contained in the attached image.
    (Smaller Data Selector.PNG)
    This will be the first data selector to place between the first flip-flop and the second.
    An equivalent circuit is needed to place between the second and third Flip-Flip's.
    Just for Flip-Flip's third and fourth.

    Note that every time AND gates with more inputs are needed.
    The up-down counter is near complete.
    you just need to develop the circuitry to reset to 0 when It is counting up OR 9 when it is counting down.

    These circuits are very similar to where I am attached as images.
    They also should get the Up-Dn signals.
    But in this case the R inputs of the Flip-Flop's would be used.

    You think you can develop the missing circuitry for that ?
    It's not that hard. . ! try!
     
    nadia23 likes this.
  9. nadia23

    Thread Starter New Member

    Sep 29, 2013
    25
    0
    Hi MrCarlos, Thanks for your reply once again.
    Have you checked the images that I attached before? The first one which I attached is what you explained me I did and it works with 0-9 perfectly but with count down it resets to 7 instead of 9.

    yeah, not much time left I have to submit this on Thursday morning
     
  10. MrCarlos

    Active Member

    Jan 2, 2010
    400
    134
    Hello nadia23

    Yes, I check the circuits shown in those pictures.
    You have several things to improve. you can see the marks that I added.

    So not much time to do it.
     
    nadia23 likes this.
  11. nadia23

    Thread Starter New Member

    Sep 29, 2013
    25
    0
    Hi Mrcarlos thanks for your reply, after long hours I sorted out most of parts, I used selection circuits which made it very easy to do the count up and down but I stuck now in making reset switch which sets the timer to 03:00 (3 minutes) if pressed
    while in stop mode.

    http://s24.postimg.org/jbrzxp85h/im1.png
     
  12. nadia23

    Thread Starter New Member

    Sep 29, 2013
    25
    0
    sorry the image quality is very low
     
  13. MrCarlos

    Active Member

    Jan 2, 2010
    400
    134
    Hello nadia23

    And yes, you enclose one very poor quality image.

    anyway. You develop and Achieve Up-Dn counter 0-9 ??
     
    nadia23 likes this.
  14. nadia23

    Thread Starter New Member

    Sep 29, 2013
    25
    0
    Yes, I did
    Yeah sorry, because it is quite big file that is why and I cannot upload the actual file here as well that I have made in CEDAR
     
    • im1.png
      im1.png
      File size:
      37.4 KB
      Views:
      110
  15. nadia23

    Thread Starter New Member

    Sep 29, 2013
    25
    0
    Is there any other way to send the file?
     
  16. MrCarlos

    Active Member

    Jan 2, 2010
    400
    134
    Hello nadia23

    There is more than one way to upload files.

    1)- Compress it with WinZip or WinRar and upload.
    either the image or file generated by your CEDAR

    2)- Use another server to upload your files, such as: http://ww.sharefile.com/
    or others.

    3)- Copy your image file type to a PDF document and upload it.

    But most important is that your diagram in CEDAR is well done.
    You can see the blue grid on the worksheet Your CEDAR ??
    It is for each line you draw a wire.
    The components that comprise it should be as close together as possible.
    Etc.

    By the way: That CEDAR in Free ??

    See the update I did to your Counter.
     
    nadia23 likes this.
  17. MrCarlos

    Active Member

    Jan 2, 2010
    400
    134
    Hello nadia24

    Now I have the ZIP. I will review them.

    Tks
     
    nadia23 likes this.
  18. nadia23

    Thread Starter New Member

    Sep 29, 2013
    25
    0
    Thanks MrCarlos
     
  19. MrCarlos

    Active Member

    Jan 2, 2010
    400
    134
    Hello nadia23

    I think the simulator is not working as it should.
    Do a test with the file I attached in the ZIP.

    Normally: low-level lines(Wires) should be black and the high level should be red.
    But that ones should be red color, sometimes are turquoise color (blue) are shown.

    I was doing tests, placing NOT Gates To improve the signal Up Dn, but the problem persists.

    I did the circuit in other simulators as CircuitMaker, LiveWire and Multisim.
    They worked as expected.
    The one I've been attaching to you was developed in Proteus ISIS.

    The problem, I think, is the simulator
     
    nadia23 likes this.
  20. nadia23

    Thread Starter New Member

    Sep 29, 2013
    25
    0
    Hi Mrcarlos

    yeah, the simulator is not a very good one it has many issues, but unfortunately we have to use only this one.
    When the line shows blue it means there is some error according to simulator.

    Thanks for you work

    Have you checked the file that I have attached?(assignment)
    what I should do to preset the timer to 3:00 minutes? any idea plz
     
Loading...