1 gcse computing binary logic. gcse computing 2 candidates should be able to understand and produce...

Post on 21-Jan-2016

217 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

1

GCSE Computing

Binary Logic

GCSE Computing2

Candidates should be able to understand and produce simple logic diagrams using the operations NOT, AND, OR

GCSE Computing

Learning Objectives:Learning Objectives:

GCSE Computing3

The simplified AND gate shown above has two inputs, switch A and switch B. The bulb Q will only light if both switch A AND B are closed. This will allow current to flow through the bulb, illuminating the filament.

GCSE Computing4

The simplified OR gate shown above has two inputs, switch A and switch B. The bulb Q will light if either switch A OR B are closed. This will allow current to flow through the bulb, illuminating the filament.

GCSE Computing

The logic in used in computer systems is called Boolean logic because there are only 2 possible values, TRUE or FALSE (represented in binary as 1 or 0).

GCSE Computing

Students taking Computing are in set AStudents taking Media are in set B

ComputingComputingMediaMedia

GCSE Computing

Students taking Computing AND Media are in the intersection of set A AND set B

GCSE Computing

Students taking Computing OR Media are in the combination of set A OR set B

GCSE Computing

Students NOT taking Computing

ComputingComputing

GCSE Computing

A AND B – True if and only if both A and B are true. This gate has 2 inputs and 1 output.

A OR B – True if A is true, or B is true, or both. This gate has 2 inputs and 1 output.

NOT A - True if A is false. This gate has 1 input and 1 output

..

ANDAND OROR NOTNOTBB BB

AA AA

AA

GCSE Computing

Use http://logic.ly/demo/ to demonstrate switching of inputs and outputs for AND/OR/NOT gates.

GCSE Computing

Worksheet 1: Truth Tables - To produce a truth table you need to work out the outputs for every possible combination.

A Q

0

1

AA QQ

A B Q

0 0

0 1

1 0

1 1

AA

BBQQ

A B Q

0 0

0 1

1 0

1 1

NOTNOT

OROR

AA

BBQQ ANDAND

GCSE Computing

Logic circuits can be combined. Start with some simple examples. For each example work through the circuit one gate at a time from input to output working out the truth table and the Boolean algebra for each intermediate stage.

A B C Q

0 0 0

0 1 0

1 0 0

1 1 1

A AND B = CNOT C = Q

NOT(A AND B) = Q

A AND B = CNOT C = Q

NOT(A AND B) = Q

A B C Q

0 0 1

0 1 0

1 0 1

1 1 0

NOT A = CC AND B = Q

(NOT A) AND B = Q

NOT A = CC AND B = Q

(NOT A) AND B = Q

GCSE Computing

If a logic diagram has only 2 inputs then there will only be 4 combinations of inputs (00, 01, 10 and 11) but 3 inputs would give 8 possible combinations and 4 inputs would give 16 combinations.

For example, for the following logic diagram, there are 3 inputs, so there are 2^3 (8) combinations.

D = NOT(A OR B)E = B AND CQ = E OR D

Q = (B AND C) OR (NOT(A OR B))

D = NOT(A OR B)E = B AND CQ = E OR D

Q = (B AND C) OR (NOT(A OR B))

A B C D E Q

0 0 0 1 0 1

0 0 1 1 0 1

0 1 0 0 0 0

0 1 1 0 1 1

1 0 0 0 0 0

1 0 1 0 0 0

1 1 0 0 0 0

1 1 1 0 1 1

GCSE Computing

This circuit adds two bits. It has 2 outputs: the sum and the carry bit. It is called a half adder. This is a very important point as it explains the purpose of learning about logic gates. They are used to build circuits that perform arithmetic in a processor.

Carry = A AND BE = NOT(A AND B)

D = AOR BSum = ( AOR B) AND

( NOT(A AND B))

Carry = A AND BE = NOT(A AND B)

D = AOR BSum = ( AOR B) AND

( NOT(A AND B))

A B D E S C

0 0 0 1 0 0

0 1 1 1 1 0

1 0 1 1 1 0

1 1 1 0 0 1

GCSE Computing

Useful Links

Royal Institution – All very logical

http://www.rigb.org/christmaslectures08/html/activities/all-very-logical.pdf#page=1Youtube - Logic gates using toys

http://www.youtube.com/watch?gl=GB&hl=en-GB&v=H-53TVR9EOwHow are logic gates made?

http://www.technologystudent.com/elec1/dig2.htm

16

GCSE Computing

GCSE Computing

A combination of NAND gates can be used to simulate any other gate. This is an OR gate. Many logic circuits are built entirely out of NAND gates because they are cheap to produce. This also demonstrates De Morgan’s Law.

C = NOT AD = NOT B

NOT (C AND D) = QNOT(NOT A AND NOT B) = Q

A B C D Q

0 0 1 1 0

0 1 1 0 1

1 0 0 1 1

1 1 0 0 1

top related