숙제를 위해이 std_logic_vectors를 추가하려면 어떻게해야합니까? [닫은

StackOverflow https://stackoverflow.com/questions/633081

  •  08-07-2019
  •  | 
  •  

문제

코드를 디버깅 한 후 코드를 수락하는 시점에 도달했지만 시뮬레이터 예외가 발생합니다.

내가 가진 주요 문제는 임시 배열을 초기화하고 끝에 벡터를 추가하는 것입니다.

추가에 사용되는 방법은 std_logic_vectors를 추가 할 수 없으므로 참조에서 찾은 방법입니다.

감사합니다, Buzkie

library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.numeric_std.all;

entity signedmult is 
port (cand, lier: in std_logic_vector (4 downto 0);
    pro: out std_logic_vector (9 downto 0)); 

end signedmult;     


architecture synth of signedmult is
      --temp arrays
      signal a,b,c,d,e: std_logic_vector(9 downto 0); 

begin
process (a,b,c,d,e)
        variable j:integer;
begin

for j in 0 to 9 loop
a(j) <= '0';
b(j) <= '0';
c(j) <= '0';
d(j) <= '0';
e(j) <= '0';

end loop;

end process;

process (cand, lier,a,b,c,d,e)      
        variable i:integer;     
begin
    for i in 0 to 4 loop
     a(i) <= cand(0) and lier(i);
     b(i+1) <= cand(1) and lier(i);
        c(i+2) <= cand(2) and lier(i);
        d(i+3) <= cand(3) and lier(i);
        e(i+4) <= cand(4) and lier(i);
    end loop;

end process;

  a(5) <= a(4); a(6) <= a(4); a(7) <= a(4); a(8) <= a(4);

  b(6) <= b(5); b(7) <= b(5); b(8) <= b(5);

  c(7) <= c(6); c(8) <= c(6);

  d(8) <= d(7);

  pro <= std_logic_vector(unsigned(a) + unsigned(b)); -- + c + d + e;


end synth;
도움이 되었습니까?

해결책

먼저 제거해야합니다 std_logic_arith 충돌을 피하기 위해 numeric_std.

일단 완료되면 나는 당신의 추가가 왜 작동하지 않아야하는지 알 수 없습니다.

실행할 때 어떤 오류가 발생합니까?

또한 여러 프로세스에서 신호를 구동하여 쓰레기를 얻을 수 있습니다. a 그리고 b. 그것이 오류의 원인 인 이유는 무엇입니까? 온도 배열에 모든 과제를 하나의 프로세스에 넣으십시오.

다른 팁

빠르고 쉬운 방법 :

a(9 downto 0) <= (others=>'0');
b(9 downto 0) <= (others=>'0');
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top