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

Counter in Gray code

Task: Design 2-bit Gray code counter.

Inputs:
- button BTN0 simulating clock (signal's name - clk_i),
- button BTN3 asynchronous reset (signal's name - rst_i).

Outputs:
- LED LD0 - bit 0 (signal's name - led_o(0)),
- LED LD1 - bit 1 (signal's name - led_o(1)).

Widok płytki

Clock is generated by consecutive pushing the button BTN0 and due to this switch bouncing can be observed (generation of more than one slope after single pressing the button).

Functional simulation has to be run and the circuit has to be practically verified by programming the prototype board.

UCF file, Digilent Spartan-3 board, Spartan-3 3S200 FT256-4:
# Push-buttons:
NET "rst_i" LOC = "L14" ; # pressed high BTN3
NET "clk_i" LOC = "M13" ; # pressed high BTN0
# pin M13 is not dedicated to clock, so force it:
NET "clk_i" CLOCK_DEDICATED_ROUTE = FALSE;
# LEDs:
NET "led_o<0>" LOC = "K12" ; # high on
NET "led_o<1>" LOC = "P14" ; # high on