Skip to content

Instantly share code, notes, and snippets.

@Paebbels
Created January 8, 2015 17:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Paebbels/6a53a8aa91cec6998fe7 to your computer and use it in GitHub Desktop.
Save Paebbels/6a53a8aa91cec6998fe7 to your computer and use it in GitHub Desktop.
Mealy automate example
clock: clk
inputs: in
outputs: out
states: cs (current state); ns (next state)
process(clk)
cs <= ns
process(cs, in)
ns := cs
out := 0
case cs is
when S0:
if (in = 1):
ns := S1
out := 1
end
when S1:
ns := S0
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment