How this calculation works
Measure how many bit positions must change to turn one unsigned word into the other.
XOR the two words and count the one bitsA worked example
1100 and 1010 differ in two positions.
Good to know
Words are compared with leading zeros as needed.
Reference: NIST DLMF, Functions of Number Theory (opens in a new tab) ↗
Read the result
Measure how many bit positions must change to turn one unsigned word into the other.
The primary result is labeled “Differing bits”. Keep the input definitions in view when comparing this result with another method.
Try a related calculation
Words are compared with leading zeros as needed.
For a related exercise, try the greatest common divisor.
A few questions, answered
How can I check the default inputs by hand?
1100 and 1010 differ in two positions.
Which rule does this calculator apply?
XOR the two words and count the one bits