GCSE Computing/Computing hardware/Introduction to Binary Logic/Logic Diagrams

= What you need to know =

= Introduction = A major part of a processor's job is making decisions and comparing values. It does this by what is called a logic gate: it takes (usually) two values, and outputs a value as a result. = Types of Logic Gate =

OR Gate
An OR gate takes two inputs. If either of them is on (has a high voltage) then the gate outputs a high voltage. Otherwise it outputs a low voltage.

AND Gate
An AND gate takes two inputs. If BOTH of them are on (has a high voltage) then the gate outputs a high voltage. Otherwise it outputs a low voltage.

= Example = In the diagram the AND gate outputs a low voltage (the light is off) because it needs BOTH values to be on. The OR gate outputs a high voltage (the light is on) because at least one input is on.

This diagram was made using the page at http://logic.ly/demo/ which gives you a chance to create your own combination. Go to that site and reproduce the diagram above. After you have done that change the inputs until you understand what causes the lights to go on and off. Make sure that you have tested all of these possibilities:
 * both inputs on,
 * both inputs off,
 * first on, second off,
 * first off, second on