在一個過程中,我在UNSIGNED
向量上做了一些工作,我需要在該過程結束時切片並將其重新轉換爲SLV
。有沒有比這更好的/更清潔的方式?轉換爲std_logic_vector並更有效地切片
out_O : out STD_LOGIC_VECTOR(15 downto 0)
variable o : UNSIGNED(17 downto 0) := (others => '0');
variable outcast_t : STD_LOGIC_VECTOR(17 downto 0) := (others => '0');
...
o := mod_t - div_t + const;
outcast_t := STD_LOGIC_VECTOR(o);
out_O <= outcast_t(15 downto 0);
你不應該需要中間信號:'out_O <= STD_LOGIC_VECTOR(o(15 downto 0));'應該工作 –
哦,我在演員後切片。這是個好消息和更好的解決方案 – chris