User manual
Blinky_state comments
▶
Idles for one second with both LEDs off. Turns the red LED on. After
two seconds turns on the green LED. After 3 more seconds turns
both off. Repeats.
▶
Uses an enum statement to define the states and a case statement to
select between states.
▶
The “present” and “next” paradigm is reasonably common. At least
one FPGA test uses “present” as a prefix as is done with “next”.
▶
The always_ff always loads the next value into the current. The
always_comb starts by setting the next values to their current
values. This is what makes the compiler synthesize registers.
▶
Perturbations abound. For example, the counter could be
incremented in the always_ff eliminating the need for a next
version and making the code slightly less verbose.
▶
Notice the lack of comments. This is often justified by stating that
the code is self documenting. Generally it’s considered good practice
to have some comments. You might be the one that has to maintain
the code.
EECS 452 – Fall 2014 Lecture 5 – Page 103/143 Tuesday – September 16, 2014