Hacker News new | ask | show | jobs
by aappleby 842 days ago
For loops are one of those things that just don't really exist in hardware.

The way I like to think of hardware is as a machine that takes a giant blob of state, applies a pure function to it, and when the clock goes from low to high it replaces the original state with the new one and the process starts again.

1 comments

> For loops are one of those things that just don't really exist in hardware.

Hardware for loops are just fine if you think of a for loop as existing in space rather than time--effectively it is always fully unrolled.

> The way I like to think of hardware is as a machine that takes a giant blob of state, applies a pure function to it, and when the clock goes from low to high it replaces the original state with the new one and the process starts again.

That's the way hardware guys think of it, too. :)

https://en.wikipedia.org/wiki/Mealy_machine