2 use IEEE.STD_LOGIC_1164.all;
3 use IEEE.STD_LOGIC_ARITH.all;
4 use IEEE.STD_LOGIC_UNSIGNED.all;
6 --------------------------------------------------------------------------------
7 -- This is the top module instantiating quadratic counter with output to the
8 -- on-board LCD. See 'top_counter.ucf' and read how a quadratic encoder is
10 --------------------------------------------------------------------------------
19 rot_press : in std_logic;
20 rot_feed : out std_logic;
22 lcd_com : out std_logic;
23 lcd2_dp : out std_logic;
24 lcd1_dp : out std_logic;
25 lcd1 : out std_logic_vector(6 downto 0);
26 lcd2 : out std_logic_vector(6 downto 0));
29 --------------------------------------------------------------------------------
31 architecture behavioral of top_counter is
36 clk_2k : out std_logic);
41 hex : in std_logic_vector (3 downto 0);
42 lcd : out std_logic_vector (6 downto 0));
49 data_in : in std_logic_vector (6 downto 0);
50 lcd_seg : out std_logic_vector (6 downto 0);
51 lcd_com : out std_logic;
52 lcd_dp : out std_logic);
59 a0, b0 : in std_logic;
60 qcount : out std_logic_vector (31 downto 0);
61 a_rise : out std_logic;
62 a_fall : out std_logic;
63 b_rise : out std_logic;
64 b_fall : out std_logic;
65 ab_event : out std_logic;
66 ab_error : out std_logic);
70 signal lcd_clk : std_logic;
71 signal lcd1_out : std_logic_vector (6 downto 0);
72 signal lcd2_out : std_logic_vector (6 downto 0);
74 signal qcount_data : std_logic_vector (31 downto 0);
75 signal qcount_reset : std_logic;
77 --------------------------------------------------------------------------------
88 hex => qcount_data(5 downto 2),
93 hex => qcount_data(9 downto 6),
114 qcounter_1 : qcounter
117 reset => qcount_reset,
120 qcount => qcount_data,
128 --------------------------------------------------------------------------------
132 qcount_reset <= not reset or rot_press;