Understanding Logic Circuits and Transistors in Computer Systems

Slide Note
Embed
Share

Exploring the fundamentals of logic circuits in computer systems, this content delves into representing data at the electronic level, the role of transistors as building blocks, and the operation of simple switch circuits. It also discusses n-type and p-type MOS transistors, highlighting their functions and respective voltage behaviors.


Uploaded on Sep 10, 2024 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. Logic Circuits Part 1 Chapter 3

  2. Computing Layers Problems Algorithms Language Instruction Set Architecture Microarchitecture Circuits Devices

  3. How do we represent data in a computer? At the lowest level, a computer is an electronic machine. Works by controlling the flow of electrons Easy to recognize two conditions: 1. Presence of a voltage we ll call this state 1 2. Absence of a voltage we ll call this state 0 Could base state on value of voltage, but control and detection circuits more complex. Compare turning on a light switch to measuring or regulating voltage Compare sticking a piece of metal in a outlet to being able to say if the outlet has 110 volts or 115 volts

  4. Transistor: Building Block of Computers Logically, each transistor acts as a switch Combined to implement logic functions (gates) AND, OR, NOT These are combined to build higher-level structures Adder, multiplexer, decoder, register, memory Adder, multiplier These are combined to build simple processor LC-3 More in-depth information about this section of the class can be found in MIT s Open Courseware videos on YouTube, search MIT 6.004 Spring 2016. Lectures 1 through 6 cover material we will learn about

  5. Simple Switch Circuit Switch open: Open circuit, no current Light is off Switch closed: Short circuit across switch, current flows Light is on Switch-based circuits can easily represent two states: on/off, open/closed, voltage/no voltage.

  6. n-type MOS Transistor MOS = Metal Oxide Semiconductor two types: n-type and p-type n-type When Gate has positive voltage, short circuit between #1 and #2 switch closed When Gate has zero voltage, open circuit between #1 and #2 switch open Gate = 1 Gate = 0 Terminal #2 must be connected to GND (0V).

  7. p-type MOS Transistor p-type is complementary to n-type When Gate has positive voltage, open circuit between #1 and #2 switch open When Gate has zero voltage, short circuit between #1 and #2 switch closed Gate = 1 Gate = 0 Terminal #1 must be connected to +2.9V.

  8. Logic Gates Use switch behavior of MOS transistors to implement logical functions: AND, OR, NOT Digital symbols: Recall that we assign a range of analog voltages to each digital (logic) symbol Assignment of voltage ranges depends on electrical properties of transistors being used Typical values for "1": ~5V, ~3.3V, ~2.9V, ~1V From now on we'll use 2.9V

  9. CMOS Circuit Complementary MOS uses both n-type and p-type MOS transistors p-type Attached to + voltage (2.9v) Pulls output voltage UP when input is zero n-type Attached to GND (0v) Pulls output voltage DOWN when input is one For all inputs, output is either connected to GND or to +, but not both! No direct connection between + and GND, except switching. Low power consumption.

  10. Inverter (NOT Gate) Symbol Truth table In 0 V 2.9 V 2.9 V Out In 0 1 Out 1 0 0 V

  11. NOR Gate (NOT-OR) Logic symbol A B 0 0 0 1 1 0 1 1 C 1 0 0 0 Truth table Note: Serial structure on top, parallel on bottom.

  12. OR Gate Truth table A B 0 0 1 1 C 0 1 1 1 0 1 0 1 Add inverter to NOR.

  13. Series Parallel / Complementary Circuits Truth table A B C Out 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 1 1 1 0 1 0 1 0 Arbitrary circuit, series on one half, parallel on other half

  14. Logical Operation: OR and NOR Truth tables A 0 0 1 1 B 0 1 0 1 NOR 1 0 0 0 Inputs: 2 or more A 0 0 1 1 B 0 1 0 1 OR 0 1 1 1 Logic symbols Output=A+B Output=A+B Boolean algebra notation

  15. AND and NAND A 0 0 1 1 B 0 1 0 1 AND 0 0 0 1 A 0 0 1 1 B 0 1 0 1 NAND 1 1 1 0 Inputs: 2 or more Output = A.B Output = A.B

  16. Basic Logic Gates NOT = or OR = + AND = .

  17. Boolean Algebra Identities x.x = 0 x.1 = x x.0 = 0 x x x AND 0 x 0 x 1 0 x+1 = 1 x+0 = x x+x = 1 x x 1 x 0 1 OR 1 x x NOT = or OR = + AND = .

  18. Boolean Algebra Laws (2) NOT = or OR = + AND = . Precedence: NOT/ / - highest AND/. - middle OR/+ - lowest Commutative: A+B = B+A A.B = B.A Associative: A+(B+C)=(A+B)+C = A+B+C A.(B.C)=(A.B).C = ABC Distributive: A.(B+C)=A.B+A.C A+(B.C)=(A+B).(A+C)

  19. Some Useful Identities for simplification Identities A.B+A.B = A Proof: A.B+A.B =A(B+B ) =A AND x.1 = x x.0 = 0 x.x = 0 OR x+x = 1 x+1 = 1 x+0 = x A+A.B = A Proof: A+A.B =A(1+B) =A

  20. DeMorgan's Law Converting AND to OR (with some help from NOT) Consider the following gate: To convert AND to OR (or vice versa), invert inputs and output. A B 0 0 0 1 1 0 1 1 A B A B A B 1 1 0 0 1 0 1 0 1 0 0 0 0 1 1 1 Same as A OR B!

  21. Exclusive OR / XOR Output is 0 if inputs are the same, 1 if different Truth table A B 0 0 0 1 1 0 1 1 C 0 1 1 0

  22. More than 2 Inputs? AND/OR can take any number of inputs. AND = 1 if all inputs are 1. OR = 1 if any input is 1. Similar for NAND/NOR. Can implement with multiple two-input gates, or with single CMOS circuit.

  23. Propagation Delay Each gate has a propagation delay, typically fraction of a nanosecond (10-9 sec). Delays add depending on the chain of gates the signals have to go trough. Clock frequency is determined by the delay of the longest combinational path between storage elements. Measured in GHz (109 cycles per sec).

  24. Summary MOS transistors are used as switches to implement logic functions. n-type: connect to GND, turn on (1) to pull down to 0 p-type: connect to +2.9V, turn on (0) to pull up to 1 Basic gates: NOT, NOR, NAND Boolean Algebra: Logic functions are usually expressed with AND, OR, and NOT DeMorgan's Law Convert AND to OR (and vice versa) by inverting inputs and output

  25. Building Functions from Logic Gates Combinational Logic Circuit Output depends only on the current inputs Stateless Sequential Logic Circuit Output depends on the sequence of inputs (past and present) Stores information (state) from past inputs We'll first look at some useful combinational circuits, then show how to use sequential circuits to store information.

  26. Combinatorial Logic Truth table Combination of logic gates Digital circuit A B C W X Y Z 0 0 0 0 0 0 1 0 0 1 0 1 1 1 0 1 0 0 1 1 1 0 1 1 0 1 1 1 1 0 0 0 0 0 1 1 0 1 0 1 1 1 1 1 0 1 1 0 0 1 1 1 1 1 0 0

  27. Functional Blocks Decoder Multiplexer Full Adder Any general function Decrementer R18

  28. Decoder n inputs, 2n outputs Exactly one output is 1 for each possible input pattern Uses of a decoder? 2-bit decoder

  29. Multiplexer (MUX) Uses of a multiplexer? n-bit selector and 2n inputs, one output output equals one of the inputs, depending on selector 4-to-1 MUX Functional representation

  30. Full Adder Add two bits and carry-in, produce one-bit sum and carry-out. A B CinS Cout 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 0 1 1 0 1 0 0 1 0 0 0 1 0 1 1 1 Half Adder?

  31. Four-bit Adder (ripple carry) Propagation delay? 2 levels of delay per stage

  32. Logical Completeness Can implement ANY truth table with combo of AND, OR, NOT gates. 1. AND rows that yield a 1 as an output in the truth table. 2. Use an OR gate per output to connect the AND gates that correspond to the 1s in that output s column A 0 0 0 0 1 1 1 1 B C 0 0 1 1 0 0 1 1 D 0 0 1 0 0 1 0 0 0 1 0 1 0 1 0 1

  33. Truth Table (to circuit) How do we design a circuit for this? Number of OR gates? A 0 0 0 0 1 1 1 1 B 0 0 1 1 0 0 1 1 C 0 1 0 1 0 1 0 1 X 1 0 1 0 0 0 1 1 Y 0 1 0 1 0 1 0 1 Number of AND gates? Optimal?

  34. Programmable Logic Array Front end is decoder for inputs Back end defines the outputs Any truth table can be built Not necessarily minimal circuit! Requires (at least) ten gates.

  35. Circuit Minimization using Boolean Algebra Boolean logic lets us reduce the circuit Truth Table A B C X Y 0 0 0 1 0 X = A B C + A BC + ABC + ABC 0 0 1 0 1 0 1 0 1 0 0 1 1 0 1 1 0 0 0 0 = A C + AB 1 0 1 0 1 1 1 0 1 0 1 1 1 1 1 Y = A B C+ A BC + AB C + ABC Try with Logisim! Only three gates! = A C+AC = C

  36. Karnaugh maps Visual representation of algebraic functions to make it easy to spot adjacent minterms Columns arranged/labeled so that adjacent terms are visually adjacent. Gray Code Identify groups of 2, 4, 8 etc. terms that can be combined. All 1 s must be covered. A 1 can be used more than once Sometimes the solution is not unique Truth Table A 0 0 0 0 1 1 1 1 B 0 0 1 1 0 0 1 1 C 0 1 0 1 0 1 0 1 X 1 0 1 0 0 0 1 1 Y 0 1 0 1 0 1 0 1 B A\BC 00 01 11 10 0 1 A C

  37. Karnaugh Maps: Visualization of algebra Once groups are identified minimized expression can be found by ANDing the terms that stay the same in a group then ORing these results from all groups together Y X A 0 0 0 0 1 1 1 1 B 0 0 1 1 0 0 1 1 C 0 1 0 1 0 1 0 1 X 1 0 1 0 0 0 1 1 Y 0 1 0 1 0 1 0 1 B B A\BC 00 01 11 10 A\BC 00 01 11 10 0 0 1 1 0 0 1 0 0 1 1 0 1 1 0 A 1 0 0 1 1 A C C

  38. Karnaugh Maps: Visualization of algebra X Y B B A\BC 00 01 11 10 A\BC 00 01 11 10 0 1 0 0 1 0 0 1 1 0 1 0 0 1 1 A 1 0 1 1 0 A C C X: A B C +A BC = A C ; ABC+ABC = AB Y: A B C+A BC+AB C+ABC= A C+AC = C Try them with Logisim Minimized: X = A C +AB Y = C

  39. In Logisim

  40. 4-variable Kmaps / Design C 00 01 11 10 00 01 11 10 1 1 F(A,B,C,D)=B D +_____ 1 B A 1 1 C D 00 01 1 1 1 11 10 00 01 11 10 1 1 1 1 F(A,B,C,D)=ABC +A C D+ A BC+ACD+ ? B 1 A D

  41. 4-variable Kmaps / Design C 00 01 11 10 00 01 11 10 1 1 F(A,B,C,D)=B D +A BC D 1 B A 1 1 C 00 01 1 1 1 11 10 D 00 01 11 10 1 1 1 1 F(A,B,C,D)=ABC +A C D+ A BC+ACD + ? B 1 A Try them with Logisim D

Related


More Related Content