eda基于VHDL的序列检测器设计.docx
文本预览下载声明
课程报告基于VHDL的序列检测器设计课程名称 EDA技术实用教程姓名卢泽文李嘉阳吴炽扬学号200730530318200730530311200730530326专业电气工程及其自动化3班指导老师: 陈楚老师日期: 2010/12随着计算机的飞速发展,以计算机辅助设计为基础的电子设计自动化(EDA)技术已成为电子学领域的重要学科。EDA工具使电子电路和电子系统的设计产生了革命性的变化。序列检测器也称为串行数据检测器,它在数据通讯,雷达和遥测等领域中用于检测同步识别标志,是一种用来检测一组或多组序列信号的电路。本文输入的序列信号由自行设计的计数器和数据选择器组成的序列信号发生器提供。1.原理说明:序列检测器可用于检测一组或多组由二进制码组成的脉冲序列信号,当序列检测器连续收到一组串行二进制码后,如果这组码与检测器中预先设置的码相同,则输出1,否则输出0。由于这种检测的关键在于正确码的收到必须是连续的,这就要求检测器必须记住前一次的正确码及正确序列,知道在连续的检测中所收到的每一位码都与预置数的对应码相同。在检测过程中,任何一位不相等都将回到初始状态重新开始检测。2.实验程序设计及程序分析和主要模块的代码:library ieee;use ieee.std_logic_1164.all;entity schk is port(din,clk,clr:in std_logic; ab:out std_logic_vector(3 downto 0));end schk;architecture behav of schk is signal d:std_logic_vector(7 downto 0); signal q:integer range 0 to 8; type fsm_st is(s0,s1,s2,s3,s4,s5,s6,s7,s8); --数据类型定义,状态符号化signal current_state,next_state:fsm_st;begin d; --8位待检预置数 reg:process(clr,clk) --主控时序进程 begin if clr=1 then current_state=s0; elsif clk=1 and clkevent then current_state=next_state; end if; end process;com:process(current_state,din) --主控组合进程 begin case current_state is when s0=q=0; if din=0 then next_state=s0; else next_state=s1; end if; when s1=q=1; if din=0 then next_state=s0; else next_state=s2; end if; when s2=q=2; if din=0 then next_state=s0; else next_state=s3; end if; when s3=q=3; if din=1 then next_state=s0; else next_state=s4; end if; when s4=q=4; if din=1 then next_state=s0; else next_state=s5; end if; when s5=q=5; if din=0 then next_state=s0; else next_state=s6; end if; when s6=q=6; if din=1 then next_state=s0; else next_state=s7; end if; when s7=q=7; if din=0
显示全部