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

📄 baud.vhd

📁 一种实现计算机接口rs232与FPGA通信的基于VHDL语言设计的一段非常简洁的程序
💻 VHD
字号:
--------------------------------------------------------------------------------
-- Company: 
-- Engineer:
--
-- Create Date:    17:38:37 03/13/09
-- Design Name:    
-- Module Name:    baud - Behavioral
-- Project Name:   
-- Target Device:  
-- Tool versions:  
-- Description:
--
-- Dependencies:
-- 
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
-- 
--------------------------------------------------------------------------------
--说明:由一个分频器组成,将外部输入的32MHz的信号分成频率为153600Hz的信号
--最后修改时间:2003年7月10日
--===============================================================================
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
 
entity baud is
    Port (clk	 :in std_logic;
	       resetb:in std_logic;
          bclk  :out std_logic);
end baud;
 
architecture behavioral of baud is

signal bclkout:std_logic;

begin
process(clk,resetb)
variable cnt:integer;
begin
  if resetb='1' then                                         -- resetb='1'时复位
     cnt:=0; bclkout<='0';
  elsif rising_edge(clk) then
     if cnt>=1 then cnt:=0; bclkout<=not bclkout;                        --设置分频系数
         else cnt:=cnt+1;
         end if;
  end if;
end process;
bclk<=bclkout;
end behavioral;

⌨️ 快捷键说明

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