Presentation is loading. Please wait.

Presentation is loading. Please wait.

Logic Circuits …or what a chip is made of.

Similar presentations


Presentation on theme: "Logic Circuits …or what a chip is made of."— Presentation transcript:

1 Logic Circuits …or what a chip is made of

2 Combining Logic Gates By combining the logic gates we have looked at, we can create circuits to implement all the arithmetic and logical operations a CPU performs The logic gate is at the heart of the computer; without it, we wouldn’t have computers! CS10110 December 2011

3 Combining Logic Gates 1 C B A (A•B)+C (A•B)+C
(A•B)+C C B A (A•B)+C Note: Although AND (•) takes precedence over OR (+), we use brackets anyway to avoid any confusion CS10110 December 2011

4 A note on Precedence In mathematics, we have precedence (×,,+,–)
Similarly, we have precedence in digital logic: NOT, AND, OR So A•B+C should be interpreted as ((NOT A) •B)+C To avoid ambiguity, we would in any case write (A•B)+C CS10110 December 2011

5 DeMorgan’s Theorem Consider the following circuit 1 Y B A A•B
Y B A A•B What do you notice? CS10110 December 2011

6 DeMorgan’s Theorem A•B = A+B A+B = A•B
This is a very useful rule to remember when trying to simplify a complex logic circuit We don’t need an AND gate, because we can construct one using NOR and NOT gates. We don’t need an OR gate, because we can construct one with NAND and NOT gates CS10110 December 2011

7 Doing away with Gates We know we don’t need an OR or an AND gate, because we can construct them from NOR, NAND and NOT gates. But… No not that Gates (even if you would like to!) – I mean logic gates  Both these implement a NOT gate using a NAND gate, and a NOR gate CS10110 December 2011

8 NAND and NOR So all we need is NAND and NOR.
But if we can construct an OR from NAND gates, we can construct a NOR too (simply by inverting the output, as on previous slide) Similarly for constructing a NAND from NOR gates So we only need one type of gate; either a NAND or a NOR gate. We can then construct any logic circuit we want CS10110 December 2011

9 Why use only one or two gates?
There is a good reason why we should only want to use one or two types of gate: we don’t just to this to make logic complicated to learn! It is easier to manufacture chips with only one or two types of gate on them CS10110 December 2011

10 Other Simplifications
(A•B)+B = B (A•B)+B = A+B (A+B)•B = B (A+B)•B = A•B (A•B)+(B•C) = B•(A+C) (A+B)•(B+C) = B+(A•C) Note: sometimes the • (AND) symbol is omitted, so AB is the same as A•B There are more, but this should be sufficient Think about them if in doubt – they do make sense! Try writing out a truth table if you’re still not convinced. CS10110 December 2011

11 More complex circuits This is from a previous examination paper. Can you work out an expression for Y0…Y4? Do it one at a time… Y0 = A AND B Y1 = B OR C Y2 = (A AND B) OR (NOT B) which is the same as A OR (NOT B) (from 3rd rule on previous slide) Y3 = (B OR C) AND (NOT B) which is the same as (NOT B) AND C (from 4th rule on previous slide) Y4 = NOT(Y2 OR Y3) = NOT ((A OR (NOT B)) OR ((NOT B) AND C)) = NOT (A OR (NOT B)) AND NOT ((NOT B) AND C) (by DeMorgan) = (NOT A) AND B AND (B OR (NOT C)) = (NOT A) AND B (by 3rd rule on previous slide) Note: this means the lines connect here. If there is not a dot, the lines do not connect, but pass over one another CS10110 December 2011

12 That’s it! If you can work your way through the values of Y0 to Y4 on the previous slide, and write out expressions for them, you’ve conquered logic circuits (as far as we’re concerned, anyway!) Try some circuits out! Great simulator: (if you’re suffering from worksheet withdrawal, there’s one for you!) CS10110 December 2011


Download ppt "Logic Circuits …or what a chip is made of."

Similar presentations


Ads by Google