云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > 毕业论文:基于FPGA的串口设计-精品

毕业论文:基于FPGA的串口设计-精品

  • 62 次阅读
  • 3 次下载
  • 2025/5/23 5:11:28

附录

附录3 3 主要程序 (1)主程序

library ieee;

use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; entity top is

port(clk32mhz,reset,rxd,xmit_cmd_p_in:in std_logic; —总的输入输出信号的定义

第47页 (共37页)

基于FPGA的串口设计

rec_ready,txd_out,txd_done_out:out std_logic;

txdbuf_in :in std_logic_vector(7 downto 0); —待发送数据输入 rec_buf:out std_logic_vector(7 downto 0)); —接收数据缓冲 end top;

architecture Behavioral of top is component reciever

port(bclkr,resetr,rxdr:in std_logic; r_ready:out std_logic;

rbuf: out std_logic_vector(7 downto 0)); end component; component transfer

port(bclkt,resett,xmit_cmd_p:in std_logic; txdbuf:std_logic_vector(7 downto 0); txd:out std_logic; txd_done:out std_logic); end component; component baud

Port (clk,resetb:in std_logic; bclk:out std_logic); end component; signal b:std_logic; begin

u1:baud port map(clk=>clk32mhz,resetb=>reset,bclk=>b); 第 48 页 共 40 页

—顶层映射

附录

u2:reciever port map(bclkr=>b,resetr=>reset,rxdr=>rxd,r_ready=>rec_ready, rbuf=>rec_buf);

u3:transfer

port map(bclkt=>b,resett=>reset,xmit_cmd_p=>xmit_cmd_p_in,txdbuf=>txdbuf_in, txd=>txd_out,txd_done=>txd_done_out); end Behavioral ;

(2)波特率发生器模块(baud.vhd)

library ieee;

use ieee.std_logic_1164.all; use ieee.numeric_std.all; use ieee.std_logic_unsigned.all; entity last is

port (resetb : in std_logic; clk: in std_logic; bclk: out std_logic); end last;

architecture cc of last is

signal clk_cnt : unsigned(3 downto 0); signal clk_bit : std_logic; begin

process(clk,resetb)

第49页 (共37页)

基于FPGA的串口设计

begin

if(resetb='1') then clk_cnt<=\clk_bit<='0';

elsif rising_edge(clk) then if (clk_cnt=4) then clk_cnt<=\clk_bit<=not clk_bit; else

clk_cnt<= clk_cnt+1; end if; end if; end process; bclk<=clk_bit; end cc;

(3)UART接收器(receiver.Vhd)

library ieee;

use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; entity reciever is

第 50 页 共 40 页

搜索更多关于: 毕业论文:基于FPGA的串口设计-精品 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

附录 附录3 3 主要程序 (1)主程序 library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; entity top is port(clk32mhz,reset,rxd,xmit_cmd_p_in:in std_logic; —总的输入输出信号的定义 第47页 (共37页) 基于FPGA的串口设计 rec_ready,txd_out,txd_done_out:out std_logic; txdbuf_in :in std_logic_

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com