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

Real Time Clock

Exercise: Design and implement real time clock, displaying time in format: HH.MM. Dot should pulse with 1 Hz frequency.

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.

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:
# @ @ @ @
# btn3 btn2 btn1 btn0
NET "btn_i<0>" LOC = "M13" ; # active high
NET "btn_i<1>" LOC = "M14" ; # active high
NET "btn_i<2>" LOC = "L13" ; # active high
NET "btn_i<3>" LOC = "L14" ; # active high
#########################################################################################

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