Analog or Digital Comparator

Thread Starter


Joined Feb 16, 2015
I have an analog signal that I want to record as a 1 or a -1 in an FPGA depending on whether the analog signal is above or below 0V on the rising edge of an FPGA clock signal. Should I just make the comparison directly within the FPGA of the analog signal? Or is it advantageous to have an external analog comparator make the determination of high versus low, and then pass that to the FPGA?


Joined Sep 9, 2010
An external comparator would certainly do the job and my hunch is that it's the better choice. It's 'continuous' and very fast, so there is no timing issue of sampling. And its input is analog with fairly high precision (easily within a mV).

Doing this internally to the FPGA, with whatever shortcomings it may have, could be perfectly acceptable for your application, though, and this would eliminate a part.


Joined Aug 21, 2008
If you do it in an FPGA, don't you have to have an A-to-D converter ahead of the FPGA so the digital logic can analyze it? As waayneh indicated an analog comparator, which is a 1 bit A-to-D can do it easily and is most likely the best approach.


Joined Oct 2, 2009
The solution is not as straight forward as you may think when you add noise into the equation.

An analog comparator has to have hysteresis built-in otherwise you will get a lot of chatter on the output. Furthermore, when the output of the comparator switches, it puts noise back into the signal which compounds the problem.

If you digitize the analog signal with the appropriate sampling rate and resolution, you then have the ability to process the data digitally and set any desired amount of filtering, hysteresis and noise thresholds.

It really depends on your application.


Joined Aug 1, 2013
I vote for the external comparator (or opamp). There are many that run on a single supply rail yet can sense input transitions below GND. The LM339 pioneered this input stage, but it is slow and noisy compared to newer parts. The LM358 is a very common single-supply opamp with the same input stage. Use it if you want to drive a hysteresis resistance back to the input.



Joined Aug 1, 2013
What is the FPGA supply voltage? Separate from that, with is the digital signal input voltage range? Sometimes the two are not equal.