Correction to the previous revision: I forgot to apply the ones complement to a constant.  This didn't show in testing because the broken expression produced the same result in my tests as the correct expression.
Correction to the previous revision: I forgot to apply the ones complement
to a constant.  This didn't show in testing because the broken expression
produced the same result in my tests as the correct expression.

jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase