1 / 118

Logic Circuits and Computer Architecture

Logic Circuits and Computer Architecture. Appendix A Digital Logic Circuits Part 1: Combinational Circuits and Minimization. Structured organization. Problem-oriented language level Assembly language level Operating system machine level Instruction set architecture level

asteed
Download Presentation

Logic Circuits and Computer Architecture

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Logic Circuits and Computer Architecture Appendix A Digital Logic Circuits Part 1: Combinational Circuits and Minimization Rev. 4.1 (2006-07) by Enrico Nardelli

  2. Structured organization • Problem-oriented language level • Assembly language level • Operating system machine level • Instruction set architecture level • Microarchitecture level • Digital logic level Abstraction lelvel Rev. 4.1 (2006-07) by Enrico Nardelli

  3. Digital Logic level • Digital circuits • Only two logical levels present (i.e., binary) • low/high voltage • Basic gates • AND, OR, NOT • Basic circuits • Combinational (without memory, stateless) • Sequential (with memory, state dependent behaviour) Rev. 4.1 (2006-07) by Enrico Nardelli

  4. Boolean Algebra • Variables: A, B, … • Domain of variables: 2 values • 1 or 0; Y or N; true or false; … • Fundamental Operations • AND, OR, NOT • Intended meaning (for humans - Laws of Thought) • AND: both inputs are true • OR: at least one input is true • NOT: negate the input • Named from George Boole Rev. 4.1 (2006-07) by Enrico Nardelli

  5. George Boole (1815-1864) An Investigation of the Laws of Thought, on Which are founded the Mathematical Theories of Logic and Probabilities (1854) Rev. 4.1 (2006-07) by Enrico Nardelli

  6. Claude Shannon (1916-2001) A Symbolic Analysis of Relay and Switching Circuits (1938) ENIAC (Electronic Numerical Integrator And Calculator) (1946) Rev. 4.1 (2006-07) by Enrico Nardelli

  7. Formal definition of functions (1) • By means of “truth tables” • Explicit representation of the output for all possible inputs Rev. 4.1 (2006-07) by Enrico Nardelli

  8. …truth table for a 3-variable function… f(A,B,C)= 1 if and only if at least 2 variables are equal to 1 Rev. 4.1 (2006-07) by Enrico Nardelli

  9. Formal definition of functions (2) • By means of “boolean equation” • boolean equation consists of: • variables • constants 0 and 1 • boolean operations (AND, OR, NOT) • parentheses M = OR( AND(NOT(A),NOT(B)), AND(A,B) ) Rev. 4.1 (2006-07) by Enrico Nardelli

  10. Boolean functions • Conventions • NOT (negation): NOT(A) = A’ = A • AND (conjunction): AND(A,B) = AB = A.B • OR (disjunction): OR(A,B) = A+B M = OR( AND(NOT(A),NOT(B)), AND(A,B) ) M = (((A)’(B)’) + (AB)) Rev. 4.1 (2006-07) by Enrico Nardelli

  11. Boolean Operator Precedence • The order of evaluation in boolean expression is: • Parentheses • NOT • AND • OR • Consequence: parantheses appear around OR expressions • Example: F=A(B+C)(C+D’) M = (((A)’(B)’) + (AB)) M = A’B’ + AB Rev. 4.1 (2006-07) by Enrico Nardelli

  12. NOT gate - the simplest one • NOT gate - inverts the signal If A is 0, X is 1 If A is 1, X is 0 • A NOT gate is also called an inverter Rev. 4.1 (2006-07) by Enrico Nardelli

  13. AND gate • Output is 1 if all inputs are 1 • In general, if the AND gate has N inputs, both input 1 AND input 2 AND … AND input N must be 1 for the output to be 1 • 2-input AND gate Rev. 4.1 (2006-07) by Enrico Nardelli

  14. OR gate • Output is 1 if at least one input is 1 • In general, if the OR gate has N inputs, input 1 OR input 2 OR … OR input N must be 1 for the output to be 1 • 2-input OR gate Rev. 4.1 (2006-07) by Enrico Nardelli

  15. A more complex example • 2-input “equivalence” circuit • The output is 1 if the inputs are the same • (i.e., both 0 or both 1) Truth table • Boolean function: M = A’B’ + AB Rev. 4.1 (2006-07) by Enrico Nardelli

  16. Formal definition of functions (3) • By means of logic circuits • Combination of logic gates joined by wires Rev. 4.1 (2006-07) by Enrico Nardelli

  17. Conventions for logic circuits Rev. 4.1 (2006-07) by Enrico Nardelli

  18. Exercise (1) • Write the truth table and the logic circuit for F = X + Y’Z Rev. 4.1 (2006-07) by Enrico Nardelli

  19. Truth table Rev. 4.1 (2006-07) by Enrico Nardelli

  20. Logic Circuit Rev. 4.1 (2006-07) by Enrico Nardelli

  21. Exercise (2) • Write the boolean function and its truth table for the following logic circuit Rev. 4.1 (2006-07) by Enrico Nardelli

  22. Function and Truth Table • F = Y’ + X’YZ’ + XY Rev. 4.1 (2006-07) by Enrico Nardelli

  23. Exercise (3) • Write the boolean function and its truth table for the following logic circuit Rev. 4.1 (2006-07) by Enrico Nardelli

  24. Function and Truth Table • F = X’YZ + X’YZ’ + XZ Rev. 4.1 (2006-07) by Enrico Nardelli

  25. Conversion between represent. • Circuit -> -> Boolean formula (left-to-right inspection) -> Truth table (explicit case-by-case computation) • Boolean formula -> -> Circuit (bottom-up construction) -> Truth table (explicit case-by-case evaluation) • Truth table -> -> Circuit (through boolean formula) -> Boolean formula (through canonical form – see later) Rev. 4.1 (2006-07) by Enrico Nardelli

  26. duality principle: any algebraic equality remains true when the operators OR and AND, and the elements 0 and 1 are interchanged Boolean Identities 1A = A 0+A = A Identity 0A = 0 1+A = 1 Null AA = A A+A = A Idempotent AA’ = 0 A+A’ = 1 Inverse AB = BA A+B = B+A Commutative (AB)C = A(BC) (A+B)+C = A+(B+C) Associative A+BC = (A+B)(A+C) A(B+C) = AB+AC Distributive A(A+B) = A A+AB = A Absorption (AB)’ = A’+B’ (A+B)’ = A’B’ De Morgan Rev. 4.1 (2006-07) by Enrico Nardelli

  27. Truth tables to verify De Morgan’s theorem Rev. 4.1 (2006-07) by Enrico Nardelli

  28. Remark Each equality remains true if you sobstitute any variable with any expression Examples (A+B)(A+CD’) = A + BCD’ (distributive) ((A+BC)(D+A))’ = (A+BC)’ + (D+A)’ (De Morgan) = A’ (BC)’ + D’A’ (De Morgan) = A’(B’+C’) + D’A’ Rev. 4.1 (2006-07) by Enrico Nardelli

  29. … algebraic manipulation… F = X’YZ + X’YZ’ + XZ (distributive) = X’Y(Z + Z’) + XZ (inverse) = X’Y 1 + XZ (identity) = X’Y + XZ Rev. 4.1 (2006-07) by Enrico Nardelli

  30. Boolean Algebra Vs Switching Algebra (1) A Boolean Algebra is a structure A = <A, +, · , ’, 0, 1> where • A is a set • + and · are binary operations • ‘ is a unary operation • 0, 1  A satisfying the following axioms (i) + and · are commutative (ii) 0 and 1 satisfy: a·1=a and a+0=a,  a A (iii) + and · distribute over each other (iv) for each element a A, there exists an element a’ A such that a + a’= 1 and a·a’=0 Rev. 4.1 (2006-07) by Enrico Nardelli

  31. Boolean Algebra Vs Switching algebra (2) Switching Algebra is the following boolean algebra A = <{0,1}, +, · , ’, 0, 1> Rev. 4.1 (2006-07) by Enrico Nardelli

  32. Observation Axioms (i)-(iv) can be used to prove all the other identities An example: Idempotent X + X = X X + X = (X + X)·1 (ii) = (X + X)(X + X’) (iv) = X + (X·X’) (iii) = X + 0 (iv) = X (ii) Rev. 4.1 (2006-07) by Enrico Nardelli

  33. De Morgan circuit equivalents • AND/OR can be interchanged if you invert the inputs and outputs bubble means inversion Rev. 4.1 (2006-07) by Enrico Nardelli

  34. NAND gate - the negation of AND • The opposite of the AND gate is the NAND gate (output is 0 if all inputs are 1) Truth table • Logic diagram Rev. 4.1 (2006-07) by Enrico Nardelli

  35. NOR gate - the negation of OR • The opposite of the OR gate is the NOR gate (output is 0 if any input is 1) Truth table • Logic diagram Rev. 4.1 (2006-07) by Enrico Nardelli

  36. Exercise • Write the truth table for: • a 3 input NAND gate • a 3 input NOR gate Rev. 4.1 (2006-07) by Enrico Nardelli

  37. XOR gate - the exclusive OR • For a 2-input gate • Output is 1 if exactly one of the inputs is 1 Truth table • Logic diagram • For > 2 inputs: output is 1 if an odd number of inputs is 1 Rev. 4.1 (2006-07) by Enrico Nardelli

  38. Universal Gates • How many logical functions there are with n input? • With n inputs there are 2(2n ) possible logical functions Rev. 4.1 (2006-07) by Enrico Nardelli

  39. Universal Gates (2) • AND, OR, NOT can generate all possible boolean functions (see later) • Is it possible to use fewer basic operations? • Universal gate: a gate type that can implement any Boolean function Rev. 4.1 (2006-07) by Enrico Nardelli

  40. Universal Gates (3) • AND, NOT are enough ! • OR, NOT are enough ! • Even NAND alone or NOR alone are enough ! Rev. 4.1 (2006-07) by Enrico Nardelli

  41. How NAND simulates AND, OR • Simulation of NOT ??? Rev. 4.1 (2006-07) by Enrico Nardelli

  42. Alternative NAND representations Rev. 4.1 (2006-07) by Enrico Nardelli

  43. How NOR simulates AND, OR • Simulation of NOT ??? Rev. 4.1 (2006-07) by Enrico Nardelli

  44. Alternative NOR representations Rev. 4.1 (2006-07) by Enrico Nardelli

  45. Gate equivalence • Any AND, OR, NOT gate can be obtained using just NAND gates or just NOR gates • Consequence: any circuit can be constructed using just NAND gates or just NOR gates (easier to build) Rev. 4.1 (2006-07) by Enrico Nardelli

  46. Equivalence modifications (1) Rev. 4.1 (2006-07) by Enrico Nardelli

  47. Equivalence modifications (2) • Substitute equivalent gates Rev. 4.1 (2006-07) by Enrico Nardelli

  48. Transforming OR, AND to NAND • Transform the following circuit Rev. 4.1 (2006-07) by Enrico Nardelli

  49. Solution Rev. 4.1 (2006-07) by Enrico Nardelli

  50. Exercise • Write a NAND only logic circuit for F = XY’ + X’Y + Z Rev. 4.1 (2006-07) by Enrico Nardelli

More Related