VHDL赋值语句

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/xxxxppppp/article/details/81771997
result  <= temp;

上述语句在运行时,可以实时赋值。

architecture Behavioral of top is


    COMPONENT sum
    PORT(
        rst         : IN std_logic;
        clk         : IN std_logic;
        a           : IN std_logic_vector(3 downto 0);
        b           : IN std_logic_vector(3 downto 0);          
        dout        : OUT std_logic_vector(3 downto 0)
        );
    END COMPONENT;

    signal temp     : std_logic_vector(3 downto 0);

begin
    sum_inst: sum PORT MAP(
        rst         => rst, 
        clk         => clk,
        a           => a,
        b           => b,
        dout        => temp 
    );

    result  <= temp;

end Behavioral;

其中sum模块用于计算两路输入信号之和,在时钟上升沿触发计算。仿真结果如下:
这里写图片描述

猜你喜欢

转载自blog.csdn.net/xxxxppppp/article/details/81771997