Source: http://www.ee.ic.ac.uk/pcheung/teaching/de1_ee/Lectures/Lecture%2011%20-%20Logic%20gates%20and%20Boolean%20(x2).pdf