正在加载图片...
e.g. 1 T-bird Tail Lights e.91 T-bird Tail Lights(筒化的状态 ◆状态图完善2 ◆状态方程 意完备性! ●一有可能就进 Q=2212。(HA2+Rig 入告警模式 +Q2Q·HLAz+Q2Q 较安全 LR. ●状态图修改2 c"=g2Q1HAz·(Lef⊕Rghr L+R+H Idl H+LR +0,Q- HAZ L∵R,H ◆转换为激励方程 ◆逻辑电路 VHDL for theT-bird Tail Lights VHDL(Cont, oess(CLOCK) Use IEEE std_logic_1164.all Entity Abird is SET =1"then Lights < IDLE: else /End: HTS: buffer st L en, Right, HAz in Std LLC LB LARARBRI s when IDLE = If HAZ=1or(Left=" and Right='1) the Vbird arch of vtbird is 日G比 ⊥ Logic Vector(1to6) when L2 = > if HAZ='1 then Lights <= LR3; else Lights c L3: end if: nnnnm tO 油面RHA下比c比R比R LR3 => LIGHTS <E IDLE. Constant LR3 Std Logic Vector (1 to 6) ="111111. 小 eg2猜谜游戏 ◆完全描述的同步时序电路 ◆同步状态机 ● ●确定状态图 ·4个按钮,与输入G1~G4联接 1个ERR输出,与红色指示灯联扫 ◆非完全描述的同步时序电路 ·4个输出,与指示灯L1-L4联接,并与对应输入相邻 ●确定状态图 ◆功能 按设计需求,更改状态图,确定合理的状态转移 ●正常情况下,每经过1个时钟,模式旋转1个位置 >最小风险:使成为全喷定的状态图 ●时钟频率4Hz 最小成本:使成为光全确定的状态图 ●猜谜:按下1个按钮,某输 时钟触发沿到来前有效的灯 效,未能猜中:若相同为猜中。一旦 停止并且ERR输出会维持1个或多个时钟周期,直到输 入G取消,游戏继续进行2 10 e.g.1 T-bird Tail Lights ‹状态图完善2 z一有可能就进 入告警模式比 较安全 z状态图修改2 LR3 L⋅R’⋅H’ Idle R1 R2 R3 L1 L2 L3 1 1 1 1 1 1 1 H+L⋅R L’⋅R⋅H’ (L+R+H)’ H H H H H’ H’ H’ H’ 12 e.g.1 T-bird Tail Lights ‹状态方程 ‹转换为激励方程 ‹逻辑电路… 1 2 210 2 0 20 ( ) n Q Q Q Q HAZ Right Q Q HAZ Q Q + = ⋅⋅⋅ + +⋅⋅ +⋅ Q Q HAZ n = ⋅ + 0 1 1 1 0 21 1 0 ( ) n Q Q Q HAZ Left Right Q Q HAZ + = ⋅⋅ ⋅ ⊕ +⋅⋅ 简化的状态 转移表 注意完备性! 13 VHDL for theT-bird Tail Lights Library IEEE; Use IEEE.std_logic_1164.all; Entity Vtbird is port ( Clock, Reset, Left, Right, HAZ: in Std_Logic; LIGHTS: buffer Std_Logic _Vector (1 to 6) ); --LC LB LA RA RB RC End; Architecture Vtbird_arch of Vtbird is Constant Idle : Std_Logic _Vector (1 to 6) := "000000"; Constant L1 : Std_Logic _Vector (1 to 6) := “001000"; Constant L2 : Std_Logic _Vector (1 to 6) := “011000"; Constant L3 : Std_Logic _Vector (1 to 6) := "111000"; Constant R1 : Std_Logic _Vector (1 to 6) := "000100"; Constant R2 : Std_Logic _Vector (1 to 6) := "000110"; Constant R3 : Std_Logic _Vector (1 to 6) := "000111"; Constant LR3 : Std_Logic _Vector (1 to 6) := "111111"; 14 VHDL(Cont.) VHDL(Cont.) Begin Process (CLOCK) Begin If CLOCK'event and CLOCK = '1' then If RESET = '1' then Lights <= IDLE; else Case Lights is when IDLE => If HAZ='1' or (Left='1' and Right='1') then Lights <= LR3; Elsif Left ='1' then Lights <= L1; Elsif Right ='1' then Lights <= R1; End if; when L1 => if HAZ='1' then Lights <= LR3; else Lights <= L2; end if; when L2 => if HAZ='1' then Lights <= LR3; else Lights <= L3; end if; when L3 => LIGHTS <= IDLE; when R1 => if HAZ='1' then Lights <= LR3; else Lights <= R2; end if; when R2 => if HAZ='1' then Lights <= LR3; else Lights <= R3; end if; when R3 => LIGHTS <= IDLE; when LR3 => LIGHTS <= IDLE; when others => null; End case; End if; End if; End process; End Vtbird_arch; LR3 L⋅R’⋅H’ Idle R1 R2 R3 L1 L2 L3 1 1 1 H+L⋅R L’⋅R⋅H’ (L+R+H)’ H H H H H’ H’ H’ H’ LR3 L⋅R’⋅H’ Idle R1 R2 R3 L1 L2 L3 1 1 1 H+L⋅R L’⋅R⋅H’ (L+R+H)’ H H H H H’ H’ H’ H’ 15 小结 ‹完全描述的同步时序电路 z确定状态图 ‹非完全描述的同步时序电路 z确定状态图 z按设计需求,更改状态图,确定合理的状态转移 ¾最小风险:使成为完全确定的状态图 ¾最小成本: 使成为完全确定的状态图 16 e.g.2 猜谜游戏 ‹同步状态机 z 4个按钮,与输入G1~G4联接 z 1个ERR输出,与红色指示灯联接 z 4个输出,与指示灯L1~L4联接,并与对应输入相邻 ‹功能 z 正常情况下,每经过1个时钟,模式旋转1个位置 z 时钟频率4Hz z 猜谜:按下1个按钮,某输入Gi 有效;若当前输入数Gi 与 时钟触发沿到来前有效的灯输出(状态)不同,则ERR有 效,未能猜中;若相同为猜中。一旦完成1次猜测,游戏 停止并且ERR输出会维持1个或多个时钟周期,直到输 入Gi 取消,游戏继续进行 G1 G2 G3 G4 L1 L2 L3 L4 ERR
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有