std_match
Advanced Member level 4
I found a compare in old code, and I don't understand which function is used.
I can not find ">" for std_logic_vector.
VHDL has a built-in ">" for bit_vector, but it should not be used here?
I have created a small example. Look at line 21.
Tested with Modelsim 6.6d
I can not find ">" for std_logic_vector.
VHDL has a built-in ">" for bit_vector, but it should not be used here?
I have created a small example. Look at line 21.
Tested with Modelsim 6.6d
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 library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity std_logic_vector_compare is port(counter_vector_copy : out std_logic_vector(3 downto 0); greater_than_6 : out std_logic); end entity std_logic_vector_compare; architecture test of std_logic_vector_compare is signal counter_vector : std_logic_vector(3 downto 0); signal counter : unsigned(3 downto 0) := "0000"; begin -- architecture test counter_vector_copy <= counter_vector; counter_vector <= std_logic_vector(counter); process(counter_vector) begin if counter_vector > "0110" then -- Which compare function ??? greater_than_6 <= '1'; else greater_than_6 <= '0'; end if; end process; stimuli: process begin wait for 1 us; if counter = 15 then wait; end if; counter <= counter + 1; end process; end architecture test;