# Digital Circuits

#### ashjaya

Joined Jan 4, 2004
2
I'm stuck in this problem, Can somebody help me?

Imagine a machine with four inputs and one output that functions as follows: the output is ON if exactly two of the inputs are one, and off otherwise. Draw a circuit that performs this function. Use a truth table to show that all possible input values produce the proper output.

Thanks..

#### scarydave

Joined Jan 5, 2004
2
If you draw out the truth table, you'll find there are 6 possible combinations of "winning" inputs. Assuming the inputs are labelled A, B, C, D, the combinations are:

A.B
A.C
A.D
B.C
B.D
C.D

If you're only allowed to use 2-input gates, then first of all use 6 2-input AND gates to give these outputs.

Now, we're only interested in a positive output if one and ONLY one of these combinations exists, so we need a sequence of XOR gates. Again, if we're only allowed 2-input XOR gates, you'll need 5 of them to whittle the 6 outputs down to 1.

This should solve your problem...hope it helps!!

Scarydave

#### ashjaya

Joined Jan 4, 2004
2
Thanks for the help. I'm working on it right now.....

#### ynaji

Joined Jan 28, 2007
10
Truth Table

A B C D X
0 0 0 0 0
0 0 0 1 0
0 0 1 0 0
0 0 1 1 1
0 1 0 0 0
0 1 0 1 1
0 1 1 0 1
0 1 1 1 1
1 0 0 0 0
1 0 0 1 1
1 0 1 0 1
1 0 1 1 1
1 1 0 0 1
1 1 0 1 1
1 1 1 0 1
1 1 1 1 1

#### Ron H

Joined Apr 14, 2005
7,014
Truth Table

A B C D X
0 0 0 0 0
0 0 0 1 0
0 0 1 0 0
0 0 1 1 1
0 1 0 0 0
0 1 0 1 1
0 1 1 0 1
0 1 1 1 1
1 0 0 0 0
1 0 0 1 1
1 0 1 0 1
1 0 1 1 1
1 1 0 0 1
1 1 0 1 1
1 1 1 0 1
1 1 1 1 1
The function is true if 2 and only 2 inputs are true.
A B C D X
0 0 0 0 0
0 0 0 1 0
0 0 1 0 0
0 0 1 1 1
0 1 0 0 0
0 1 0 1 1
0 1 1 0 1
0 1 1 1 0
1 0 0 0 0
1 0 0 1 1
1 0 1 0 1
1 0 1 1 0
1 1 0 0 1
1 1 0 1 0
1 1 1 0 0
1 1 1 1 0

#### Ron H

Joined Apr 14, 2005
7,014
If you draw out the truth table, you'll find there are 6 possible combinations of "winning" inputs. Assuming the inputs are labelled A, B, C, D, the combinations are:

A.B
A.C
A.D
B.C
B.D
C.D

If you're only allowed to use 2-input gates, then first of all use 6 2-input AND gates to give these outputs.

Now, we're only interested in a positive output if one and ONLY one of these combinations exists, so we need a sequence of XOR gates. Again, if we're only allowed 2-input XOR gates, you'll need 5 of them to whittle the 6 outputs down to 1.

This should solve your problem...hope it helps!!

Scarydave
I didn't see anything about being restricted to 2-input gates.

#### thingmaker3

Joined May 16, 2005
5,084
Ron is correct. The problem does not even specify gates - only "circuit." The solution may be implimented with only a 74154 and a 7411.