Difference between revisions of "Bit.bor"

From ComputerCraft Wiki
Jump to: navigation, search
(0V0=0; 1V0=1; 0V1=1; 1V1=1;)
 
Line 1: Line 1:
  
 
== Explanation ==
 
== Explanation ==
<i>OR</i> outputs the sum of the two values(ex. (1,0)=1; (0,1)=1; (2,0)=2; (2,1)=3), unless they are equal in which it outputs the number. (ex. (0,0)=0; (1,1)=1; (2,2)=2; (3,3)=3)
+
All bit operations operate in Binary numeral system [http://en.wikipedia.org/wiki/Binary_numeral_system].
 +
 
 +
So if you understand the basics than OR is simple:
 +
----
 +
01001011 (75)
 +
----
 +
<i>OR</i>
 +
----
 +
00011000 (24)
 +
----
 +
<i>=</i>
 +
----
 +
01011011 (91)
 +
----
 +
 
 +
Bits are OR`red sequentially.

Revision as of 10:34, 28 February 2012

Explanation

All bit operations operate in Binary numeral system [1].

So if you understand the basics than OR is simple:


01001011 (75)


OR


00011000 (24)


=


01011011 (91)


Bits are OR`red sequentially.