![Page 1: ECE 448: Spring 2014 Lab 3 FPGA Design Flow Based on Xilinx ISE and Isim. Using Seven-Segment Displays, Buttons, and Switches](https://reader035.vdocuments.us/reader035/viewer/2022062314/56649ef45503460f94c07285/html5/thumbnails/1.jpg)
ECE 448: Spring 2014Lab 3
FPGA Design Flow Based on Xilinx ISE and Isim.
Using Seven-Segment Displays, Buttons, and Switches.
![Page 2: ECE 448: Spring 2014 Lab 3 FPGA Design Flow Based on Xilinx ISE and Isim. Using Seven-Segment Displays, Buttons, and Switches](https://reader035.vdocuments.us/reader035/viewer/2022062314/56649ef45503460f94c07285/html5/thumbnails/2.jpg)
Part 1: Distribution and testing of FPGA boards
Part 2: Seven Segment Displays
Part 3: User Constraints File
Part 4: Buttons and Switches
Part 5: Introduction to FPGA Design Flow based on Xilinx ISE
Part 6: Introduction to Lab 3
Part 7: Class Exercise
Agenda for today
![Page 3: ECE 448: Spring 2014 Lab 3 FPGA Design Flow Based on Xilinx ISE and Isim. Using Seven-Segment Displays, Buttons, and Switches](https://reader035.vdocuments.us/reader035/viewer/2022062314/56649ef45503460f94c07285/html5/thumbnails/3.jpg)
Part 1
Distribution and Testing
of FPGA Boards
![Page 4: ECE 448: Spring 2014 Lab 3 FPGA Design Flow Based on Xilinx ISE and Isim. Using Seven-Segment Displays, Buttons, and Switches](https://reader035.vdocuments.us/reader035/viewer/2022062314/56649ef45503460f94c07285/html5/thumbnails/4.jpg)
Part 2
Seven Segment Displays
![Page 5: ECE 448: Spring 2014 Lab 3 FPGA Design Flow Based on Xilinx ISE and Isim. Using Seven-Segment Displays, Buttons, and Switches](https://reader035.vdocuments.us/reader035/viewer/2022062314/56649ef45503460f94c07285/html5/thumbnails/5.jpg)
Seven Segment Displays
![Page 6: ECE 448: Spring 2014 Lab 3 FPGA Design Flow Based on Xilinx ISE and Isim. Using Seven-Segment Displays, Buttons, and Switches](https://reader035.vdocuments.us/reader035/viewer/2022062314/56649ef45503460f94c07285/html5/thumbnails/6.jpg)
4-Digit Seven Segment Display
![Page 7: ECE 448: Spring 2014 Lab 3 FPGA Design Flow Based on Xilinx ISE and Isim. Using Seven-Segment Displays, Buttons, and Switches](https://reader035.vdocuments.us/reader035/viewer/2022062314/56649ef45503460f94c07285/html5/thumbnails/7.jpg)
Patterns for Decimal Digits
![Page 8: ECE 448: Spring 2014 Lab 3 FPGA Design Flow Based on Xilinx ISE and Isim. Using Seven-Segment Displays, Buttons, and Switches](https://reader035.vdocuments.us/reader035/viewer/2022062314/56649ef45503460f94c07285/html5/thumbnails/8.jpg)
Patterns for Hexadecimal Digits
![Page 9: ECE 448: Spring 2014 Lab 3 FPGA Design Flow Based on Xilinx ISE and Isim. Using Seven-Segment Displays, Buttons, and Switches](https://reader035.vdocuments.us/reader035/viewer/2022062314/56649ef45503460f94c07285/html5/thumbnails/9.jpg)
Connection to FPGA Pins
![Page 10: ECE 448: Spring 2014 Lab 3 FPGA Design Flow Based on Xilinx ISE and Isim. Using Seven-Segment Displays, Buttons, and Switches](https://reader035.vdocuments.us/reader035/viewer/2022062314/56649ef45503460f94c07285/html5/thumbnails/10.jpg)
Multiplexing Digits
![Page 11: ECE 448: Spring 2014 Lab 3 FPGA Design Flow Based on Xilinx ISE and Isim. Using Seven-Segment Displays, Buttons, and Switches](https://reader035.vdocuments.us/reader035/viewer/2022062314/56649ef45503460f94c07285/html5/thumbnails/11.jpg)
Time-Multiplexed Seven Segment Display
![Page 12: ECE 448: Spring 2014 Lab 3 FPGA Design Flow Based on Xilinx ISE and Isim. Using Seven-Segment Displays, Buttons, and Switches](https://reader035.vdocuments.us/reader035/viewer/2022062314/56649ef45503460f94c07285/html5/thumbnails/12.jpg)
Counter UPCOUNTER UP
Counter UP
q(k-1..k-2)
AN
Counter UP
SEG(6..0)
Counter UP
Counter UPrst
clkOC
SSD_DRIVER
OC – One’s Complement
![Page 13: ECE 448: Spring 2014 Lab 3 FPGA Design Flow Based on Xilinx ISE and Isim. Using Seven-Segment Displays, Buttons, and Switches](https://reader035.vdocuments.us/reader035/viewer/2022062314/56649ef45503460f94c07285/html5/thumbnails/13.jpg)
Size of the counter
1 ms ≤ 2k * TCLK ≤ 16 ms
fCLK = 100 MHz
k = ?
![Page 14: ECE 448: Spring 2014 Lab 3 FPGA Design Flow Based on Xilinx ISE and Isim. Using Seven-Segment Displays, Buttons, and Switches](https://reader035.vdocuments.us/reader035/viewer/2022062314/56649ef45503460f94c07285/html5/thumbnails/14.jpg)
Part 3
User Constraint File (UCF)
![Page 15: ECE 448: Spring 2014 Lab 3 FPGA Design Flow Based on Xilinx ISE and Isim. Using Seven-Segment Displays, Buttons, and Switches](https://reader035.vdocuments.us/reader035/viewer/2022062314/56649ef45503460f94c07285/html5/thumbnails/15.jpg)
User Constraint File (UCF)
• File contains various constraints for Xilinx– Clock Period– Circuit Locations– Pin Locations
• Every pin in the top-level unit needs to have a pin in the UCF
![Page 16: ECE 448: Spring 2014 Lab 3 FPGA Design Flow Based on Xilinx ISE and Isim. Using Seven-Segment Displays, Buttons, and Switches](https://reader035.vdocuments.us/reader035/viewer/2022062314/56649ef45503460f94c07285/html5/thumbnails/16.jpg)
![Page 17: ECE 448: Spring 2014 Lab 3 FPGA Design Flow Based on Xilinx ISE and Isim. Using Seven-Segment Displays, Buttons, and Switches](https://reader035.vdocuments.us/reader035/viewer/2022062314/56649ef45503460f94c07285/html5/thumbnails/17.jpg)
User Constraint File (UCF) - SSD# Seven Segment Displays
NET "SEG<0>" LOC = "T17" | IOSTANDARD = "LVCMOS33";
NET "SEG<1>" LOC = "T18" | IOSTANDARD = "LVCMOS33";
NET "SEG<2>" LOC = "U17" | IOSTANDARD = "LVCMOS33";
NET "SEG<3>" LOC = "U18" | IOSTANDARD = "LVCMOS33";
NET "SEG<4>" LOC = "M14" | IOSTANDARD = "LVCMOS33";
NET "SEG<5>" LOC = "N14" | IOSTANDARD = "LVCMOS33";
NET "SEG<6>" LOC = "L14" | IOSTANDARD = "LVCMOS33";
NET "AN<0>" LOC = "N16" | IOSTANDARD = "LVCMOS33";
NET "AN<1>" LOC = "N15" | IOSTANDARD = "LVCMOS33";
NET "AN<2>" LOC = "P18" | IOSTANDARD = "LVCMOS33";
NET "AN<3>" LOC = "P17" | IOSTANDARD = "LVCMOS33";
![Page 18: ECE 448: Spring 2014 Lab 3 FPGA Design Flow Based on Xilinx ISE and Isim. Using Seven-Segment Displays, Buttons, and Switches](https://reader035.vdocuments.us/reader035/viewer/2022062314/56649ef45503460f94c07285/html5/thumbnails/18.jpg)
User Constraint File (UCF) - LEDs
# LEDs
NET "LED<0>" LOC = "U16" | IOSTANDARD = "LVCMOS33";
NET "LED<1>" LOC = "V16" | IOSTANDARD = "LVCMOS33";
NET "LED<2>" LOC = "U15" | IOSTANDARD = "LVCMOS33";
NET "LED<3>" LOC = "V15" | IOSTANDARD = "LVCMOS33";
NET "LED<4>" LOC = "M11" | IOSTANDARD = "LVCMOS33";
NET "LED<5>" LOC = "N11" | IOSTANDARD = "LVCMOS33";
NET "LED<6>" LOC = "R11" | IOSTANDARD = "LVCMOS33";
NET "LED<7>" LOC = "T11" | IOSTANDARD = "LVCMOS33";
![Page 19: ECE 448: Spring 2014 Lab 3 FPGA Design Flow Based on Xilinx ISE and Isim. Using Seven-Segment Displays, Buttons, and Switches](https://reader035.vdocuments.us/reader035/viewer/2022062314/56649ef45503460f94c07285/html5/thumbnails/19.jpg)
# Buttons
NET "CLOCK" LOC = "V10" | IOSTANDARD = "LVCMOS33";
User Constraint File (UCF) CLOCK
![Page 20: ECE 448: Spring 2014 Lab 3 FPGA Design Flow Based on Xilinx ISE and Isim. Using Seven-Segment Displays, Buttons, and Switches](https://reader035.vdocuments.us/reader035/viewer/2022062314/56649ef45503460f94c07285/html5/thumbnails/20.jpg)
Part 4
Switches and Buttons
![Page 21: ECE 448: Spring 2014 Lab 3 FPGA Design Flow Based on Xilinx ISE and Isim. Using Seven-Segment Displays, Buttons, and Switches](https://reader035.vdocuments.us/reader035/viewer/2022062314/56649ef45503460f94c07285/html5/thumbnails/21.jpg)
Buttons
![Page 22: ECE 448: Spring 2014 Lab 3 FPGA Design Flow Based on Xilinx ISE and Isim. Using Seven-Segment Displays, Buttons, and Switches](https://reader035.vdocuments.us/reader035/viewer/2022062314/56649ef45503460f94c07285/html5/thumbnails/22.jpg)
Connection of Buttons to FPGA Pins
![Page 23: ECE 448: Spring 2014 Lab 3 FPGA Design Flow Based on Xilinx ISE and Isim. Using Seven-Segment Displays, Buttons, and Switches](https://reader035.vdocuments.us/reader035/viewer/2022062314/56649ef45503460f94c07285/html5/thumbnails/23.jpg)
Debouncing Buttons
Bouncing period typically smaller than 10 ms
key bounce, tBOUNCE key bounce, tBOUNCE
![Page 24: ECE 448: Spring 2014 Lab 3 FPGA Design Flow Based on Xilinx ISE and Isim. Using Seven-Segment Displays, Buttons, and Switches](https://reader035.vdocuments.us/reader035/viewer/2022062314/56649ef45503460f94c07285/html5/thumbnails/24.jpg)
Using DEBOUNCE_RED to Generate Short Pulses (1)
RED – Rising Edge Detector
![Page 25: ECE 448: Spring 2014 Lab 3 FPGA Design Flow Based on Xilinx ISE and Isim. Using Seven-Segment Displays, Buttons, and Switches](https://reader035.vdocuments.us/reader035/viewer/2022062314/56649ef45503460f94c07285/html5/thumbnails/25.jpg)
Using DEBOUNCE_RED to Generate Short Pulses (2)
![Page 26: ECE 448: Spring 2014 Lab 3 FPGA Design Flow Based on Xilinx ISE and Isim. Using Seven-Segment Displays, Buttons, and Switches](https://reader035.vdocuments.us/reader035/viewer/2022062314/56649ef45503460f94c07285/html5/thumbnails/26.jpg)
# Buttons
NET "BTNS" LOC = "B8" | IOSTANDARD = "LVCMOS33"; BTNS
NET "BTNU" LOC = "A8" | IOSTANDARD = "LVCMOS33"; BTNU
NET "BTNL" LOC = "C4" | IOSTANDARD = "LVCMOS33"; BTNL
NET "BTND" LOC = "C9" | IOSTANDARD = "LVCMOS33"; BTND
NET "BTNR" LOC = "D9" | IOSTANDARD = "LVCMOS33"; BTNR
User Constraint File (UCF) Buttons
![Page 27: ECE 448: Spring 2014 Lab 3 FPGA Design Flow Based on Xilinx ISE and Isim. Using Seven-Segment Displays, Buttons, and Switches](https://reader035.vdocuments.us/reader035/viewer/2022062314/56649ef45503460f94c07285/html5/thumbnails/27.jpg)
SW SW_SIG
Using Switches
8
![Page 28: ECE 448: Spring 2014 Lab 3 FPGA Design Flow Based on Xilinx ISE and Isim. Using Seven-Segment Displays, Buttons, and Switches](https://reader035.vdocuments.us/reader035/viewer/2022062314/56649ef45503460f94c07285/html5/thumbnails/28.jpg)
User Constraint File (UCF) Switches
# Switches
NET "SW<0>" LOC = "T10" | IOSTANDARD = "LVCMOS33";
NET "SW<1>" LOC = "T9" | IOSTANDARD = "LVCMOS33";
NET "SW<2>" LOC = "V9" | IOSTANDARD = "LVCMOS33";
NET "SW<3>" LOC = "M8" | IOSTANDARD = "LVCMOS33";
NET "SW<4>" LOC = "N8" | IOSTANDARD = "LVCMOS33";
NET "SW<5>" LOC = "U8" | IOSTANDARD = "LVCMOS33";
NET "SW<6>" LOC = "V8" | IOSTANDARD = "LVCMOS33";
NET "SW<7>" LOC = "T5" | IOSTANDARD = "LVCMOS33";
![Page 29: ECE 448: Spring 2014 Lab 3 FPGA Design Flow Based on Xilinx ISE and Isim. Using Seven-Segment Displays, Buttons, and Switches](https://reader035.vdocuments.us/reader035/viewer/2022062314/56649ef45503460f94c07285/html5/thumbnails/29.jpg)
Part 5
Hands-on Session on
FPGA Design Flow
based on Xilinx ISE
and Xilinx ISim
![Page 30: ECE 448: Spring 2014 Lab 3 FPGA Design Flow Based on Xilinx ISE and Isim. Using Seven-Segment Displays, Buttons, and Switches](https://reader035.vdocuments.us/reader035/viewer/2022062314/56649ef45503460f94c07285/html5/thumbnails/30.jpg)
Part 6
Introduction to Lab 3
Movie Ticket Dispensing Machine
![Page 31: ECE 448: Spring 2014 Lab 3 FPGA Design Flow Based on Xilinx ISE and Isim. Using Seven-Segment Displays, Buttons, and Switches](https://reader035.vdocuments.us/reader035/viewer/2022062314/56649ef45503460f94c07285/html5/thumbnails/31.jpg)
Stage 1: Choose a Movie
BTNU (UP)
BTNDDOWN
BTNR(RIGHT)
BTNLLEFT
BTNS (Enter)
Default
![Page 32: ECE 448: Spring 2014 Lab 3 FPGA Design Flow Based on Xilinx ISE and Isim. Using Seven-Segment Displays, Buttons, and Switches](https://reader035.vdocuments.us/reader035/viewer/2022062314/56649ef45503460f94c07285/html5/thumbnails/32.jpg)
BTNS (Enter)
Stage 2: Choose Ticket Quantity
Use UP and Down buttons to change the quantity
18 + 13.5 + 9 + 9 = 49.50
![Page 33: ECE 448: Spring 2014 Lab 3 FPGA Design Flow Based on Xilinx ISE and Isim. Using Seven-Segment Displays, Buttons, and Switches](https://reader035.vdocuments.us/reader035/viewer/2022062314/56649ef45503460f94c07285/html5/thumbnails/33.jpg)
Stage 3: Entering Bills
$1 UP
$5DOWN
$20RIGHT
$10LEFT
Blink for 5 sec
Total Amount
Change
![Page 34: ECE 448: Spring 2014 Lab 3 FPGA Design Flow Based on Xilinx ISE and Isim. Using Seven-Segment Displays, Buttons, and Switches](https://reader035.vdocuments.us/reader035/viewer/2022062314/56649ef45503460f94c07285/html5/thumbnails/34.jpg)
Part 7
Lab Exercise
![Page 35: ECE 448: Spring 2014 Lab 3 FPGA Design Flow Based on Xilinx ISE and Isim. Using Seven-Segment Displays, Buttons, and Switches](https://reader035.vdocuments.us/reader035/viewer/2022062314/56649ef45503460f94c07285/html5/thumbnails/35.jpg)
16-bit Binary Up-Down Counter
Fig 1. Block Diagram
rst
clk
Debouncer
rst
clk
REDBTNU
rst
clk
Debouncer
rst
clk
REDBTND
UP/ DOWN COUNTER
en_UP
en_DOWN
C_3..0 hex0hex1
SSD_DRIVER
hex2hex3
C_7..4C_11..8C_15..12
rst
SEG
AN
SEG_6..0
AN_3..0
clkrst
![Page 36: ECE 448: Spring 2014 Lab 3 FPGA Design Flow Based on Xilinx ISE and Isim. Using Seven-Segment Displays, Buttons, and Switches](https://reader035.vdocuments.us/reader035/viewer/2022062314/56649ef45503460f94c07285/html5/thumbnails/36.jpg)
Counter UPCOUNTER UP
Counter UP
q(k-1..k-2)
AN
Counter UP
SEG(6..0)
Counter UP
Counter UPrst
clkOC
SSD_DRIVER
OC – One’s Complement