# problem with logic gates

Discussion in 'The Projects Forum' started by whitearrow, Jan 17, 2009.

1. ### whitearrow Thread Starter Member

Jan 6, 2009
13
0
i have to build a circuit which has the truth table shown in the attachment. i have built the circuit (shown in the attachement as fig1) and in theory it gave me the wanted results. but when the inputs where given with a comparator circuit(shown as fig2), the values where not aquired. can any one help?

• ###### truth table.doc
File size:
40 KB
Views:
26
Last edited: Jan 17, 2009
2. ### Wendy Moderator

Mar 24, 2008
20,772
2,540
What is the goal here? My first suspect is the comparators, and when they are triggering.

I could open your word document once, but no more. There are lots of versions of word out there, and not all of them are compatible.

3. ### SgtWookie Expert

Jul 17, 2007
22,183
1,728
Comparators typically have open collector outputs, so you must use pull-up resistors in order to obtain an output.

A good rule of thumb for the pull-up resistor value is roughly 3.5ma current across your V+/V- supply, or roughly 250-300 Ohms per volt. Therefore, if you're using +5v and -5v, then it's 10v/0.0035a = 2857 Ohms.
2.7k and 3k are standard values. Use the closest. I can't see what you're using for V+ and V- supply voltages.
[eta]
Attached images of the contents of the Word document.

OK, now I see you're trying to use a TL074 quad opamp as a comparator. This is a bad idea, as the outputs will be in constant saturation. Also, the common-mode input range does not include the negative rail; more like 3v above it to V+.

Use an LM339 quad comparator instead of the TL074, and use 1.5k pull-up resistors to +5v. Their common-mode input range includes the negative rail; you can use ground for the negative rail.

Your V+ should be 4.75v to 5.25v inclusive, as that's the range for TTL logic.

File size:
28.5 KB
Views:
18
• ###### whitearrow-fig2.JPG
File size:
44.7 KB
Views:
29
Last edited: Jan 17, 2009
4. ### whitearrow Thread Starter Member

Jan 6, 2009
13
0
thanks for that useful information. can you tell me between which pins i have to connect these pull up resistors?

thanks again

5. ### mik3 Senior Member

Feb 4, 2008
4,846
63
Where is the circuit? Do you drive the gate inputs with a comparator? What logic family is it (TTL or CMOS)?

6. ### SgtWookie Expert

Jul 17, 2007
22,183
1,728
On an LM339, the output pins are 2, 1, 14, 13 for A, B, C, and D respectively.