2017-04-17 18 views
0

3 비트 [FRQ (2 downto 0) 중 하나가 부호있는 비트를 저장하는 두 개의 레지스터를 추가하려고합니다.)]이고 다른 하나는 7 비트 [PHS (6 downto 0)] ...이며이 두 레지스터의 추가를 7 비트 레지스터 [PHS (6 downto 0)]에 저장해야합니다. 도움이되는 제스처에 미리 감사드립니다.오류 : /..integrator.vhd(47) : "프로세스"근처 : (VHCOM-1576) IF VHDL이 필요합니다

내가 오류가 오류 >>> ..입니다 : /..integrator.vhd(47) : 근처 "프로세스"(VCOM-1576) 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; 

답변

2

if-elsif-else 문구가 있습니다. ext_FRQ(6 downto 3) <= b"1111";이있는 행 다음에 if-elsif-else 문을 계속 사용하려면 --end if;을 주석 처리했습니다. 다음 상태는 코드에서와 같이 if이 아닌 elsif 단어로 시작해야합니다.

그리고 결국 if-elsif-else 구성을 닫아야합니다.

뿐만 아니라 당신이 잘못 작동 감도 목록에 다음 건설

if sig_FRQ(2)='1' then 
    ext_FRQ(6 downto 3) <= b"0000"; 
else 
    ext_FRQ(6 downto 3) <= b"1111"; 
end if; 

를 추가하지 않을 경우 당신은 당신이 비교를 사용하기 때문에 감도 목록에 sig_FRQ 신호를 추가 할 필요가있다. 당신이 출력 결과를 지정하려는 경우, 다른 사업자

PHS <= sig_PHS;을 사용할 필요가 결국

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; 

: 귀하의 경우

나는 같은 if-elsif-else 구조물의 올바른 버전이 보이는 가정 .

+0

출력 포트 할당을 수정해야하지만 귀하의 제안이 많은 도움이되었습니다. 고마워. 적절한 추가를 위해 약간의 수정이 필요하지만 코드가 실행 중입니다. 시뮬레이션을 한 결과 예상대로 결과를 얻지 못했습니다. 어쨌든, 다시 한번 감사드립니다. !! –

+0

코드의 목표는 무엇입니까? – Roman

+0

예상대로 작동합니다. !! 어쨌든, 나는 데이터 통신을위한 FSM을 구현 중이며, 디지털 설계를 사용하는 변조 방식에 사용된다. –