Simple Control system using flip-flops

Discussion in 'Homework Help' started by rich88, Dec 15, 2010.

  1. rich88

    Thread Starter New Member

    Dec 15, 2010
    4
    0
    Hi guys,

    I've got this task to do but feel like I'm banging my head against the wall a little so would appreciate a bit of input to know I'm heading in the right direction!

    This control system counts passengers and gives different outputs depending on the number of passengers

    The rough criteria for the system is:

    1 - 5 passengers: System ok, green light
    > 5 passengers: too many passengers, sound alarm until passengers between 1 and 5
    < 0 passengers: sound alarm, phone maintainers

    I've decided to use J-K flip flops as an async 3-bit up/down counter to count the passengers, and use momentary push to make switches as the passenger in/out inputs (for simulation purposes in multisim). I've OR'd these inputs into the first J-K flip-flop clock bit. This half works in multisim but not quite, the outputs count 1, 2, then 7, then I get some faults.. This is the circuit, I've deleted the 7-seg display but I use the Q outputs from each J-K to provide the counting sequence:

    [​IMG]

    Any ideas why it's not working? I've never used multisim before so may have missed something..

    [​IMG]To determine the output, I've decided to use two 2 to 4 decoders with enable to give a 3 to 8 decoder. I was thinking of commoning outputs resulting from counter inputs 1-5 to give 'system' ok and counter input 6 as 'too many passengers'. I'm not sure about less than 0, any hints as to how I could do this? Was thinking maybe use counter input 7, but I'm not quite sure if this would work as I'd need to get the counter to stop at 6 but go from 0 to 7 when counting down..

    I'll be honest here and say I have absolutely no idea how to get a circuit to send a call through a phone, surely I'd need some sort of device with a serial port to connect to a phone or something like that?

    Finally, apologies for the essay, and any help/advice would be greatly appreciated! I'm also not 100% sure if the method I've chosen (using the J-K's for a 3-bit up/down and processing the outputs with a 3 to 8 decoder) is the best way to do it, but I think it should work!

    Thanks in advance :)
     
  2. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    Are you required to use the flip flops? An up/down counter should make like a lot easier. Decoding 0 - 5 takes a bit of external logic.
     
  3. rich88

    Thread Starter New Member

    Dec 15, 2010
    4
    0
    Yes the J-K flip flop has to be used for the counter unfortunately!

    I think I can just about do the counter, 1-5 outputs and >5 but I'm really struggling to think of a way to get the <0 error output to work. I'm trying to figure out if adding in an enable to the 3 to 8 decoder could work, but I'm not quite sure how it'd work..
     
  4. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    A down clock AND count = 0 should produce an error signal.
     
  5. rich88

    Thread Starter New Member

    Dec 15, 2010
    4
    0
    Ahhh! I've been under the impression that it'd go from 0 back to 7 if down was pressed again, would this not be the case?
     
  6. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    Not if you have a gate to catch the clock before it gets to the flip flops. A count of zero can break the path for the down clock.
     
  7. rich88

    Thread Starter New Member

    Dec 15, 2010
    4
    0
    That makes sense cheers. Having tried J-K 3-bit up/down counter designs in multisim which don't work, I've tried another which still doesn't work! :mad: Basically I found this link:

    http://free-books-online.org/computers/digital-logic-design/updown-counter/

    When i put the exact up/down counter in multisim I get nothing on any of the outputs? I can modify the inputs so that my passenger in/out switches change the high/low input and also trigger the clock, which would be a feasible solution...

    Where am I going wrong? :(
     
  8. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    Sorry, no multisim experience. Maybe another member can help.
     
  9. JoeJester

    AAC Fanatic!

    Apr 26, 2005
    3,373
    1,159
    Post your screen shot from the latest attempt in multisim.

    The up/down counter in the link certainly works under simulation, assuming you have the flip-flip signals.

    In your original schematic, I noticed you didn't have preset and clear tied high.
     
  10. Georacer

    Moderator

    Nov 25, 2009
    5,142
    1,266
    Do the FFs seem to appear "dead"?

    Have you powered your circuit with a Digital Voltage Source and a Digital Ground? Library ICs need digital power somewhere in the workspace in order to work. Multisim automatically connects the power pins of the IC with that source. I 'm not sure if 7476 actually needs power to work in multisim, but judging from its blue colour, it is assigned on a footprint, which is one step before netlists and PCB production.

    So it can't hurt to add a digital voltage source and a digital ground.
     
Loading...