2. First, it is clear that 0x000 1 stands for 16 binary number 1, and 0x00 10 stands for 16 binary number 2. X=0x000 1, x|=0x00 10, that is, x=0x000 1|0x00 10, and the bitwise or result is 0x001.
Extended data:
Boolean used mathematical methods to study logical problems and successfully established logical calculus. He used equality to express his judgment and regarded reasoning as the transformation of equality. The effectiveness of this transformation does not depend on people's interpretation of symbols, but only on the combination law of symbols. This logic theory is usually called Boolean algebra.
In 1930s, logic algebra was applied to circuit systems. Subsequently, due to the development of electronic technology and computer, various complex large-scale systems appeared, and their transformation laws also followed the law revealed by Boolean.
The typical usage of bitwise OR operation is to change some positions of a bit string information into 1. Similarly, the typical usage of bitwise OR operation is clear. If you want to clear a cell, even if all its binary bits are 0, as long as it is combined with a value of 0, the result is 0.
Baidu Encyclopedia-Boolean Operation