Dept. Logo
Lab Home page
Department of Microelectronic Systems, Faculty of Electronics, Telecommunications and Informatics, Gdansk University of Technology Logo Wydziału
Flaga PL Polska wersja

Simple stop-watch

Task: The designed circuit has to measure time with 1/100 sec. accuracy. Consecutive pressing the pushbutton BTN0 should cause the following actions:


Fig.1 Stop-watch pushbutton actions.

Time should be displayed on the LED display in the following format: SS.DD, where: SS=seconds, DD=1/100 of seconds. Reaching the limit of 59.99 sec can be indicated by displaying a special symbol (e.g. "--.--").

Button BTN3 is performing an additional asynchronous reset.

Attention: Design has to be protected from switch bouncing (only for BTN0)! It can be assumed, that after pressing the button, contacts may bounce for up to 50ms.


Fig.2 An example of voltage change during pressing the pushbutton.


The design has to contain frequency divider and display driver from previous exercises, embedded as components.


Write a testbench.
Before implementing the design, a simulation must be run using the testbench.

UCF file, Digilent Spartan-3, Spartan-3 3S200 FT256-4:
#########################################################################################
# Clock:
NET "clk_i" LOC = "T9" ; # 50 MHz clock
#########################################################################################

#########################################################################################
NET "led7_an_o<3>" LOC = "E13" ; # leftmost digit, active low
NET "led7_an_o<2>" LOC = "F14" ; # active low
NET "led7_an_o<1>" LOC = "G14" ; # active low
NET "led7_an_o<0>" LOC = "d14" ; # rightmost digit, active low
#
NET "led7_seg_o<7>" LOC = "E14" ; # segment 'a', active low
NET "led7_seg_o<6>" LOC = "G13" ; # segment 'b', active low
NET "led7_seg_o<5>" LOC = "N15" ; # segment 'c', active low
NET "led7_seg_o<4>" LOC = "P15" ; # segment 'd', active low
NET "led7_seg_o<3>" LOC = "R16" ; # segment 'e', active low
NET "led7_seg_o<2>" LOC = "F13" ; # segment 'f', active low
NET "led7_seg_o<1>" LOC = "N16" ; # segment 'g', active low
NET "led7_seg_o<0>" LOC = "P16" ; # segment 'dp', active low
#########################################################################################

#########################################################################################
# Push-buttons:
NET "start_stop_button_i" LOC = "M13" ; # BTN0 active high
NET "rst_i" LOC = "L14" ; # BTN3 active high
#########################################################################################

Wyświetlacz LED
Fig.2 Description of LED display connectors. Example of displaying digit '2'