Download presentation
Presentation is loading. Please wait.
Published byKorbin Dobkin Modified over 9 years ago
1
1 Design a state machine to display a character of string HELLO using a seven segment display How many state we need? –Five, one for each character –In state S0 (000) we display H –In state S1 (001) we display E –In state S2 (010) we display L –In state S3 (011) we display L –In state S4 (100) we display O State transitions are S0 -> S1 S1 -> S2 S2 -> S3 S3 -> S4 S4 -> S5 Another Example
2
2 Example (contd.) Next State and Output logic tables are CurNextStateOutput 0 0 00 0 10 0 00 1 1 0 1 1 1 0 0 10 1 00 0 11 0 0 1 1 1 1 0 1 00 1 10 1 00 0 0 1 1 1 0 0 1 11 0 00 1 10 0 0 1 1 1 0 1 0 00 0 01 0 01 1 1 1 1 1 0 S0S1S2S3 S4
3
3 Moore State Machine Diagram y !y y yy s3 0 s2 1 s1 1 s0 0
4
4 SUBDESIGN moore1 ( clk, reset, y: INPUT; z: OUTPUT; ) VARIABLE% currentcurrent % % stateoutput % ss :MACHINE OF BITS (z) WITH STATES ( s0= 0, s1= 1, s2= 1, s3= 0); BEGIN ss.clk = clk; ss.reset = reset; TABLE %currentcurrentnext% %stateinputstate% ss,y=>ss; s0,0=>s0; s0,1=>s2; s1,0=>s0; s1,1=>s2; s2,0=>s2; s2,1=>s3; s3,0=>s3; s3,1=>s1; END TABLE; END; Moore machine in AHDL
5
5 Mealy State Machine Diagram 0/0 y 1/1 0/1 1/11/0 0/0 s2 s1 s3 s0
6
6 Mealy Machine in AHDL SUBDESIGN mealy ( clk, reset, y: INPUT; z: OUTPUT; ) VARIABLE ss :MACHINE WITH STATES (s0, s1, s2, s3); zd :NODE; BEGIN ss.clk = clk; ss.reset = reset; TABLE %currentcurrentcurrentnext% %stateinputoutputstate% ss,y=>z,ss; s0,0=>0,s0; s0,1=>1,s1; s1,0=>1,s1; s1,1=>0,s2; s2,0=>0,s2; s2,1=>1,s3; s3,0=>0,s3; s3,1=>1,s0; END TABLE; END;
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.