직렬 데이터 신호 (에지)에서 에지를 감지하고 싶습니다. 나는 성공적으로 실행중인 VHDL에 다음과 같은 코드를 작성했지만 에지는 하나의 클록주기 지연으로 검출된다. 즉, 변경 출력은 각 에지에서 하나의 clk_50mhz주기 지연으로 생성된다. 아무도 지체없이 가장자리를 감지하도록 도와주세요. 고맙습니다. 나는 다음에 내 코드를 변경 VHDL 에지 감지
process (clk_50mhz)
begin
if clk_50mhz'event and clk_50mhz = '1' then
if (rst = '0') then
shift_reg <= (others => '0');
else
shift_reg(1) <= shift_reg(0);
shift_reg(0) <= din;
end if;
end if;
end process;
process (clk_50mhz)
begin
if clk_50mhz'event and clk_50mhz = '1' then
if rst = '0' then
change <= '0' ;
elsif(clk_enable_2mhz = '1') then
change <= shift_reg(0) xor shift_reg(1);
end if ;
end if ;
end process ;
내가 정확하게 당신이 필요 발견 가장자리
process (clk_50mhz)
begin
if clk_50mhz'event and clk_50mhz = '1' then
if (RST = '0') then
shift_reg <= (others=>'0');
else
shift_reg(1) <= shift_reg(0);
shift_reg(0) <= din;
end if;
end if;
end process;
change <= shift_reg(1) xor din;
해당 페이지에서 제공되는 솔루션은 가장자리를 감지하거나 상승 또는 하강에 대한 참고 있지만 둘 다. –
코드 패스포트 투트를 가져 주셔서 감사합니다. 나는 상승 및 하강 에지를 모두 감지하고 싶습니다. 코드를 구현할 때 din_delayed1은 din과 동일하므로 변경이 없습니다. – user24883
din_delayed1이 din과 무엇을 의미합니까? 그것들은 1 클럭 사이클 씩 떨어져 있습니다. – Passepartout