Op-amp as a comparator (analog-to-digital conversion)

In summary: V if either of the inputs is 5V. This can be achieved by connecting the inputs to the positive terminals of two comparators, and the output of the OR gate will be the output of the second comparator.And finally, to design a 3-input AND gate using only 4 op-amps, you can use a combination of AND and OR gates. For example, you can use two AND gates and one OR gate to get the desired output. I hope this helps you understand the logic behind comparators and how they can be used to create logic gates.
  • #1
ichabodgrant
49
0

Homework Statement


Okay, This time it's an exam question. I am doing some past papers and there are questions about comparators which are not introduced in this course (this course is preliminary course for engineering students who are interested in electrical, electronic or computer engineering). So I guess the instructor wants us to know the logic of a comparator just within the 3 hours examination (in which not all 3 hours are for that particular question...)
Now I find it difficult... maybe I am not familiar with the concepts yet... But anyway I have tried to solve it...Here are the details and my attempts:

First, we are given an op-amp circuit for building a radio (the situation is that you are in a lost island which is rich of op-amps and resistors but no logic gates... so are you going to create logic gates AND and OR using just the above materials):

Q4 a.png

To find Vx, I use the node method and finally get the value of Vx in terms of VA and VB:

Vx = - (Rf / Ra) (VA + VB)

Then, assuming Ra = 2Rf and Vcc = 5 V, we are now relating the unknowns voltage with real values:
Q4 b.png

What I get are 0, -2.5, -2.5 and 5 from top to bottom.

Third, now we are go to transform voltages to logic values:
Let Vy = - Vx:
Q4 c.png

What I write are R1 = Rb, R2 = 3Rb, R3 = 2Rb, R4 = 2Rb, IN1 connects to Vcc, IN2 connects to GND.

Then, it comes to the comparator question:
Q4 d.png

What I am sure about is that Vs+ = +Vcc, Vs- = GND...
But how to know which V- and V+ should be respectively?

AND gate in logic means y = ab. How to see this from the op-amp above?

I know that 5 V is "true" which represents logic value "1"; 0 V is "false" which represents logic value "0".
So this thing should either output 5 V (Vcc) or 0V (GND)...

So is V+ = Vy and V- = Vth?

Now, other than AND gate, we also can create an OR gate using the above materials...
Q4 e.png

Since I totally don't understand the logic of 4d, I also don't understand this. But I guess it mentions Vth this way, which shows that Vth is used as a reference for comparing? But why is just changing Vth can be resulted in two different logic gates functions?

Here comes the final part: to design a 3-input AND gate using no more than 4 op-amps...
Once again I don't understand the logic, so I don't know what to do.
Q4 f.png


Homework Equations


For Q4d, Vout = K (V+ - V-) where K is a huge gain about 105.

The Attempt at a Solution


The attempts are written above.
 
Physics news on Phys.org
  • #2


Hello, it seems like you are struggling with understanding the logic behind comparators and how they can be used to create logic gates. I will try my best to explain it to you.

Firstly, a comparator is a type of op-amp circuit that compares two input voltages and outputs a digital signal based on the comparison. In your case, the inputs are VA and VB, and the output is Vx. The output Vx will be either a high voltage (5V) or a low voltage (0V) depending on the comparison of VA and VB.

Now, let's look at the circuit you provided. The first thing to note is that the op-amp is configured as a non-inverting amplifier, meaning that the output voltage will be the same as the input voltage (with some amplification). So, the output Vx will be equal to the input voltage at the positive terminal of the op-amp, which is (VA + VB). The negative terminal of the op-amp is connected to ground, so Vx will be equal to - (Rf / Ra) (VA + VB).

Next, you mentioned that you are given the values of Ra = 2Rf and Vcc = 5V. Using these values, we can simplify the equation for Vx to Vx = -2.5 (VA + VB).

Now, to understand how this circuit can be used as a comparator, we need to look at the output Vx in terms of logic values. As you correctly stated, 5V represents a logic value of 1 and 0V represents a logic value of 0. So, if Vx is greater than 0, the output will be 5V, indicating a logic value of 1. If Vx is less than 0, the output will be 0V, indicating a logic value of 0. This is the basic principle of a comparator.

Moving on to the AND gate, we can see that it is essentially a combination of two comparators. In this case, V+ and V- will be the outputs of the two comparators, and the output of the AND gate will be the output of the second comparator. So, for an AND gate, the output will be 5V only when both inputs (VA and VB) are 5V. Otherwise, the output will be 0V.

Similarly, for an OR gate, the output will be
 

What is an op-amp comparator?

An op-amp comparator is a circuit that compares two input voltages and produces an output voltage based on the comparison. It is commonly used in analog-to-digital conversion, where the output voltage can be interpreted as a digital value.

How does an op-amp comparator work?

An op-amp comparator consists of an operational amplifier (op-amp) and a feedback loop. The two input voltages are fed into the op-amp, and the output voltage is determined by the op-amp's internal circuitry and the feedback loop. The output voltage will be high when one input voltage is greater than the other, and low when the opposite is true.

What is the purpose of using an op-amp comparator?

The main purpose of using an op-amp comparator is to convert analog signals into digital signals. By comparing the input voltage to a reference voltage, the output of the comparator can be used to indicate whether the input voltage is above or below the reference voltage, essentially creating a digital "on" or "off" signal.

What factors affect the performance of an op-amp comparator?

There are several factors that can affect the performance of an op-amp comparator, including input offset voltage, input bias current, and input offset current. These parameters can cause errors in the output voltage and should be taken into account when designing a comparator circuit.

Are there any limitations of op-amp comparators?

Like any electronic component, op-amp comparators have limitations that should be considered when using them. These can include input and output voltage limitations, bandwidth limitations, and temperature drift. It is important to select an op-amp comparator that meets the requirements of your specific application.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
34
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
21
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
6K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
18
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
24
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
11
Views
9K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
2K
Back
Top