77范文网 - 专业文章范例文档资料分享平台

异步串行接口电路及通信系统设计设计报告(6)

来源:网络收集 时间:2019-01-10 下载这篇文档 手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:或QQ: 处理(尽可能给您提供完整文档),感谢您的支持与谅解。点击这里给我发消息

异步串行接口电路及通信系统设计

八、附录

附录Ⅰ:任务分工

资料查找 程序编辑及调试 答辩PPT制作 设计报告撰写

邹燕、孙显珑、姚超、颜利娟 邹燕、姚超、孙显珑、王静 姚超 孙显珑、邹燕、姚超、颜利娟 附录Ⅱ:程序

325分频: library ieee;

use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all;

entity clkdiv325 is port(

clk:in std_logic; clkout: out std_logic ); end clkdiv325;

architecture one of clkdiv325 is signal cnt:integer:=0; begin

process(clk) begin

if(clk'event and clk='1')then if cnt=324 then cnt<=0; else cnt<=cnt+1;end if; if cnt>=162 then clkout<='1'; else clkout<='0';end if; end if; end process; end one;

20

异步串行接口电路及通信系统设计

地址模块 library ieee;

use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all;

entity adress1 is

port(clk:in std_logic;

data:in std_logic_vector(7 downto 0); adress:out std_logic_vector(7 downto 0)); end adress1;

architecture bav of adress1 is

signal cnt:std_logic_vector(7 downto 0); signal cnt1:std_logic:='0'; begin

process(clk) begin

if data=\ case cnt1 is

when '1' => if clk'event and clk='1' then

if cnt>=255 then cnt<=\ else cnt<=cnt+1; end if; end if; when others =>null; end case; end if; end process; adress<=cnt; end bav;

rom模块

LIBRARY ieee;

USE ieee.std_logic_1164.all;

LIBRARY altera_mf; USE altera_mf.all;

ENTITY rom123 IS PORT ( address : IN STD_LOGIC_VECTOR (7 DOWNTO 0);

21

异步串行接口电路及通信系统设计

clock : IN STD_LOGIC ; q : OUT STD_LOGIC_VECTOR (7 DOWNTO 0) );

END rom123;

ARCHITECTURE SYN OF rom123 IS

SIGNAL sub_wire0 : STD_LOGIC_VECTOR (7 DOWNTO 0);

COMPONENT altsyncram GENERIC ( clock_enable_input_a : STRING; clock_enable_output_a : STRING; init_file : STRING; intended_device_family : STRING; lpm_hint : STRING; lpm_type : STRING; numwords_a : NATURAL; operation_mode : STRING; outdata_aclr_a : STRING; outdata_reg_a : STRING; widthad_a : NATURAL; width_a : NATURAL; width_byteena_a : NATURAL );

PORT ( clock0 : IN STD_LOGIC ; address_a : IN STD_LOGIC_VECTOR (7 DOWNTO 0); q_a : OUT STD_LOGIC_VECTOR (7 DOWNTO 0) );

END COMPONENT; BEGIN

q <= sub_wire0(7 DOWNTO 0);

altsyncram_component : altsyncram GENERIC MAP ( clock_enable_input_a => \ clock_enable_output_a => \ init_file => \ intended_device_family => \ lpm_hint => \ lpm_type => \ numwords_a => 256, operation_mode => \ outdata_aclr_a => \

22

异步串行接口电路及通信系统设计

outdata_reg_a => \ widthad_a => 8, width_a => 8, width_byteena_a => 1 )

PORT MAP ( clock0 => clock, address_a => address, q_a => sub_wire0 );

END SYN;

uart接收模块 library ieee;

use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all;

entity dyzrx is

port(clk:in std_logic; rx: in std_logic;

dataout:out std_logic_vector(7 downto 0); rdsig: out std_logic ); end dyzrx;

architecture one of dyzrx is

signal dataoutreg:std_logic_vector(7 downto 0); signal rdsigreg: std_logic;

signal cnt:std_logic_vector(7 downto 0); signal rxbuf:std_logic; signal rxfall:std_logic; signal receive:std_logic; signal idle:std_logic; begin

process(clk) begin

if(clk'event and clk='1')then rxbuf<=rx;

if (rxbuf='1' and rx='0')then rxfall<='1'; else

23

异步串行接口电路及通信系统设计

rxfall<='0'; end if; end if; end process;

process(clk) begin

if(clk'event and clk='1')then if(rxfall='1' and idle='0' ) then receive<='1';

elsif (cnt=\ receive<='0'; end if; end if;

end process;

process(clk) begin

if(clk'event and clk='1')then if(receive='1')then case cnt is

when \ idle<='1'; cnt<=cnt+'1'; rdsig<='0'; when \ idle<='1';

dataout(0)<=rx; cnt<=cnt+'1'; rdsig<='0'; when \ idle<='1';

dataout(1)<=rx; cnt<=cnt+'1'; rdsig<='0'; when \ idle<='1';

dataout(2)<=rx; cnt<=cnt+'1'; rdsig<='0'; when \ idle<='1';

dataout(3)<=rx; cnt<=cnt+'1';

24

百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库异步串行接口电路及通信系统设计设计报告(6)在线全文阅读。

异步串行接口电路及通信系统设计设计报告(6).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印 下载失败或者文档不完整,请联系客服人员解决!
本文链接:https://www.77cn.com.cn/wenku/zonghe/419742.html(转载请注明文章来源)
Copyright © 2008-2022 免费范文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ: 邮箱:tiandhx2@hotmail.com
苏ICP备16052595号-18
× 注册会员免费下载(下载后可以自由复制和排版)
注册会员下载
全站内容免费自由复制
注册会员下载
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: