title: How to make a bitwise NOR gate
body: <p>I'm trying to understand the code from <a href="https://stackoverflow.com/a/19197816/68587">an answer I received earlier today</a>:</p>
  
  <pre><code>a=0b01100001
  b=0b01100010
  
  bin((a ^ 0b11111111) &amp; (b ^ 0b11111111))
  </code></pre>
  
  <p>This is my understanding:</p>
  
  <ul>
  <li><code>bin</code> means that the result will be in binary form.</li>
  <li><code>a</code> is the processes going through the gate</li>
  <li><code>0b</code> means base 2 form</li>
  </ul>
  
  <p>Could someone explain the rest? I am confused about <code>11111111</code>. <code>&amp;</code> is the <strong>and</strong> gate (confused why this separates the two). And how would you change this to work for any other gate, e.g. XOR, NAND, or...?</p>