26、系统设计:从交通灯到日常设备的控制实现

系统设计:从交通灯到日常设备的控制实现

1. 有限和算法状态机方法的系统设计

在系统设计中,有限和算法状态机方法是一种重要的设计思路。以下是一段相关代码示例:

cnt:=0;
nst<=s5;
elsif (amount_temp>act_amount) then
    cnt:=0;
    nst<=s6;
else
    nst<=s1;
    cnt:=cnt+1;
end if;
when s5=>
    amo_vali_led<=’0’;
    item_deli_led<=’1’;
    item_deliv_cntl<=item_sel;
    bal_deliv<=balance_temp(2 downto 0);
    if (balance_temp/="000") then
        bala_buzzer      <=’1’;
    else
        bala_buzzer      <=’0’;
    end if;
    nst<=s0;
when s6=>
    amo_vali_led<=’0’;
    balance_temp<=(amount_temp-act_amount);
    nst<=s5;
end case;
end process;
p3:process(m_clk,item_sel)
begin
    if rising_edge(m_clk) then
        case item_Sel is
            when "0000
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值