Ask HN: Detecting All Zero or All One Memory
One concept that occurred to me is that a section of memory that's all zeros or all ones would have a characteristic voltage signature. Anything in between would be somewhere in the middle, but nebulously so (since you'd be adding bits in a commutative way). So this instruction would say something like 0 if the section of memory is all zeros, 1 if it's all ones, and -1 if the voltage is intermediate.
Is this concept technically workable and has it been done before on some chip? I imagine hardware engineers use tricks like this all the time, but I haven't heard of a software instruction that does this. The closest thing I found was the C library function memcmp, though it handles arbitrary patterns so it probably doesn't take advantage of a trick like this.
Thanks for your feedback. :)
0 comments
[ 4.7 ms ] story [ 9.3 ms ] threadNo comments yet.