Hex digit 0xF
has the binary representation 1111
. Anything that is &
with it will remain the same.
Hex digit 0x7
has this binary representation: 0111
. Anything that is &
with it will lost the first bit, or the first bit becomes zero.
In your first example, 0x5... & 0x7...
remains 0x5...
because 5
has binary represenation 0101
and the first bit is already 0
.
In your second example, 0x8... & 0x7...
changed to 0x0...
because 8
has binary representation 1000
and after setting the first bit to 0
we will have 0000
or hex digit 0x0
.