1

我们有一个类型,它是一个大小为 3 的 32 位“std_logic_vector”数组,其定义如下:

subtype scalar is std_logic_vector(31 downto 0);
type vector_nd is array (natural range <>) of scalar;
subtype vector_3d is vector_nd(2 downto 0);

我们有一个“vector_3d”类型的信号,我们想将其乘以 2,并将结果放入“scalar”类型的信号中:

signal v_normal_out_sig := vector_3d;
signal mult1_in1_sig    := scalar;
--...
mult1_in1_sig <= 2*signed(v_normal_out_sig(0)) when cau_state = st_cycle18;

当我们编译它时,我们得到错误:

No feasible entries for infix operator "*".

什么是实现我们想要的正确方法?我们正在使用以下库:

  • ieee.std_logic_1164.all
  • ieee.std_logic_arith.all
  • ieee.std_logic_unsigned.all
4

1 回答 1

0

我们最终做的是休耕:

mult1_in1_sig <= v_normal_out_sig(0)(31) & v_normal_out_sig(0)(29 downto 0) & '0' when cau_state = st_cycle18;

并且测试对正数和负数都给出了正确的结果。

于 2012-08-24T13:30:23.247 回答