CSE 171 Lab 9. November 8-10, 2004.Rev. A

EXPERIMENT: 8-Bit Counter with 2x BCD Display

PRE-LAB

  1. Read and understand Section 8.2, Divide-by-8 Counter (pp.143-146) and Section 9.1, ADivide-by-16 Counter with Count Enable (pp. 160-163).
  2. Make a listing of the 4-bit counter count4.abl that you designed in Group Homework 6.
  3. Make a listing of the 9-bit binary-to-BCD converterbinbcd9.abl and the Cadd3.abl file that you designed in Group Homework 7.
  4. Write an ABEL program called Lab9.abl for a module CountBCD that will implement the circuit shown in Figure 1. Create the 8-bit counter from two 4-bit count4 counter modules you designed in Group Homework 6. (See Figure 9.5 on page 163 of the text for how to do this, but connect pushbutton S3 to the count input of the least significant counter module instead of a 1). This 8-bit counter output is displayed on the red LEDs and will count from 0 – 255. The 9-bit binary-to-BCD converter will multiply the output of the counter by 2 (by shifting the input to the left one bit position) and produce a BCD output between 0 and 510. The units digit of this output is displayed in binary on the four rightmost green LEDs. The hundreds and tens digits are displayed on the two 7-segment display digits with the leftmost decimal point lit. Thus, the 7-segment display digits will display the values 0.0 – 5.1.
  1. Make a listing of your Lab9.abl file.

LAB

  1. Create a new project, Lab9 in a folder called <your name> under C:\CSE171 and add copies of the binbcd9.abl and Cadd3.abl files. Simulate your binbcd9 module and print out the BLIF Simulation Report and listings of the binbcd9.abl and Cadd3.abl files.
  2. Add copies of your Lab9.abl, count4.abland hex7seg.abl files. Generate a programming file for the top-level module, CountBCD (Lab9.abl) and print out listings of the Lab9.abl and count4.abl files.
  3. Prepare the PLDT-3 board by using jumper wires to connect pushbutton connectors T4 and T5 to pins 71 and 70 respectively of header HD2, pin 1 of clock connector T9 (LOW FREQ CLK) and pin 12 of HD3, and pins 5 to 8 of green LED connector J3 and pins 50 to 53 respectively of HD4. Connect the PC printer port cable to the PLDT-3 board, and then connect the 9V DC power module.
  4. Download your CountBCD.jed file to the Xilinx chip. The PLDT-3 board should count from 0 to 255 in binary on the red LEDs and from 0.0 to 5.1 on the 7-segment display. Pressing pushbutton S1 should clear the display. Pressing pushbutton S3 should stop the counter. Explain what you observe on the green LEDs.
  5. Demonstrate your counter display module to your lab instructor and obtain your lab instructor's signature for your work.
  6. Include the following in the lab report:

A listing of your file, Lab9.abl.

A listing of your file, binbcd9.abl.

The BLIF Simulation Report for the binbcd9.abl file.

A listing of your file, Cadd3.abl.

A listing of your file, count4.abl.

  1. Erase your program and remove power from the Xilinx CPLD, delete the directory C:\CSE171\<your name> that you created at the beginning of this lab, and remove any other files or folders you put on the system.