library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
en
tity singt is
port(clk: in std_logic;
dout1:out real); --std_logic_vector(7 downto 0));
end;
architecture dacc of singt is
component data_rom
port(address:in std_logic_vector(5 downto 0);
inclock:in std_logic;
q:out std_logic_vector(7 downto 0));
end component;
signal q1:std_logic_vector(5 downto 0);
signal dout:std_logic_vector(7 downto 0);
--signal q:std_logic_vector(7 downto 0);
begin
process(clk)
begin
if clk'event and clk='1' then
q1<=q1+1;
dout1 <= dout*3.3/255;
end if;
end process;
u1:data_rom port map(address=>q1,q=>dout,inclock=>clk);
--dout1 <= dout*3.3/255;
end;
程序的功能是使输出的正弦信号的值控制LED灯的亮灭程度,来说明输出正弦值得变化
运行的时候有错误。
一周热门 更多>