I remember taking a course in college on digital logic. I wanted a light to blink on and off, so I toggled it every clock. Of course that's just a dim light, because lights toggle on and off very fast normally when they're on.
But how do you then explain the button on my FPGA that was not used in my Verilog anywhere that could switch the light off?
I think the answer ended up being that it was switching fast enough that small amounts of leakage current was enough to register as a TRUE value. And that 'undefined behavior' is worse than in C.
There's a (decade old+) paper on using genetic algorithms to design an FPGA for discriminating tones. The final design after hundreds of generations? The input wasn't connected to the output! It relied on physical details and even iirc stopped working as the FPGA temperature rose.
I've seen a similar paper quoted in one of the books on my shelf talking about a really long chain of logic gates that evolved in an FPGA for some physically situated agent (aka, robot). The chain couldn't be doing anything from a discrete logic point of view, so they got rid of it to "improve the final design". But once they did, the robot couldn't perform it's task anymore. Turned out the chain was being used as an antenna and was pumping RF information into the chip in order to help accomplish it's task.
But how do you then explain the button on my FPGA that was not used in my Verilog anywhere that could switch the light off?
I think the answer ended up being that it was switching fast enough that small amounts of leakage current was enough to register as a TRUE value. And that 'undefined behavior' is worse than in C.