CPLD题库(5)

2018-12-27 17:25

end if; __end if ____; end process;

qb <= _reg8(0)___; ――输出最低位 end behav; 序列检测答案 library ieee;

use ieee.std_logic_1164.all; entity se is

port(din,clk,clr : in std_logic; ab : out std_logic); end se;

architecture behav of se is

type fsm_st is (s0,s1,s2,s3,s4); signal cstate,nstate : fsm_st; begin

reg:process(clr,clk) begin

if clr='1' then cstate <= s0; --ab <= '0'; elsif clk = '1' and clk'event then cstate <= nstate; end if; end process;

com:process(cstate,din) begin

case cstate is

when s0 => if din = '1' then nstate <= s1; else nstate <= s0; end if; ab <= '0';

when s1 => if din = '1' then nstate <= s2; else nstate <= s0; end if; ab <= '0';

when s2 => if din = '1' then nstate <= s2; else nstate <= s3; end if; ab <= '0';

when s3 => if din = '1' then nstate <= s4; else nstate <= s0; end if; ab <= '0';

when s4 => if din = '1' then nstate <= s1; else nstate <= s0; end if; ab <= '1'; end case; end process; end behav;


CPLD题库(5).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:基于Web 的在线考试系统设计与实现

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: