Syntax: [<identifier>] using logical functions |
Examples: |
Syntax: ... [ elsif <condition> then ... else ... ] endif; |
Examples: end if; if condition_v_1 = '1' then elsif condition_v_2 = '1' then ... else end if; |
Syntax: ... [when others => ... ] |
Example: when x"18" => when x"19" | x"20" | x"21" => when others => |
Syntax: the type of the assigned signal |
Examples: std_logic_signal <= signal_a and signal_b; large_vector(15 downto 6) <= small_vector(10 downto 0); |
Syntax: the type of the assigned variable |
Examples: temp_v(3 downto 0) := sl_vector_signal(7 downto 4); |
Syntax: constant declarations ... ... |
Example: begin |
Syntax: port map( ... in the order you declared them in the component declaration, but this is not generally considered good coding style generic map( ... |
Examples: port map( input_2 => input_2_sig, output => output_sig |
Examples: std_logic_signal <= '0'; sl_vector_signal_8 <= "11110000"; sl_vector_signal_8 <= x"F0"; sl_vector_signal_8 <= sl_vector_signal_16(15 downto 8); std_logic_signal <= sl_vector_signal_8(5) sl_vector_signal_8 <= (others => '0') MORE?!?! |
Examples: variable bool_v: boolean := true; |
Type: positive: 1 to integer'high natural: 0 to integer'high |
Syntax: |
Examples: signal other_int: integer -1 to 15; variable ram_addr_v: natural 0 to ADDRMAX; |
Syntax: use <library_name>.<package_name>.[all|<part>]; |
Examples: use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; |
Syntax: |
Examples: |
Syntax: |
Examples: |
Syntax: port( ... -- except the last one ); generic( ... -- except the last one ); end [entity | <entity_name>]; |
Example: port( input_2: in std_logic; output: out std_logic end or_entity; |
Syntax: -- in simulation and not for synthesis |
Examples: signal bus_signal: std_logic_vector(15 downto 0); signal count: integer range 0 to 31; |
Syntax: |
Examples: constant state_1 : std_logic_vector := "01"; constant state_2 : std_logic_vector := "10"; constant addr_max: integer := 1024; |
Syntax: <signal_1> : type; . . . < signal_n> : type returns return type is variable declarations ... ... end <function_name>; |
Example: ) return std_logic_vector(31 downto 0) is begin output(31 downto 16) <= (others => narrow_bus(15)); return output; |
Syntax: port ( in entity declarations ... ); generic( in entity declarations ... ); end component; |
Example: port( input_2: in std_logic; output: out std_logic end component; |
Syntax: |
Examples: variable data_v: std_logic_vector(7 downto 0); variable condition_v: boolean; |
Syntax: type <type_name> is array (<low> to <high>) of <data_type>; type <type_name> is array (<high> downto <low>) of <data_type>; |
Examples: type int_array is array(3 downto 0) of integer; type sl_vector_array is array(0 to 15) of std_logic_vector; |
Syntax: subtype <subtype_name> is <type_name> range <high> downto <low>; |
Examples: subtype sub_enum_type is enum_type range a to m; |