Introduction to Computing Systems from bits & gates to C & beyond Chapter 3 Digital Logic Structures Transistors Logic gates & Boolean logic Combinational.

Slides:



Advertisements
Similar presentations
Introduction to Computer Engineering ECE/CS 252, Fall 2010 Prof. Mikko Lipasti Department of Electrical and Computer Engineering University of Wisconsin.
Advertisements

Digital Logical Structures
Logical Design.
Chapter 3 Digital Logic Structures. 3-2 Transistor: Building Block of Computers Microprocessors contain millions of transistors Intel Pentium 4 (2000):
Introduction to Digital Systems By Dr. John Abraham UT-Panam.
Chapter 4 Gates and Circuits.
Faculty of Computer Science © 2006 CMPUT 229 Digital Logic From Switches to Memories.
Copyright © 2003 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Slides prepared by Walid A. Najjar & Brian J. Linard,
Chapter 3 Digital Logic Structures. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 3-2 Transistor: Building.
SUPLEMENTARY CHAPTER 1: An Introduction to Digital Logic The Architecture of Computer Hardware and Systems Software: An Information Technology Approach.
Computer ArchitectureFall 2008 © August 20 th, Introduction to Computer Architecture Lecture 2 – Digital Logic Design.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Slides prepared by Walid A. Najjar & Brian J. Linard, University.
16/07/2015CSE1303 Part B lecture notes 1 Hardware Implementation Lecture B17 Lecture notes section B17.
Computer Science 210 s1 Computer Systems Semester 1 Lecture Notes James Goodman (revised by Robert Sheehan) Credits: Slides prepared by Gregory.
Chapter 12 Digital Logic Circuit Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
CS 105 Digital Logic Design
Lecture 8 Topics –Switch –Transistor –CMOS transistor –Logic gates AND, OR, NOT Universal gates: NAND, NOR XOR.
Chapter 3 Digital Logic Structures. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 3-2 Building Functions.
Introduction to Computing Systems from bits & gates to C & beyond Chapter 2 Bits, Data Types & Operations Integer Representation Floating-point Representation.
Chapter 4 Gates and Circuits. 4–2 Chapter Goals Identify the basic gates and describe the behavior of each Describe how gates are implemented using transistors.
Chapter 4 Gates and Circuits.
Chapter 10_1 Digital Logic. Irvine, Kip R. Assembly Language for Intel-Based Computers, NOT AND OR XOR NAND NOR Truth Tables Boolean Operators.
Introduction to Computing Systems from bits & gates to C & beyond Chapter 3 Digital Logic Structures Transistors Logic gates & Boolean logic Combinational.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Logic Circuits I.
Digital Logic Structures. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 3-2 Roadmap Problems Algorithms.
Introduction to Computing Systems from bits & gates to C & beyond Chapter 4 The Von Neumann Model Basic components Instruction processing.
Chapter 3 Digital Logic Structures. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 3-2 Basic Logic Gates.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Logic Circuits I.
1 DIGITAL ELECTRONICS. 2 OVERVIEW –electronic circuits capable of carrying out logical (boolean) and arithmetic operations on information stored as binary.
Chapter 3 Digital Logic Structures. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 3-2 Combinational vs.
Digital Logic Structures MOS transistors logic gates functional units of a computer.
Introduction to Computer Engineering ECE/CS 252, Fall 2010 Prof. Mikko Lipasti Department of Electrical and Computer Engineering University of Wisconsin.
4. Computer Maths and Logic 4.2 Boolean Logic Logic Circuits.
Digital Logic. 2 Abstractions in CS (gates) Basic Gate: Inverter IO IO GNDI O Vcc Resister (limits conductivity) Truth Table.
Introduction to Computing Systems from bits & gates to C & beyond Chapter 4 The Von Neumann Model Basic components Instruction processing.
ES 244: Digital Logic Design Chapter 4 Chapter 4: Combinational Logic Uchechukwu Ofoegbu Temple University.
Chapter 3 Digital Logic Structures. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 3-2 Complete Example.
Chapter 3 Digital Logic Structures. 3-2 Combinational vs. Sequential Combinational Circuit always gives the same output for a given set of inputs  ex:
CHAPTER-2 Fundamentals of Digital Logic. Digital Logic Digital electronic circuits are used to build computer hardware as well as other products (digital.
Chapter 3 Digital Logic Structures
PART 3 Digital Logic 1.Logic Gates 2.Logic Circuits 3.Memory 4.Sequential Circuits 5.LC-3 Data Path.
Introduction to Computer Engineering CS/ECE 252, Spring 2012 Prof. Karu Sankaralingam Computer Sciences Department University of Wisconsin – Madison.
Instructor:Po-Yu Kuo 教師:郭柏佑
Introduction to Computer Engineering CS/ECE 252, Fall 2007 Prof. David A. Wood Computer Sciences Department University of Wisconsin – Madison.
CS/COE0447 Computer Organization & Assembly Language
Chapter 3 Digital Logic Structures. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 3-2 Transistor: Building.
Appendix C Basics of Digital Logic Part I. Florida A & M University - Department of Computer and Information Sciences Modern Computer Digital electronics.
Instructor : Po-Yu Kuo 教師:郭柏佑 Ch. 3 Digital Logic Structures EL 1009 計算機概論 ( 電子一 B) Introduction to Computer Science.
Introduction to Computing Systems and Programming Digital Logic Structures.
Digital Logic Design Basics Combinational Circuits Sequential Circuits Pu-Jen Cheng Adapted from the slides prepared by S. Dandamudi for the book, Fundamentals.
Chapter 3 Digital Logic Structures
Latches, Flip Flops, and Memory ECE/CS 252, Fall 2010 Prof. Mikko Lipasti Department of Electrical and Computer Engineering University of Wisconsin – Madison.
Digital electronics 4–1 Gates and Circuits SANJAYBHAI RAJGURU COLLEGE OF ENGG.
4–1. BSCS 5 th Semester Introduction Logic diagram: a graphical representation of a circuit –Each type of gate is represented by a specific graphical.
LOGIC CIRCUITLOGIC CIRCUIT. Goal To understand how digital a computer can work, at the lowest level. To understand what is possible and the limitations.
Digital Logic Structures. Transistor: The Digital Building Block Microprocessors contain LOTS of transistors –Intel Pentium 4 (2000): 48 million –IBM.
Chapter 3 Digital Logic Structures. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 3-2 Transistor: Building.
1 CS/COE0447 Computer Organization & Assembly Language Logic Design Appendix C.
Instructor:Po-Yu Kuo 教師:郭柏佑
Instructor:Po-Yu Kuo 教師:郭柏佑
Chapter 4 Gates and Circuits.
CS105 Introduction to Computer Concepts GATES and CIRCUITS
Digital Logic Structures Logic gates & Boolean logic
Chapter 3 Digital Logic Structures
CS/COE0447 Computer Organization & Assembly Language
Instructor:Po-Yu Kuo 教師:郭柏佑
Digital Logic.
Digital Logic.
Electronics for Physicists
Digital Circuits and Logic
Presentation transcript:

Introduction to Computing Systems from bits & gates to C & beyond Chapter 3 Digital Logic Structures Transistors Logic gates & Boolean logic Combinational logic Storage Elements Memory

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Slides prepared by Walid A. Najjar & Brian J. Linard, University of California, Riverside Transistors An electronic switch  like light switch or faucet  switches between insulator and conductor  switch is closed (conducts) between A & B  depending on the voltage on G (gate) Open switch: no current flows Closed switch: current flows

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Slides prepared by Walid A. Najjar & Brian J. Linard, University of California, Riverside A B G A B G N Closed if gate is “on” Open if gate is “off” P Open if gate is “on” Closed if gate is “off” A B G CMOS Transistors CMOS  = Complementary Metal-Oxide Semiconductor  Standard type for digital applications  Two types: N (negative) and P (positive)  N and P transistors operate in inverse modes

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Slides prepared by Walid A. Najjar & Brian J. Linard, University of California, Riverside v 0 v Out In Inverter Gate  When the input is on (In = high voltage), the P-type transistor is open and the N- type is closed, so the output is off (Out = low voltage).  Vice-versa: when the Input is off (In = low voltage), the output is connected to the high voltage. P N

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Slides prepared by Walid A. Najjar & Brian J. Linard, University of California, Riverside NOR Gate C A B 2.9 v 0 v P N P N

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Slides prepared by Walid A. Najjar & Brian J. Linard, University of California, Riverside NOR Gate - Operation 2.9 v 0 v P N P 2.9 v 0 v N P N 2.9 v 0 v N P N P N 2.9 v 0 v P

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Slides prepared by Walid A. Najjar & Brian J. Linard, University of California, Riverside OR Gate D A B C = a NOR gate followed by an inverter

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Slides prepared by Walid A. Najjar & Brian J. Linard, University of California, Riverside NAND & AND Gates A B C D

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Slides prepared by Walid A. Najjar & Brian J. Linard, University of California, Riverside Logic Gates & Symbols Note: gates can have more than two inputs. Inverter (=NOT) inverts 0 to 1 and 1 to 0 AND gate c is 1 only if both a and b are 1 a b c OR gate c is 1 if either a or b is 1 a b c NAND gate c is 0 only if both a and b are 1 a b c NOR gate c is 0 if either a or b are 1 a b c

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Slides prepared by Walid A. Najjar & Brian J. Linard, University of California, Riverside De Morgan’s Law A and B = not((not A) or (not B)) A or B = not((not A) and (not B)) Completeness  AND, OR and NOT are sufficient to represent any truth table.  Actually: AND & NOT, or OR & NOT are separately sufficient.  So: all we need are NOR or NAND gates. = =

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Slides prepared by Walid A. Najjar & Brian J. Linard, University of California, Riverside Representation of Logic Functions A logic function can be represented as  a truth table  a logic expression  a logic circuit Example abcdf b a c d f

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Slides prepared by Walid A. Najjar & Brian J. Linard, University of California, Riverside Types of Logic Structures  Two types of logic structures (devices)  Storage structures: permit the storage of information (1 bit).  Decision structures: can make a decision but do not remember what it was: gates belong to this category.  Combinational logic  a logic structure is combinational if it is constructed from decision elements only: gates or other combinational logic structures.  the output of a combinational logic structure depends strictly on its current input.  Three examples  Decoder  Multiplexer (MUX)  Full adder

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Slides prepared by Walid A. Najjar & Brian J. Linard, University of California, Riverside Decoder  An n input decoder has 2 n outputs.  Output i is 1 iff the binary value of the n-bit input is i.  At any time, exactly one output is 1, all others are 0. 1, iff A,B is 00 A B 1, iff A,B is 01 1, iff A,B is 10 1, iff A,B is 11 i = 0 i = 1 i = 2 i = 3

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Slides prepared by Walid A. Najjar & Brian J. Linard, University of California, Riverside Multiplexer (MUX)  In general, a MUX has  2 n data inputs  n select (or control) lines  and 1 output.  It behaves like a channel selector. A 4-to-1 MUX: Out takes the value of A,B, C or D depending on the value of S (00, 01, 10, 11) S[1:0] ABCD Out ABCD S0S0 S1S1

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Slides prepared by Walid A. Najjar & Brian J. Linard, University of California, Riverside Adder Half Adder  2 inputs  2 outputs: sum and carry Full Adder  performs the addition in column i  3 inputs: a i, b i and c i  2 outputs: s i and c i+1  c i is the carry in from bit position i-1  c i+1 is the carry out to bit position i+1 Half-adder truth table

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Slides prepared by Walid A. Najjar & Brian J. Linard, University of California, Riverside Gate Level Full Adder

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Slides prepared by Walid A. Najjar & Brian J. Linard, University of California, Riverside Full Adder - Expressions where - verify that this corresponds to the gate-level implementation.

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Slides prepared by Walid A. Najjar & Brian J. Linard, University of California, Riverside A 4-bit Ripple-Carry Adder

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Slides prepared by Walid A. Najjar & Brian J. Linard, University of California, Riverside Carry Lookahead Addition We can pre-compute the carry  The carry in bit 4 (C 4 ) is 1 if any two of A 3, B 3 or C 3 are 1.  P 3 is called the propagate bit, and G 3 the generate bit  So every carry bit can be pre-computed using all the previous inputs.  Pre-computation can be done in 2 gate delays.

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Slides prepared by Walid A. Najjar & Brian J. Linard, University of California, Riverside Storage Elements: R-S Latch The R-S Latch The output (a) of the R-S latch can be set to 1 by momentarily setting S to 0 while keeping R at 1. If S is set to 1 the output stays at Conversely, the output can be set to 0 by keeping S at 1 and momentarily setting R to 0. When R is set back to 1, the output stays at The flip-flop (R-S latch) is a bi-stable element

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Slides prepared by Walid A. Najjar & Brian J. Linard, University of California, Riverside Storage Elements: Gated D Latch The R-S Latch The gated D larch is an extension of the R-S latch Two inputs: data (D) and write enable (WE) When the WE (write enable) is set to 1, the output of the latch is set to the value of D. The output is held until WE is “asserted” (set to 1) again.

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Slides prepared by Walid A. Najjar & Brian J. Linard, University of California, Riverside Registers A 4-bit register made of four D latches

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Slides prepared by Walid A. Najjar & Brian J. Linard, University of California, Riverside Memory - 1 Address Space n bits allow the addressing of 2 n memory locations.  Example: 24 bits can address 2 24 = 16,777,216 locations (i.e. 16M locations).  If each location holds 1 byte then the memory is 16MB.  If each location holds one word (32 bits = 4 bytes) then it is 64 MB. A large number of addressable fixed size locations

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Slides prepared by Walid A. Najjar & Brian J. Linard, University of California, Riverside Memory - 2 Addressability  Computers are either byte or word addressable - i.e. each memory location holds either 8 bits (1 byte), or a full standard word for that computer (typically 32 bits, though now many machines use 64 bit words).  Normally, a whole word is written and read at a time:  If the computer is word addressable, this is simply a single address location.  If the computer is byte addressable, and uses a multi-byte word, then the word address is conventionally either that of its most significant byte (big endian machines) or of its least significant byte (little endian machines).

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Slides prepared by Walid A. Najjar & Brian J. Linard, University of California, Riverside Building a Memory Each bit  is a gated D-latch Each location  consists of w bits (here w = 1)  w = 8 if the memory is byte addressable Addressing  n locations means log 2 n address bits (here 2 bits => 4 locations)  decoder circuit translates address into 1 of n addresses WE A[1:0] D

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Slides prepared by Walid A. Najjar & Brian J. Linard, University of California, Riverside Memory Example A 2 2 by 3 bits memory: two address lines: A[1:0] three data lines: D[2:0] one control line: WE One gated D-latch

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Slides prepared by Walid A. Najjar & Brian J. Linard, University of California, Riverside Using Memory Building Blocks  Building an 8K byte memory using chips that are 2K by 4 bits. CS = chip select: when set, it enables the addressing, reading and writing of that chip. This is an 8KB byte addressable memory d e c o d er CS A10-A0 A12-A11 2K x 4 bits

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Slides prepared by Walid A. Najjar & Brian J. Linard, University of California, Riverside Memory One Word Wide Use the previous memory block of 8K x 1 byte to build a memory that is 64K words, with each location one word of 32 bits.  what are the address lines if the memory is word addressed? or byte addressed? A? - A? d e c o d er A? - A? 8K x 1B

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Slides prepared by Walid A. Najjar & Brian J. Linard, University of California, Riverside Finite-State Machines  Output is a function of the input and the state  The function is computed by the combinatorial logic circuit  The state is stored in the storage element  The state is also a function of itself and the input Combinational Logic Circuit Storage Element output input

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Slides prepared by Walid A. Najjar & Brian J. Linard, University of California, Riverside FSM Example  Three groups of lights to be lit in a sequence: group 1 on, groups 1 & 2 on, all groups on, all off.  The lights are on only if the main switch is on.  Four states: so we need two bits to identify each state. DETOUR Combinational Logic Circuit Two bit Storage switch clock 2 2 out1 out2 out3 all on grp 1,2 on all off grp 1 on , S d[1:0]

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Slides prepared by Walid A. Najjar & Brian J. Linard, University of California, Riverside FSM Example When is group 1 on?  in states 01, 10 and 11 - but only when the switch is on! When do we switch to the next state?  at every clock cycle the two bits are updated  d[1:0] is the state at the next clock cycle; it is a function of the input (switch) and the current state.  can you come up with a logic expression for d 0 and d 1 ?

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Slides prepared by Walid A. Najjar & Brian J. Linard, University of California, Riverside The LC-2 as a Finite State Machine

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Slides prepared by Walid A. Najjar & Brian J. Linard, University of California, Riverside Data Path of the LC-2