vhdl语言将1mhz的时钟频率分为400分频和800分频
2个回答
展开全部
我帮你写了个,已经通过波形仿真。
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
entity fp is
port( clk :in std_logic;--1MHz时钟输入
clk1,clk2 :buffer std_logic;--clk1为400分频,clk2为800分频
reset :in std_logic
);
end fp;
architecture fps of fp is
begin
process(clk,reset)
variable count1:integer range 400 downto 0;
variable count2:integer range 800 downto 0;
begin
if reset='1' then
count1:=0;
count2:=0;
clk1<='0';
clk2<='0';
elsif rising_edge(clk) then
count1:=count1+1;
count2:=count2+1;
if count1=400 then
clk1<=not clk1;
count1:=0;
end if;
if count2=800 then
count2:=0;
clk2<=not clk2;
end if;
end if;
end process;
end fps;
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
entity fp is
port( clk :in std_logic;--1MHz时钟输入
clk1,clk2 :buffer std_logic;--clk1为400分频,clk2为800分频
reset :in std_logic
);
end fp;
architecture fps of fp is
begin
process(clk,reset)
variable count1:integer range 400 downto 0;
variable count2:integer range 800 downto 0;
begin
if reset='1' then
count1:=0;
count2:=0;
clk1<='0';
clk2<='0';
elsif rising_edge(clk) then
count1:=count1+1;
count2:=count2+1;
if count1=400 then
clk1<=not clk1;
count1:=0;
end if;
if count2=800 then
count2:=0;
clk2<=not clk2;
end if;
end if;
end process;
end fps;
光派通信
2024-09-03 广告
2024-09-03 广告
波分复用(WDM)技术是一种在光纤通信中广泛应用的技术,它允许在同一根光纤中同时传输多个不同波长的光信号。这些光信号在发送端通过复用器合并,然后在光纤中传输,最后在接收端通过解复用器分离并恢复成原始信号。WDM技术极大地提高了光纤的传输容量...
点击进入详情页
本回答由光派通信提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询