On Wed, May 5, 2021 at 6:56 PM Øyvind Teig <oyvind.t...@teigfam.net> wrote:
> hiPri is a disconnect message of a smoke detetector. loPri is a fire alarm. > If the disconnect hiPri is activated before (1 sec to 1 ns) or simulatenously > (same polling of "hw pins") as the alarm loPri there should be no alarm being > sent to the fire department. I think that if the correctness of some code depends on the ordering of external/random events within a single nanosecond or less then it's IMO probably never correct code. I started my professional life as a HW designer. (18yo college drop-out, only later migrated to writing SW.) What is quoted above is called a hazard[0]. The specifications of ICs have specifications about how much time must separate changes in inputs of a, for example, 7400 NAND gate for its output to be the negation of the boolean product of its inputs. Otherwise the output is allowed to be undefined. Not even just zero or one, but any (voltage) value in between might occur. In combination with the maximum time allowed for the gate to change and settle its output the specs allow for (at those times tedious, pencil and paper) calculation of propagation delays in complex circuits and detecting any hazards. Because hazards cause chaotic behavior that is seldomly intended or welcome, usually it's not correct/acceptable. Your "logic circuit" depicted above has a hazard. It should not be deployed until it is redesigned to be robust, ie. hazard-free. [0]: https://en.wikipedia.org/wiki/Hazard_(logic) -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAA40n-Vkt7-SZ1dtDF%3DKXWjxVUXj_Rk9Ha3qVgLVLPwmWok_7w%40mail.gmail.com.