1 ------------------------------------------------------------------------------- 3 --! @brief Quadrature decoder module 4 ------------------------------------------------------------------------------- 9 --! Using IEEE standard logic components 10 USE ieee.std_logic_1164.
ALL;
12 --! Using IEE standard numeric components 15 --! @brief Quadrature decoder entity 18 bit_width : := 8 --! Width of the quadrature decoder 27 END ENTITY quad_decoder;
29 --! Architecture rtl of quad_encoder entity 41 --! @brief Process to perform quadrature counting 44 VARIABLE v_count_en : ;
--! Flag to perform count 45 VARIABLE v_count_dir : ;
--! Flag for count direction 54 ELSIF (rising_edge(clk_in)) THEN 55 -- Evaluate whether to count and in which direction 60 IF (v_count_en = '1') THEN 61 IF (v_count_dir = '1') THEN 68 -- Update delayed inputs 75 --! Drive quadrature output _library_ ieeeieee
Using IEEE library.
Quadrature decoder entity.
in clk_instd_logic
Clock.
out quad_count_outunsigned( bit_width- 1 DOWNTO 0)
Quadrature count output.
in quad_a_instd_logic
Quadrature a input.
unsigned( bit_width- 1 DOWNTO 0) quad_count
Quadrature count.
bit_widthnatural := 8
Width of the quadrature decoder.
std_logic quad_a_old
Old copy of quad_a.
in rst_instd_logic
Asynchronous reset.
std_logic quad_b_old
Old copy of quad_b.
in quad_b_instd_logic
Quadrature b input.