⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 baud.vhd

📁 UART的完整发送程序
💻 VHD
字号:
---------------------------------------------------------------
--File name : Baud.vhd
--Function  : 波特率发生器
--Interface : 
--			clk : 时钟输入,为24MHz,波特率为115200,由于
--        		时钟为波特率的4倍,所以分频系数为
--            	64000000/115200/4=138
--        	dout : 波特率输出
--Author : wanyou
--Date  : 2008-03-24
----------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;

entity Baud is
port(
	clk  : in std_logic;
	dout : out std_logic
	);
end Baud;

architecture behave of Baud is
constant cnt_len : integer := 137;
signal temp : std_logic;
begin
	process(clk)
	variable cnt : integer range 0 to cnt_len;
	begin
		if rising_edge(clk) then
			if cnt = cnt_len/2 then
				cnt := 0;
				temp <= not temp;
			else
				cnt := cnt + 1;
			end if;
		end if;
		dout <= temp;
	end process;
end behave;
			

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -