我试图添加两个寄存器来存储有符号位的一个3位[FRQ(2 downto 0 )]和其他7位[PHS(6 downto 0)] ...并且必须在7位寄存器[PHS(6 downto 0)]中存储这两个寄存器。预先感谢您的有益姿态。错误:/..integrator.vhd(47):在“process”附近:(vcom-1576)期望中IF VHDL
我得到的错误是... >>> 错误:/..integrator.vhd(47):近 “过程”:(VCOM-1576)预计IF VHDL
这里是我的代码:
library IEEE;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
--use ieee.std_logic_unsigned.all;
entity integ is
port (
SMP_CLK : in std_logic;
RESET : in std_logic;
PHS : out signed (6 downto 0);
FRQ : in signed (2 downto 0)
);
end integ;
architecture behaviour of integ is
signal sig_FRQ : signed(2 downto 0) := (others => '0');
signal ext_FRQ : signed(6 downto 0) := (others => '0');
signal sig_PHS : signed(6 downto 0) := (others => '0');
signal temp_PHS : signed(6 downto 0) := (others => '0');
begin
sig_FRQ <=FRQ;
temp_PHS <= sig_PHS;
--PHS <=signal_PHS;
process (SMP_CLK, RESET)
begin
if sig_FRQ(2)='1' then
ext_FRQ(6 downto 3) <= b"0000";
else
ext_FRQ(6 downto 3) <= b"1111";
--end if;
if RESET='1' then
sig_PHS <= b"0000000";
elsif (rising_edge(SMP_CLK)) then
-- temp_PHS <= sig_PHS;
sig_PHS <= signed(ext_FRQ) + signed(temp_PHS);
end process;
sig_PHS => PHS;
end behaviour;
我必须修改输出端口分配,但您的建议是很有帮助的。非常感谢。代码现在正在运行,但需要进行一些纠正才能正确添加。因为在模拟之后,我没有像我期望的那样得到结果。总之,再次感谢。 –
你的代码的目标是什么? – Roman
得到它按预期工作。无论如何,我正在实施用于数据通信的FSM,以用于使用数字设计的调制方案。 –