All About Circuits Forum What happens if more than one button is pressed at the same time?
 User Name Remember Me? Password
 Register Blogs FAQ Members List Today's Posts Search Today's Posts Mark Forums Read

 Homework Help Stuck on a textbook question or coursework? Cramming for a test and need help understanding something? Post your questions and attempts here and let others help.

#1
11-03-2009, 04:44 PM
 Blackrobe New Member Join Date: Oct 2009 Posts: 6
What happens if more than one button is pressed at the same time?

Hey there,

I have to build something similar to a LED display that only displays 1s and 0s.

The circuit will have three inputs (1, 0, and reset)..and 5 outputs (one output to display each digit so you can enter 5 digits max to display). I need to find a solution on what happens if two of the buttons or more were pressed at the same exact time..so for example what happens if 1, 0 and clear are pressed at the same time.

My solution: I was thinking of using propagation delay, that allows me to address each input at a time even when three are pressed so for instance 1 will not have delay, 0 will have one delay and clear would have 2 delays...does it make sense?.. I cant think of any other reliable way.

Thanks for your help
#2
11-03-2009, 05:39 PM
 beenthere Senior Member Join Date: Apr 2004 Location: Missouri, USA (GMT -6) Posts: 15,815 Blog Entries: 10

Many variables come into play. If your circuit is properly designed, only the first button press will be recognized. Trivial in software, cumbersome in logic.

That said, what device/s are your buttons attached to?
__________________
First comes the hardware, then the software.
#3
11-03-2009, 05:52 PM
 MaxSmoke Junior Member Join Date: Oct 2009 Location: East Anglia, UK Posts: 35

It is hard to say without seeing the original question your circuit diagram, but I would look at the truth tables and datasheets for each device you have design in to your circuit, as this often helps. Further, draw a timing diagram.

By way of example, what happens to the outputs of a D type flip flop if both preset and clear are asserted at the same time? The only way to be sure is to look at the datasheet truth table. If you were using a 74LS74 then both Q and Q\ would go high, but the flip-flop is not stable. The same will apply to your design, you should be able to design the circuit on paper and then apply the truth tables to each part of the logic to see ultimately what occurs. Of course if you have access to a simulator this will show you the outputs, when all inputs are asserted.

Another approach is to give a higher priority to, say, the logic one input over the logic zero input. So, when asserting both inputs the logic one will win. However, reset should always override any circuit state or condition, this allows the circuit to to return to a know state when reset is asserted.
#4
11-03-2009, 09:20 PM
 hobbyist Senior Member Join Date: Aug 2008 Posts: 716 Blog Entries: 21

Your way would work, if that's the kind of output your looking for,
but if your looking for a output that will cancell, there are several ways to approach this, for instance, you can use a "exclusive OR" gate function,
where one input goes through to the output, but if more than one input comes in then there is no output, each input cancells eachother out,
and with that you can send this multiple input into a "AND" gate function, to provide an "ERROR" signal, of some sort.
#5
11-04-2009, 09:44 AM
 Blackrobe New Member Join Date: Oct 2009 Posts: 6

Quote:
 Originally Posted by MaxSmoke Another approach is to give a higher priority to, say, the logic one input over the logic zero input. So, when asserting both inputs the logic one will win. However, reset should always override any circuit state or condition, this allows the circuit to to return to a know state when reset is asserted.
I guess this is the right approach i have to consider...probably its a matter of preference (which input should be considered first) so I guess I'm just gonna go with what you advised...reset has highest preference then the one button and then the zero button. But in what way should I implement this function, I was thinking of some series of gates that works as such:

- If Reset = 1 and One = 1 and Zero = 1, disable One button and Zero button then execute Reset.
- If Reset = 1 and One = 1 and Zero = 0, disable One button then execute the Reset.
- If Reset = 1 and One = 0 and Zero = 1, disable Zero button then execute the Reset.
- If Reset = 0 and One = 1 and Zero = 1, disable Zero button then execute the One button.

Quote:
 Many variables come into play. If your circuit is properly designed, only the first button press will be recognized. Trivial in software, cumbersome in logic. That said, what device/s are your buttons attached to?
I'm actually using a left-shifting register since another part of my homework is to be able to shift each input to the left after entering a new input which goes to the rightmost position and so on.

Also I'm trying to build storage for each digit or input entered and then shift it to the left when needed. So I was wondering what kind of storage component is the best for this case? D-Flip Flop or just a simple Latch?

Thanks again for your help.

 Tags button, pressed, time

 Related Site Pages Section Title Video Lecture JK Flip-Flop - Digital Worksheet Counters Worksheet Flip-flop circuits Worksheet Latch circuits Worksheet CMOS logic gates Video Lecture Representative System (Part 3) - Executing a Program - Microprocessors Video Lecture Counters - Digital Video Lecture Sequential Logic - Digital Textbook Finite State Machines : Sequential Circuits Counters Textbook The J-K flip-flop : Multivibrators

 Similar Threads Thread Thread Starter Forum Replies Last Post MATTY B The Projects Forum 33 03-22-2010 08:53 AM Panterulez Math 4 01-11-2010 04:57 AM devalvyas General Electronics Chat 16 06-24-2009 02:39 PM relicmarks General Electronics Chat 10 04-19-2008 10:45 PM jgershonw1 The Projects Forum 1 02-01-2008 02:53 AM

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Electronics Forums     General Electronics Chat     The Projects Forum     Homework Help     Electronics Resources Software, Microcomputing, and Communications Forums     Programmer's Corner     Embedded Systems and Microcontrollers     Computing and Networks     Radio and Communications Circuits and Projects     The Completed Projects Collection Abstract Forums     Math     Physics     General Science All About Circuits Commmunity Forums     Off-Topic     The Flea Market     Feedback and Suggestions

All times are GMT. The time now is 06:43 AM.