资源描述:
《EDA序列信号发生器与检测器设计》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、实验三序列信号发生器与检测器设计一、实验目的1.熟悉EDA技术开发流程;2.熟悉QuartesII集成开发软件的使用;3.初步熟悉PHJV型实验装置的使用;二、实验要求用状态机设计实现串序列检测器设计,可以用原理图输入法设计序列信号发生器,要求产牛序列:0111010011011010;再进行检测设计,若检测到序列:11010则输出为“1”,否则输出为“0”。并对其进行仿真和硬件测试。三、实验设计思路本实验可以分为两部分来设计,第一步设计序列信号发生器,在这里可以采用模16的计数器74LS161来产生模16的计数,并由它的4位输出可以产生16种状态,由此可以用来设计序列产生器,
2、也可以采用状态机产生序列,本实验用状态机产生序列。第二步设计序列检测器,这里用状态机设计,如果为真输出1,为假输出为0;第三步设计串行转并行输出,将序列并行输出在LED管上显示。第四步是设计一个计数脉冲,记录出现所需要的序列的次数。第五步是将所有模块连接起来,构成一个完整的序列发生和检测设计器。四、实验程序1、序列发生器libraryieee;useieee.std_logic_1164.all;entityxulie_produceis—序列产生电路port(clk,reset:instd_logic;comb_outputs:outstd」ogic);~序列输出endxul
3、ie_produce;architecturebehavofxulie_produceistypefsm_stis(s0,sl,s2,s3,s4,s5,s6,s7,s8,s9,sl0,sll,sl2,sl3,sl4,sl5)r-状态设计signalcurrent_state,next_state:fsm_st;beginreg:process(reset,clk)—主控时序进程beginifreset=,l,thencurrent_state<=sO;elsifelk二Tandclk'eventthencurrent_statev二next_state;endif;endpro
4、cess;com:process(current_state)—主控组合进程begincasecurrentstateiswhensO=>comb_outputs<=,0,;next_statev二si;whensi=>comb_outputs<=,l,;next_state<=s2;whens2=>comb_outputs<=,l';next_state<=s3;whens3=>comb_outputs<='l,;next_state<=s4;whens4=>comb_outputs<=,0,;next_statev二s5;whens5=>comb_outputs<=,l,;
5、next_state<=s6;whens6=>comb_outputs<=,0';next_state<=s7;whens7=>comb_outputs<=,0,;next_state<=s8;whens8=>comb_outputs<='l';next_statev二s9;whens9=>comb_outputs<='l,;next_statev=slO;whenslO=>comb_outputs<=,0,;next_statev二sll;whensll=>comb_outputs<=,l,;next_statev二sl2;whensl2=>comb_outputs<=,l,
6、;next_state<=sl3;whensl3=>comb_outputs<=,0,;next_statev二sl4;whensl4=>comb_outputs<=,l,;next_statev二sl5;whensl5=>comb_outputs<=,0,;next_statev二sO;endcase;endprocess;endbehav;2、序列检测器libraryieee;useieee.std_logic_1164.all;entitys_machineis—序列检测电路port(clk,reset:instd_logic;state」nputs:instdjogic
7、;-状态转移控制comb_outputs:outstd_logic);检测结果输出ends_machine;architecturebehavofs_machineistypefsm_stis(s0,sl,s2,s3,s4,s5);signalcurrent_state7next_state:fsm_st;beginreg:process(reset,clk)主控时序进程beginifreset=,l,thencurrent_statev二sO;elsifclk='l'andclk'even