我想从实数数组生成正弦波。
这里是包含12个正弦采样的数组
type memory_type is array (0 to 11) of real;
signal sine : memory_type :=0.50,0.7,0.95,0.99,0.88,0.64,0.36,0.12,0.01,0.05,0.23,0.50);
和 i 信号进行迭代:
signal i : integer range 0 to 10 :=0;
这是根据样本生成2kHz波的过程
process(clk_2kHz)
begin
if (rst = '1') then
i <= 0;
elsif(rising_edge(clk_2kHz)) then
dataout <= sine(i);
i <= i + 1;
if (i = 11) then
i<= 0;
end if;
end if;
end process;
我想将此信号传递到spartan-3E上的LTC2624,并在输出上获得模拟正弦波。
问题是我开始出现此错误:
Line 94: Indexed name is not a integer
为什么会这样?我知道数组包含实数值,但索引号是整数(我认为)。我尝试将我更改为真实,但没有帮助。 有任何建议吗?