Answer by Poypoyan for Formulating the bitwise OR operation
The expression $$\left[\left(\left\lfloor\frac{x}{2^n}\right\rfloor\mod2\right)+\left(\left\lfloor\frac{y}{2^n}\right\rfloor \mod2\right)\right]\ \mod2$$will just compute $x\ XOR\ y$ instead of $x\ OR\...
View ArticleAnswer by paw88789 for Formulating the bitwise OR operation
You can OR two bits, say $b_1$ and $b_2$ by $$\rm{OR}(b_1, b_2)=(b_1+b_2+b_1\cdot b_2) \mod 2$$ You can check to see that with this formulation, if either or both are $1$, we get $1$; while if both are...
View ArticleFormulating the bitwise OR operation
Considering the bitwise OR operation, wikipedia states,$$x\;\mathrm{OR}\;y = \sum_{n=0}^b...
View Article
More Pages to Explore .....