0

符号付きビットを格納する 2 つのレジスタを追加しようとしています。1 つは 3 ビット [ FRQ(2 downto 0)] で、もう 1 つは 7 ビット [ PHS(6 downto 0)] です...そして、これら 2 つのレジスタの加算を 7 ビット レジスタ [ PHS(6 downto 0)] に格納する必要があります。親切なジェスチャーをお寄せいただきありがとうございます。

私が得るエラーは..>>> Error: /..integrator.vhd(47): near "process": (vcom-1576) expected 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; 
4

1 に答える 1