Analog to Digital Converters (A/Ds)
What Are They?
Some Properties Of A/D Converters
Where Do You Use A/Ds?
You are at:  Bits&Bytes - Interface Circuits - Analog To Digital Converters (A/Ds)
Return to Table of Contents
A/D Converters

        Analog-to-Digital converters - a.k.a. A/D converters - are widely used by many engineers and scientists of all types, often without their realizing it.  Whenever they make a measurement of a voltage, and that measurement is taken into a computer, an A/D is used.

        If you're going to take measurements - and just about every engineer will do a lot of that - then you will be better off if you understand some of the basic ideas behind A/D converters.  There are two simple goals for this lesson.

  Given an A/D converter with a given range and number of bits,
  To be able to calculate the resolution of the converter.
  Given an A/D converter in the laboratory,
  To be able to determine the resolution of the converter and the number of bits used in the converter.

What Are A/D Converters?

        A/D converters are electrical circuits that have the following characteristics.

        A comparator can be used as a simple one-bit A/D converter.  Although a converter with just one bit isn't particularly useful, you can begin to see how an A/D converter works by puttering with it for a moment.  If you read the lesson on comparators you encountered a simluation of a comparator.  That simulator is reproduced below.  Click here if you want to read the lesson on comparators.

Comparator Simulator

Sim1  Here is the comparator simulator.  You can think of a comparator as a one-bit A/D converter.  The input is an analog signal, and the output is a one bit digital representation of the analog signal.  In the simulator, you can control a simulated voltage source that is the input the the comparator, and the digital output bit is indicated with a simulated LED.  Notice the following.


Properties of A/D Converters

       The comparator simulation reveals a few important facts about A/D converters.

        Clearly, if you want a more accurate conversion the converter will need to have a lot more than just one bit.  Let's look at another simulation.  This simulation is a four-bit A/D converter.

Four Bit A/D Converter Simulator

Sim2  Here is a simulation of a four bit A/D converter.  Note the following:

Try the simulator first, and then we will examine what happens in a little more detail.

        Now, consider the following observations about the converter above.         Now, let's consider an example question.
Example

E1   How many bits would you need to divide 10 v into .01 v intervals?  To get the answer to the question consider the following.


        Almost all A/D converters use a scheme in which the analog voltage is first converted into a binary integer (a "count", as in the simulator above) when the conversion is done.  In some cases, there may be some software that gives you the actual count - the binary integer.  In other cases the conversion might be converted - using software - to a a numerical value or a character representation of a numerical value.

Example

E2   A GPIB (IEEE-488) voltmeter is used to measure a DC voltage.  The instrument uses an A/D converter that generates a binary number.  Within the instrument, that binary number is converted to a string of characters which is, in turn, transmitted to a computer connected to the instrument.



        To illustrate the concept in the example, consider the revised simulator below.  In this simulator, the conversion algorithm - from the count in the register to an analog voltage - is given by: Here is the simulation.
Four Bit A/D Converter Simulator (Revised)

Sim3  Here is a revised simulation of a four bit A/D converter.  Note the following:


        Of course, the simulation only raises a few more issues.         Using this expression for the calculated voltage, we can plot the calculated voltage as a function of the count.  That's shown in the figure below.

Even more interesting is the plot of the calculated voltage against the voltage input that is being measured.  That's shown next.  We've also included a plot (the blue line) that shows what the output would be ideally (And that might take many, many bits in the converter!).  Notice that the calculated voltage is always lower than the voltage input using the calculation method we assumed above.  Note also that the largest error occurs just before the converter switches when the voltage is rising.  For example, as the voltage rises from 0v to 3v, there is a time when the converter output switches from 0v to 0.625v.  The largest error occurs just before that point, so a bound on the error is:

Error < 0.625

        We can reduce the error if we calculate the voltage differently.  We can examine what happens if we use a different expression for the computed voltage.  We will use:

The result is shown in the next simulator.

Now, here is a plot of the calculated voltage against the voltage input that is measured.  Notice that the error limit is half of what it was using the first calculation method.

       The conclusion is that the way the voltage is computed can affect the average error when an A/D is used to measure voltage values.

        Whenever you buy an A/D converter, or a voltmeter, or a data acquisition unit, you need to be cognizant of how the data presented to the user is actually computed.  That's not usually a problem in instruments, but there are A/D computer cards that use the first method above to calculate voltage, and you should be aware of that when it happens.  It is less important when the number of bits in the converter is higher, but when you have high requirements for accuracty you should be thinking of what might be taking place.


The Effect of Number of Bits

        The number of bits used in the counter also affects the accuracy of the conversion.  Again, we will use a simulation to show the effect of the number of bits.


Six Bit A/D Converter Simulator

Sim4  Here is a simulation of a six bit A/D converter.

Run the simulator, and compare results with the four bit simulators above.


        We can think a little bit about error in an A/D.  First, note that the error limit depends upon the range and the number of bits.         We're not going to give you any more simulators with more bits.  Actually, we've almost reached the resolution limit for the screen.  The simulators with the "nudge buttons" just nudge the controls by a single pixel, and that is too much for a twelve bit converter, for example.
Example

E3  A popular A/D board gives a count and requires you to perform the computation shown in the line of C code shown below.  The variable binary is the count value that is returned.

MeasuredVolts = (((binary-2048)*20)/4096);

The A/D converts voltages from -10v to +10v.  We can conclude the following.



        Let's sum up a few points.

How Does An A/D Work?

        While we have discussed A/D converters above, we haven't yet given you any insight into how you could build an A/D.  Here we will discuss a simple way to build an A/D.  This might not be the fastest A/D possible, but it will start to give you some insight into what happens inside an A/D.

        The circuit is shown in the simulator below.


Simulator - Showing How You Might Construct An A/D

Sim 5  This simulator is a four bit A/D, and it consists of the following components.

Here is the circuit.

Here is how the A/D Simulator works. Try the simulator, using different voltages within the allowable range, i.e. 0-5v.
       The simulator lets you see the inner workings of one type of A/D converter.  Note the following about any A/D converter.

Practical A/Ds

        Now, consider what happens in a typical application of an A/D.  We'll look at a voltmeter.  In a voltmeter, this is what happens.

If the voltmeter is connected to a computer (say through an IEEE-488 bus) the following also takes place.         You can see that there are a few conversions that have to take place in this process.  There are a number of other considerations here as well.




         A/D converters are found in many places - including places where you might not think that you would find them.  Here are a few. And, you get the idea.

        However, there is an important situation where you need to dig deeper into how A/Ds operate, and how they interface with the software and hardware that is often used in measurement and control situations.  Let's think about a few typical situations.

        In both of these situations you need to consider how to manipulate the data that you measure and want to store.  Here are some of the considerations.         The conclusion that you need to reach is that you need to be aware of how data has to be converted in these kinds of situations.  Let's look at the sequence of operations you might face.
Representing Instrument Data

        Taking data with an instrument immediately leads you to consider several things about data.  Here is a sample.


Digital Voltmeters

       Digital Voltmeters are a special case of A/Ds.  Obviously, if voltage measurements are taken and the results are displayed digitally with LED or LCD displays, the instrument has to contain an A/D converter.  Digital voltmeters have some characteristics that you might need to understand.  You can click here for more material on digits in digital voltmeters.

You need to learn a little terminology and the reasons for the terminology.  Let's take a look at a sample voltmeter.
Example

E4   Consider a voltmeter built around a 10 bit A/D converter.  We will assume the following.

Then, with 10 bits we can draw these inferences. If we could use a 12 bit A/D, then some conclusions would change.         At this point, you should have a good idea about how the number of bits in an A/D converter determines the accuracy of the converter - i.e. the resolution of the converter.

        You also need to learn how to determine the resolution of an instrument in the laboratory, and relate the resolution of lab instruments to what you know about the number of bits in a converter.  You can click here for an laboratory exercise which leads you through getting the number of bits in the A/D converter inside a voltmeter.


Problems
Links to Related Laboratory Work
Links to Related Lessons
Return to Table of Contents

Send us your comments on these lessons.