Jaeyong Chung
System-on-Chip(SoC) Laboratory
Incheon National University
Digital Integrated Circuits
Lab 5
Outline
Chung EPC6055 2
BCD Counter
FPGA Board
BCD Counter
Chung EPC6055 3
Introduction
Make a decade counter by using a counter module.
A data from the decade counter is changed into the FND
data by the FND decoder.
Express a decade number by using the FND data and the
fndscan.
BCD Counter
7-Segment
The numerals 0, 1, 6, 7 and 9 may be represented by 7 leds.
Chung EPC6055 4
BCD Counter
7-Segment
Binarycode encodings for displaying the digits.
DATA value
Chung EPC6055 5
Digits A B C D E F G DP Digits A B C D E F G DP
BCD Counter
7-Segment
By adjusting some values, each of the segments displays a
different number.
DATA value SCAN value
Digits
Chung EPC6055 6
BCD Counter
Implementation
The device is initialized by reset signal.
The counter increment once for every second.
Display form
The device display the digits by using 7-Segments.
Chung EPC6055 7
BCD Counter
Block Diagram
Chung EPC6055 8
BCD Counter
Code
clockGenerator
Chung EPC6055 9
BCD Counter
Code
clockDivider
Chung EPC6055 10
Code
clockDivider
BCD Counter
Chung EPC6055 11
BCD Counter
Code
counter
Chung EPC6055 12
BCD Counter
Code
fndDecoder
Chung EPC6055 13
BCD Counter
Code
fndDecoder
Chung EPC6055 14
BCD Counter
Code
Testbench
Chung EPC6055 15
BCD Counter
Simulation result
Chung EPC6055 16
BCD Counter
Code
Main
rstMain -> Reset signal
clkMain -> Main Clock
fndData -> Data
fndScan -> Com data
Chung EPC6055 17
BCD Counter
Code
UCF
connecting the module with FPGA PIN
Chung EPC6055 18
Outline
Chung EPC6055 19
BCD Counter
FPGA Board
FPGA Board
Chung EPC6055 20
FPGA Board
Block Diagram
Chung EPC6055 21
Create New Project
File -> New Project
Enter a name and a path of your project.
Chung EPC6055 22
Create New Project
Setting some values.
Chung EPC6055 23
Create New Project
Next
Chung EPC6055 24
Create New Project
Add files
Chung EPC6055 25
Create New Project
Project was created successfully.
Chung EPC6055 26
Synthesize (XST)
Click the run menu.
Chung EPC6055 27
Synthesize (XST)
Run succeeded.
Chung EPC6055 28
Download
Double click “iMPACT 10.1” icon.
Select “create a new proejct”
Chung EPC6055 29
Download
Select “Configure devices using Boundary-Scan(JTAG)”
Chung EPC6055 30
Download
Double click ‘xc3s2000’
Download the bit file
Chung EPC6055 31
Download
Click the right button and the program
Chung EPC6055 32
BCD Counter
Implementation
Chung EPC6055 33
Clock domain crossing
A clock domain crossing(CDC) is the traversal of a
signal in a synchronous digital circuit from one clock
domain into another
Avoid if possible (Metastability, etc…)
Exercise
Remove CDC in BCD counter
D Q D Q
CLK1 CLK2
Chung EPC6055 34