我试图添加两个存储有符号位的寄存器,其中一个是3位[FRQ(2 downto 0)
],另一个是7位[PHS(6 downto 0)
] ...并且必须存储添加这两个寄存器在7位寄存器[PHS(6 downto 0)
]中。提前感谢您的有益姿态。
我得到的错误是..>>> 错误:/..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;
答案 0 :(得分:2)
你对equest.addheader('Content-Type': 'application/json;charset=UTF-8');
request.addheaders('Authorizcation', 'Basic '+btoa(username + ':' + password));
声明感到困惑。在from sklearn.neural_network import MLPRegressor
mlp = MLPRegressor(hidden_layer_sizes=(5, ), activation='relu', verbose=True, learning_rate_init=1, learning_rate='adaptive', max_iter=500,)
mlp.fit(X,y)
mlp.score(X,y)
print mlp.coefs_
print mlp.n_layers_
print mlp.n_outputs_
print mlp.out_activation_
行后,如果您要继续if-elsif-else
语句ext_FRQ(6 downto 3) <= b"1111";
,请注明--end if;
语句下一个条件应以if-elsif-else
字词开头,而不是简单elsif
码。
最后你需要关闭if
构造。
除了你需要添加到灵敏度列表if-elsif-else
信号,因为你在比较中使用它,如果你没有将它添加到灵敏度列表中以下结构
sig_FRQ
会出错。
在您的情况下,我认为if sig_FRQ(2)='1' then
ext_FRQ(6 downto 3) <= b"0000";
else
ext_FRQ(6 downto 3) <= b"1111";
end if;
构造的正确版本如下:
if-elsif-else
最后,如果要将结果分配给输出,则需要使用其他运算符
process (sig_FRQ)
begin
if sig_FRQ(2)='1' then
ext_FRQ(6 downto 3) <= b"0000";
else
ext_FRQ(6 downto 3) <= b"1111";
end if;
end process;
process (SMP_CLK, RESET)
if RESET='1' then
sig_PHS <= b"0000000";
elsif (rising_edge(SMP_CLK)) then
--temp_PHS <= sig_PHS;
sig_PHS <= ext_FRQ + temp_PHS;
end if;
end process;
。