I'm writing some code in Verilog with a 6502 soft core. After not getting the results I expected, I realized the problem was that I needed to reset the 6502 (by asserting the reset line for 2 cycles) before it would start working.
This got me thinking: How do digital logic circuits know they've been powered on for the first time and that it's time to initialize? In other words, if the 6502 isn't smart enough to realize that it's been powered on and should start processing, how does the thing that resets the 6502 know?
Are flip-flops guaranteed to be zero when power is applied? Can the hardware check some "initialized" flip-flop for zero?
Could the hardware use an RC circuit to detect the power-on event by allowing to detect an initial 0 volts and then eventually some threshold voltage as the capacitor charges?