sam93
Junior Member level 1
hi dear friend. I used your advises and wrote the following code. in simulation ,when I use "std_logic_vector (25 downto0 )" instead of "integer range " for "c" and "counter_2" , the result for "c" is "xxxxxxxxxxxxxxxxxxxxxx"! what's should I do? thank you in advanced.
simulation is in ise.
vhdl code:
simulation is in ise.
vhdl code:
Code VHDL - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 entity tes is port ( CLK_20M : in STD_LOGIC; CLK : in STD_LOGIC; b : out integer range 0 to 19999999; c : out integer range 0 to 19999999 ); end tes; architecture Behavioral of tes is signal cnt_1 : integer range 0 to 19999999 ; begin one:process(CLK) variable counter: integer range 0 to 19999999 ; begin if rising_edge(CLK) then counter := counter + 1; end if; cnt_1 <= counter; b <= cnt_1; end process; two:process(CLK_20M) variable counter_2: integer range 0 to 19999999 ; begin if (cnt_1 < 20000000) then if rising_edge(CLK_20M) then counter_2 := counter_2 + 1; end if; end if; c <= counter_2; end process; end Behavioral;
Attachments
Last edited: