如何用VHDL实现八位的串并转换?
如何用VHDL实现八位的串并转换? library ieee;use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity in8out1 is
port( clk,indata,rst: in std_logic;
outdata: out std_logic_vector(7 downto 0));
end in8out1;
architecture sepa of in8out1 is
signal temp_data: std_logic_vector(8 downto 0);
begin
process(clk)
begin
if clk'event and clk='1' then
if rst='0' then
temp_data<=( others=>'0' );
elsif temp_data(0)='0' then
temp_data<=indata&"01111111";
else
temp_data<=indata&temp_data(8 downto 1);
end if;
end if;
end process;
process(temp_data)
begin
if temp_data(0)='0' then
outdata<=temp_data(8 downto 1);
else
outdata<="00000000";
end if;
end process;
end sepa; 程序我写好了。仿真我也做了。发现有毛刺,现在也没有解决,原因是可能器件的延迟设计的不好,另外做的只是功能仿真,结果上看是基本符合的。请你仔细调试一下,看看效果怎么样。
程序我写好了。仿真我也做了。发现有毛刺,现在也没有解决,原因是可能器件的延迟设计的不好,另外做的只是功能仿真,结果上看是基本符合的。请你仔细调试一下,看看效果怎么样。 如何用VHDL实现八位的串并转换?
页:
[1]