0 Even 1 Even 2 Even

Thread Starter

chroncile

Joined Mar 27, 2010
13
Our teacher put up an example of a good question on a test and I don't understand it, can anyone please explain it to me?

Here it is:

 

beenthere

Joined Apr 20, 2004
15,819
Depending on the number keys pressed on the two keyboards, there can be 0, 1 or 2 even numbers being output.

You might find that some circuitry between the keyboards and the displays could make that determination.
 
Last edited:

beenthere

Joined Apr 20, 2004
15,819
It explains the conditions that the indicators are supposed to show. The test is to produce the circuitry that will light one of the three indicators depending on which of the keys are pressed.
 

Thread Starter

chroncile

Joined Mar 27, 2010
13
Ok so here is what my teacher did:



I really don't understand what's going on, can you please explain it to me in the simplest way and can you use examples too, please?

Thanks
 

jpanhalt

Joined Jan 18, 2008
11,087
Apparently, low is on (asserted); high is off. For all even numbers, the zero (2^0) bit will be high. If both inputs to the AND gate are high, then there are two even numbers -- one on each keyboard -- pressed, and so forth.
John
 

jpanhalt

Joined Jan 18, 2008
11,087
Which half?

John

Edit: I did not look at all the gates. Having now done so, I don't understand why the top gate is not a simple NOR. I don't understand the XNOR either.
 
Last edited:

beenthere

Joined Apr 20, 2004
15,819
Think about binary numbers. What distinguishes an odd number form one that's even?

As far as gates go, try our Ebook material. Learning the functions is critical to digital electronics.
 

jpanhalt

Joined Jan 18, 2008
11,087
Re: post#9: It doesn't matter. All that circuit is looking at, as I understand it, is 2^0. See my edit to post #8.

John
 
Last edited:

Thread Starter

chroncile

Joined Mar 27, 2010
13
Well, an odd number always ends with a 1, i.e. 0001 or 1001 or 1011

I understand the gates, but I just don't understand this. Please, someone explain it to me. :(
 

Papabravo

Joined Feb 24, 2006
21,227
Taking a step back and looking at the problem in an overall sense.

You have two keyboards and three indicators. The purpose of the exercise is to develop an answer to the question: "How many even numbered keys are being depressed"? This assumes that you can't have two or more keys depressed on a single keyboard.

This means that there are three possible answers:

  1. Zero even numbered keys are being depressed
  2. One even numbered key is being depressed. It could be on either of the two keyboards.
  3. Two even numbered keys are being depressed. One key on each of the two keyboards.
That takes care of the indicators. The remaining piece of information is the coding of the sixteen keys: The following table may help:
Rich (BB code):
Digit |    Bit
      |  3 2 1 0
-----------------
  0   |  0 0 0 0
  1   |  0 0 0 1
  2   |  0 0 1 0
  3   |  0 0 1 1
  4   |  0 1 0 0
  5   |  0 1 0 1
  6   |  0 1 1 0
  7   |  0 1 1 1
  8   |  1 0 0 0
  9   |  1 0 0 1
  A   |  1 0 1 0
  B   |  1 0 1 1
  C   |  1 1 0 0
  D   |  1 1 0 1
  E   |  1 1 1 0
  F   |  1 1 1 1
Does that add a bit of clarity to the situation?
 

Thread Starter

chroncile

Joined Mar 27, 2010
13
Yeah, I think I got it; I used an AND for the 0 even numbers indicator, a XOR gate for 1 even numbers and two NOTs and an AND gate for 2 even numbers.
 
Top