Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Basic stuff first:</p> <ul> <li>The only combination of bits that means false is 00000000 all the others mean true i.e: 00001000,01010101</li> <li>00000000 = 0(decimal), 00000001 = 2^0, 00000010 = 2^1, 00000100 = 2^2, …. ,10000000 = 2^7</li> <li><p>There is a big difference between the operands (&amp;&amp;, ||) and (&amp;,|) the first ones give the result of the logic operation between the two numbers, for example:</p> <p>00000000 &amp;&amp; 00000000 = false, </p> <p>01010101 &amp;&amp; 10101010 = true</p> <p>00001100 || 00000000 = true, </p> <p>00000000 || 00000000 = false</p> <p>The second pair makes a bitwise operation (the logic operation between each bit of the numbers):</p> <p>00000000 &amp; 00000000 = 00000000 = false</p> <p>00001111 &amp; 11110000 = 00000000 = false</p> <p>01010101 &amp; 10101001 = 00000001 = true </p> <p>00001111 | 11110000 = 11111111 = true</p> <p>00001100 | 00000011 = 00001111 = true</p></li> </ul> <hr> <p>To work with this and play with the bits, you only need to know some basic tricks:</p> <ul> <li>To set a bit to 1 you make the operation | with an octet that has a 1 in that position and ceros in the rest.</li> </ul> <p><strong>For example:</strong> we want the first bit of the octet A to be 1 we make: A|00000001 </p> <ul> <li>To set a bit to 0 you make the operation &amp; with an octet that has a 0 in that position and ones in the rest.</li> </ul> <p><strong>For example:</strong> we want the last bit of the octet A to be 0 we make: A&amp;01111111 </p> <ul> <li>To get the Boolean value that holds a bit you make the operation &amp; with an octet that has a 1 in that position and ceros in the rest.</li> </ul> <p><strong>For example:</strong> we want to see the value of the third bit of the octet A, we make: A&amp;00000100, if A was XXXXX1XX we get 00000100 = true and if A was XXXXX0XX we get 00000000 = false;</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload