老古开发网首页
导航:老古开发网首页文章索引文章分类EDA/IC设计→[带莫尔/米勒输出的状态机]
| -文章搜索 - 最新文章 - |

带莫尔/米勒输出的状态机

发布时间:2006年8月5日 点击次数:706
来源:   作者:
 
-- State Machine with Moore and Mealy outputs
-- dowload from: www.fpga.com.cn & www.pld.com.cn


library ieee;
use ieee.std_logic_1164.all;

entity mealy1 is port(
        clk, rst:       in std_logic;
        id:             in std_logic_vector(3 downto 0);
        w:              out std_logic;
        y:              out std_logic_vector(1 downto 0));
end mealy1;

architecture archmealy1 of mealy1 is
        type states is (state0, state1, state2, state3, state4);
        signal state: states;
begin
moore: process (clk, rst)
        begin
                if rst=''1'' then
                        state <= state0;
                elsif (clk''event and clk=''1'') then
                        case state is
                                when state0 =>
                                        if id = x"3" then
                                                state <= state1;
                                        else
                                                state <= state0;
                                        end if;
                                when state1 =>
                                        state <= state2;
                                when state2 =>
                                        if id = x"7" then
                                                state <= state3;
                                        else
                                                state <= state2;
                                        end if;
                                when state3 =>
                                        if id < x"7" then
                                                state <= state0;
                                        elsif id = x"9" then
                                                state <= state4;
                                        else
                                                state <= state3;
                                        end if;
                                when state4 =>
                                        if id = x"b" then
                                                state <= state0;
                                        else
                                                state <= state4;
                                        end if;
                        end case;
                end if;
        end process;

--assign moore state outputs;
y <= "00" when (state=state0) else
     "10" when (state=state1 or state=state3) else
     "11";
--assign mealy output;
w <= ''0'' when (state=state3 and id < x"7") else
     ''1'';
end archmealy1;


欢迎进入老古论坛进行讨论
[EDA/IC设计] 相关文章:
共创时间同步协议解决方案,飞思卡尔与IXXAT携手同进
简介:
飞思卡尔半导体公司与领先的工业与汽车通信解决方案提供商IXXAT公司携手合作,为基Power Architecture 8482技术的PowerQUICC 8482通信处理器提供全面的IEEE 1588reg时间同步协议解决方案。为了展示双方的合作,IXXAT将在飞思卡尔技术论坛上演示在MPC8349E PowerQUICC II Pro处理器上运行的IEEE 1588协议。   IEEE 1588协议的目标应用包括对时间敏感的电信服务,这些服务要求通信节点之间的精确时间同......

嵌入式逻辑分析仪在FPGA设计中的应用
Geomagic 扩大在中国的经营:上海分公司成立
基于FPGA流水线分布式算法的FIR滤波器的实现(转)
赛普拉斯PSoC器件获青睐
ASIC设计中验证工具选择实例
[转载]基于CPLD的串并转换和高速USB通信设计
[转载]基于CPLD的容错存储器的设计实现
Protel 2004小知识 (转)
美国国家半导体推出四款驱动器及接收器
 
下一个:[单片机]全系列三极管应用参数
简介:
名 称 封装 极性 功 能 耐 压 电 流 功 率 频 率 配对管 D633 28 NPN 音频功放开关 100V 7A 40W 达林顿 9013 21 NPN 低频放大 50V 0.5A 0.625W 9012 9014 21 NPN 低噪放大 50V 0.1A 0.4W 150HMZ 9015 9015 21 PNP 低噪放大 50V 0.1A 0.4W 150MHZ 9014 9018 21 NPN 高频放大 30V 0.05A 0.4W 1000MHZ 8050 21 NPN ......
 

上一个:[行业观察]我国高压开关行业的最新发展述评

老古开发网版权所有 2006年9月 asp.Net V2.0 设计:老古
页面缓存:10分钟 执行时间:16毫秒