CMPE 100 Lab #8
Report due by midnight June 4

Description

In this lab you will be designing and building a digital voltmeter, using the Xilinx FPGA, the Analog Devices 557 DAC, and a LM311 Op-amp comparator. Here are the design requirements:
  1. The input range of the voltmeter will be 0-5 volts. You will be using a potentiometer to generate a DC input test signal.
  2. The voltmeter will be generating an 8-bit result using the successive-approximation method.
  3. The computed result should be sent through a register and be displayed on the hexadecimal display of your protokit.
  4. The voltmeter will have a BEGIN_CONVERSION input and a CONVERSION_DONE output (both active-high). If you tie these signals together, the voltmeter should repeatedly convert and display the input.
  5. In addition, you need a DEBUG input. Asserting DEBUG will cause every value sent to the DAC to be displayed, not just the final correct value.

Background

There are many different ways to do an analog-to-digital conversion. The method you will use is the successive-approximation method. For this method, we start by guessing a voltage and putting that out to a DAC. That guess will be compared to the input voltage to see if the input is greater or less than the guess. Based on the result of the comparison, we increase or decrease the guess, and do another comparison. We keep guessing until we are sure that the input voltage falls within the smallest bin of quantization. Now we know that the guess is equal to the input value (within the resolution of our converter), and we return the digital signal used to create our final guess as the final result to the display. Each comparison can provide one bit of information, which means it should cut the range of possible values in half. This means that for n bits of resolution, it should not take more than n clock cycles to complete the conversion. Here is a very simple block diagram to get you started:

You can think of the comparator as an amplifier with a very high gain, amplifying the difference between the two signals on its input. Because of the very high gain, the comparator will always be saturated at full positive or negative voltage. Since the maximum swing of the op-amp is determined by the supply voltage, the comparator will be at 5 volts when input > guess and at 0 volts when input < guess.

To generate a test input voltage use the 10K potentiometer that is provided. The pot will be used as a voltage divider, meaning that by turning the screw your output will be a fraction of your 5 volt power rail. The following link will remind you of what a potentiometer does:

http://www.halpounds.freeserve.co.uk/Electronics/Tutorial/Section11-15.htm

Lab 8 prelab

  1. Read and understand the use of the LM311 op-amp comparator from the following link:

    http://dungeon.ti.com/sc/docs/products/analog/lm311.html

  2. How many states are possible for the digital voltmeter? How many state bits do you need? Is there a way to decompose the problem so that the state-machine design remains fairly simple, even if you need a larger resolution?
  3. What is the best initial guess to output to the DAC? How should we be choosing our next guess? You may have seen a similar problem in programming classes.
  4. If the CONVERSION_DONE output is connected to BEGIN_CONVERSION what happens? What will ensure that the voltmeter runs continuously, rather then doing nothing at all.

Lab Work

System Design/ Xilinx implementation

  1. Design a successive-approximation A/D converter to the design specifications.
  2. Implement, download, and show the working circuit to the TA.

Report

By now you should know how to write a good report and what to include. Document the design process with whatever you feel is necessary. Think of your audience as the engineer who will have to make some modifications to the design in a year or two when the requirements changes slightly---that is far more realistic than writing to the TA or professor. Some of the questions you should consider:
  1. What is the resolution of the conversion? What is the error?
  2. What is the conversion time of your voltmeter? What is the maximum frequency of the clock before you get an incorrect result? (This may have to be derived from the DAC and comparator specs, if the protokit clocks don't go fast enough to cause your voltmeter to fail.)
  3. Assuming the voltmeter is running with 10,000 conversions per second, how fast can I change the input signal (in volts/second) and still get an accurate result?
  4. What design problems would you have to address using a design like this for digital audio (sampling frequency 44.1 kHz, 16 bits of precision)? What about for digital video?
As usual, submit your lab report as a postscript (or HTML) file by e-mailing it as an attachment to the TA of your lab section.

slug icon to go to CMPE home page CE home     CMPE 100 home page    

Questions about page content should be directed to

Kevin Karplus
Computer Engineering
University of California, Santa Cruz
Santa Cruz, CA 95064
USA
karplus@cse.ucsc.edu
1-831-459-4250