Understanding the Use of Comparator for Digital Integrator

  • Thread starter delonboard
  • Start date
  • Tags
    Comparator
In summary: You can think of "a" as a variable that controls how much of the sinewave goes into the accumulator. In summary, you are trying to create an up/down counter that counts up and counts down and the accumulator will overflow if the input signal is too high or too low. You need to use a comparator to compare the input signal to a setpoint and increment the accumulator if the input signal is above the setpoint.
Engineering news on Phys.org
  • #2
delonboard said:
I am trying to build a digital integrator as specified on this thread. I do not understand the use of comparator in the circuit. Can anyone explain?? maybe the original poster. I am new to this .
The original poster last logged-in in 2008 so it is probably wishful thinking that OP may reply. @nokeeauser

Perhaps one of the other participants might see your post.

In which of those files is the comparator shown?
 
  • #3
Forget about the link to that post. This is my design for 4 bit digital integrator. I will cascade two of the parts for 8 bits which is what i need. My problems:
The sum overflows too fast. According to the problem i have to implement incremental output which can be implemented with the carry out of the integrator. I am not sure how to get it. It says to use combination logic.
 

Attachments

  • Capture09.PNG
    Capture09.PNG
    91.2 KB · Views: 522
  • #4
I'm a little confused by what I see. (but that happens a lot)

A counter that counts up and counts down is essentially an integrator of a +1, -1 input signal. I'm not sure what you are going for with the accumulator following it.

The counter is integrating, and the accumulator is integrating that.

You basic question about cascading up/down counters is answered by figures a, b, and c in this datasheet. (three different methods, b is probably what you want)
http://www.futurlec.com/74LS/74LS191.shtml

Explain a little more. Generally one starts with an idea of the range of numbers they want to deal with and then size the counters and accumulators accordingly.

You may want a clear and an enable function also.
 
  • #5
I want to have a sine wave analog input that gets converted into digital by 8 bit ADC. The signal is passed through integrator to get cosine output. If i directly pass the digital signal through accumulator, the adder will overflow very fast. So i should implement incremental input and output. I do not understand how to implement it. what do i do with the output from ADC? I was thinking i would compare current output of ADC with previous output and determine if i should count up or count down which is my incremental input but i do not know if that is right as well. And how would i get incremental output?? Sorry if you cannot understand. I can elaborate more. Let me know if you have any questions @meBigGuy. Thanks for replying.
 
  • #6
I've never done what you are trying to do. Is it just an "academic" exercise, or is there an application of some kind?

I don't understand the purpose of the up/down counter in your design. It has nothing to do with integrating a sine wave. It is creating a triangle wave which you are then integrating with your accumulator (the register and adder)

An 8 bit A/D can represent a sine wave with and amplitude of +127 to -128. But, to get that you need to have 0000_0000 represent 0V, 0111_1111 represent max positive and 1000_0000 represent max negative. You just apply that to the accumulator (which is an integrator). You need to AC couple the sine wave into the A/D and bias it at mid scale. But, any offset will integrate to infinity. (most DSP applications think of the A/D as fractional values)

Think of accumulating a square wave that is +127 half the time, and -127 the other half. What will be the peak value in the accumulator? It will depend on the sample rate and frequency of the input. It will ramp to a max, and then back to the min. (BTW, your up/down counter is doing exactly that, integrating a +1, -1 input signal.). But, if there is any error in the dutycycle, it will ramp to infinity.
 
  • #7
Mathematically, the amplitude of the integral of a sine wave depends on the frequency. So that makes it difficult to size the accumulator.

58491280958dc0e4042f3cf47f6b6c7a.png


Now, in reality you are doing this in the Z domain (accumulator function is 1 + z(-1)) , but the basic idea is the same. "a" will depend on the sample rate and sinewave frequency.

Acc1.gif
 

1. What is a comparator and how is it used in a digital integrator?

A comparator is an electronic device that compares two input voltages and outputs a digital signal indicating which input is larger. In a digital integrator, a comparator is used to compare the output of the integrator with a reference voltage and trigger a reset signal when the output reaches the reference voltage.

2. How does a comparator improve the accuracy of a digital integrator?

A comparator provides a precise and digital comparison between the output of the integrator and the reference voltage, ensuring that the reset signal is triggered at the exact desired voltage level. This helps to eliminate any errors or drift that may occur in the analog components of the integrator.

3. Can a comparator be used in both parallel and serial digital integrators?

Yes, a comparator can be used in both parallel and serial digital integrators. In a parallel integrator, the comparator is used to compare the output of each stage with the reference voltage. In a serial integrator, the comparator is used to compare the output of the entire integrator with the reference voltage.

4. How does the input voltage range affect the performance of a comparator in a digital integrator?

The input voltage range of a comparator should be chosen to match the output voltage range of the integrator. If the input voltage range is too small, the comparator may not be able to accurately compare the output voltage with the reference voltage. If the input voltage range is too large, the comparator may introduce errors due to noise or offset voltage.

5. Are there any limitations to using a comparator in a digital integrator?

One limitation of using a comparator in a digital integrator is that it introduces additional delay in the reset signal compared to an analog reset circuit. This may affect the performance of the integrator in applications where fast response times are required. Additionally, the comparator may introduce errors due to noise or offset voltage, which should be taken into consideration during circuit design.

Similar threads

Replies
10
Views
633
  • Electrical Engineering
Replies
4
Views
1K
  • Electrical Engineering
Replies
14
Views
4K
Replies
10
Views
3K
  • Electrical Engineering
Replies
2
Views
422
  • Electrical Engineering
Replies
3
Views
1K
Replies
6
Views
762
  • Electrical Engineering
Replies
10
Views
2K
  • Electrical Engineering
Replies
20
Views
3K
Replies
5
Views
2K
Back
Top