kokei74
Junior Member level 3
Im having problem with my counter which will control my storage data in ROM to multiply with another ROM. Both rom will stored matrix data. im having a problem with my counter where it only can count from 0 to 15. For my design i need a counter that need to count from 0 - 3 and repeat counting for 4 times then only it can continue count to 4-7(repeat 4 times to).
example of what it should count is like this..
0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3 4 5 6 7 4 5 6 7 4 5 6 7 4 5 6 7 8 9 10 11 ..... until 16
i have attached a figure and hope u can understand my prob.
Hope someone can look into my problem. Thanks.
here is my previous counter.
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
LIBRARY lpm;
USE lpm.lpm_components.all; --functions
ENTITY CounterA IS
PORT (clock : IN STD_LOGIC;
q : OUT STD_LOGIC_VECTOR(3 DOWNTO 0));
END CounterA;
ARCHITECTURE lpm OF CounterA IS
BEGIN
-- Port map 1
U1: lpm_counter
GENERIC MAP (lpm_width => 4, lpm_direction => "up")
PORT MAP (clock => clock,q => q);
END;
example of what it should count is like this..
0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3 4 5 6 7 4 5 6 7 4 5 6 7 4 5 6 7 8 9 10 11 ..... until 16
i have attached a figure and hope u can understand my prob.
Hope someone can look into my problem. Thanks.
here is my previous counter.
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
LIBRARY lpm;
USE lpm.lpm_components.all; --functions
ENTITY CounterA IS
PORT (clock : IN STD_LOGIC;
q : OUT STD_LOGIC_VECTOR(3 DOWNTO 0));
END CounterA;
ARCHITECTURE lpm OF CounterA IS
BEGIN
-- Port map 1
U1: lpm_counter
GENERIC MAP (lpm_width => 4, lpm_direction => "up")
PORT MAP (clock => clock,q => q);
END;