ImageVerifierCode 换一换
格式:DOCX , 页数:16 ,大小:845.96KB ,
资源ID:2894533      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/2894533.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(EDA课程设计UART控制器设计.docx)为本站会员(b****3)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

EDA课程设计UART控制器设计.docx

1、EDA课程设计UART控制器设计波特率发生模块VHDL描述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; baud_set:in std_logic_vector(7 downto 0); baud_set_wr:in std_logic; bclk:out std_logic);end baud;architecture

2、 behav of baud is signal baud_count:std_logic_vector(7 downto 0); signal cnt:std_logic_vector(7 downto 0);beginprocess(clk) begin if clkevent and clk=1 then if (resetb=1) then cnt=00000001; bclk=0; elsif (baud_set_wr=1) then baud_count=baud_set; cnt=00000001; elsif (cnt=baud_count) then cnt=00000001

3、; bclk=1; else cnt=cnt+1; bclk=0; end if; end if;end process;end behav;UART发送模块VHDL描述library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;entity UART_Transfer is Port ( bclkt:in std_logic; resett:in std_logic; cmd_p:in std_logic; txdbuf:in std_logic_v

4、ector(7 downto 0); txd:out std_logic; txd_done:out std_logic);end UART_Transfer;architecture behav of UART_Transfer is type states is (s_idle,s_start,s_wait,s_shift,s_stop); signal state: states:=s_idle; signal tcnt: integer:=0; signal xcnt16: std_logic_vector(4 downto 0):=00000; signal prob: std_lo

5、gic_vector(4 downto 0);beginprocess(bclkt) variable xbitcnt:integer:=0; variable framlent:integer:=8; variable txds:std_logic; begin if(bclktevent and bclkt=1) then if(resett=1) then state=s_idle; txd_done if (cmd_p=1) then state=s_start; txd_done=0; else state=s_idle; txd_done if (xcnt16=01111) the

6、n txds:=0; state=s_wait; xcnt16=00000; else xcnt16=xcnt16+1; state if(xcnt16=01110) then if (xbitcnt=framlent) then state=s_stop; xbitcnt:=0; else state=s_shift; end if; xcnt16=00000; else xcnt16=xcnt16+1; state txds:=txdbuf(xbitcnt); xbitcnt:=xbitcnt+1; state if (xcnt16=01111) then if (cmd_p=0) the

7、n state=s_idle; xcnt16=00000; else xcnt16=xcnt16; state=s_stop; end if; txd_done=1; else xcnt16=xcnt16+1; txds:=1; statestate=s_idle; end case; end if; txd=txds; prob=xcnt16; end if;end process;end behav;UART接收模块VHDL描述library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std

8、_logic_unsigned.all;entity UART_Reciever isgeneric (framlenr:integer:=8); port( bclkr:in std_logic; resetr:in std_logic; rxdr:in std_logic; s_ready:out std_logic; rbuf:out std_logic_vector(7 downto 0);end UART_Reciever;architecture behav of UART_Reciever is type states is (s_start,s_center,s_wait,s_

9、sample,s_stop); signal state: states:=s_start; signal rxd_sync: std_logic;begin pro1:process(rxdr) begin if (rxdr=0) then rxd_sync=0; else rxd_sync=1; end if; end process; pro2:process(bclkr) variable count:std_logic_vector(3 downto 0); variable rcnt:integer:=0; variable rbufs: std_logic_vector(7 do

10、wnto 0); begin if (bclkrevent and bclkr=1) then if (resetr=1) then state if (rxd_sync=0) then state=s_center; s_ready=0; rcnt:=0; else state=s_start; s_ready if (rxd_sync=0) then if (count=1000) then state=s_wait; count:=0000; else count:=count+1; state=s_center; end if; else state if (count=1110) t

11、hen if (rcnt=framlenr) then state=s_stop; else state=s_sample; end if; count:=0000; else count:=count+1; state rbufs(rcnt):=rxd_sync; rcnt:=rcnt+1; state s_ready=1; rbuf=rbufs; state state=s_start; end case; end if;end if;end process;end behav;UART顶层模块VHDL描述library ieee;use ieee.std_logic_1164.all;u

12、se ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;entity top isport( clk:in std_logic; reset:in std_logic; rxd:in std_logic; xmit_cmd_p_in:in std_logic; baud_set_wr:in std_logic; rec_ready:out std_logic; txd_out:out std_logic; txd_done_out:out std_logic; baud_set:in std_logic_vector(7 down

13、to 0); txdbuf_in:in std_logic_vector(7 downto 0); rec_buf:out std_logic_vector(7 downto 0);end top;architecture behav of top iscomponent UART_Receiver port( bclkr:in std_logic; resetr:in std_logic; rxdr:in std_logic; r_ready:out std_logic; rbuf:out std_logic_vector(7 downto 0);end component;component UART_Transfer Port ( bclkt:in std_logic; resett:in std_logic; xmit_cmd_p:i

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1