问题是我想使用这个sll
命令,但得到这个错误(在图中)。我知道我在使用sll时出现错误
bp := bp(0 to 6) & '0';
声明,但我仍然想使用这个sll。谁能帮忙?
错误行: 从上次
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.numeric_std;
entity mul is
port(
a, b : in std_logic_vector(0 to 3);
c : out std_logic_vector(0 to 7));
end mul;
architecture mul of mul is
begin
process(a, b)
variable bp, p : std_logic_vector(0 to 7);
begin
bp := "0000"&b;
p := "00000000";
for k in 0 to 3 loop
if a(k) = '1' then
p := p + bp;
end if;
bp := bp sll 1;
end loop;
c <= p;
end process;
end mul;
什么'图片'祈祷告诉? – user1155120
您收到的错误在这里没有证据。如果您有权访问-2008兼容的VHDL工具,则使用包含IEEE软件包numeric_std_unsigned的use子句替代包含Synopsys软件包std_logic_arith和IEEE软件包numeric_std的使用子句将允许您的代码进行分析,详细说明和模拟(不对其准确性进行评论)。包numeric_std_unsigned允许您将std_logic_vector对象视为未签名。 – user1155120
[将n位的std \ _logic \ _vector左移或右移]的可能重复(http://stackoverflow.com/questions/9018087/shift-a-std-logic-vector-of-n-bit-to rightright或left) –