仿真的图形给出了,因为本题数字太大,我改小后仿真的
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_unsigned.all;
entity fp is
port (
clk: in STD_LOGIC;
q: out STD_LOGIC
);
end fp;
architecture fp_arch of fp is
begin
process(clk)
variable n:integer range 0 to 49999;
begin
if clk'event and clk='1' then
if n<=24999 then
n:=n+1;
q<='0';
elsif n=49999 then
n:=0;
q<='1';
else
n:=n+1;
q<='1';
end if;
end if;
end process;
end fp_arch;