1 CE 454 Computer Architecture Lecture 5 Ahmed Ezzat The Digital Logic, Ch-3.1, 3.2.

Slides:



Advertisements
Similar presentations
Chapter 4 Gates and Circuits.
Advertisements

Part 4: combinational devices
Chapter 4 Gates and Circuits.
L14: Boolean Logic and Basic Gates
CS105 Introduction to Computer Concepts GATES and CIRCUITS
Chapter 4 Gates and Circuits.
Logical Design.
LOGIC GATES ADDERS FLIP-FLOPS REGISTERS Digital Electronics Mark Neil - Microprocessor Course 1.
Cosc 2150: Computer Organization Chapter 3: Boolean Algebra and Digital Logic.
Fall 2005 L15: Combinational Circuits Lecture 15: Combinational Circuits Complete logic functions Some combinational logic functions –Half adders –Adders.
Fall 2007 L15: Combinational Circuits Lecture 15: Combinational Circuits Complete logic functions Some combinational logic functions –Half adders –Adders.
1 Digital Logic
Chapter 4 Gates and Circuits.
Lecture 8 Arithmetic Logic Circuits
9/19/06 Hofstra University – Overview of Computer Science, CSC005 1 Chapter 4 Gates and Circuits.
Informationsteknologi Friday, October 19, 2007Computer Architecture I - Class 81 Today’s class Digital Logic.
Comparators A comparator compares two input words.
Lecture 3. Boolean Algebra, Logic Gates
Gates A digital circuit is one in which only two logical values are present. Typically, a signal between 0 and 1 volt represents one value (e.g. binary.
Comparators  A comparator compares two input words.  The following slide shows a simple comparator which takes two inputs, A, and B, each of length 4.
Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved The Digital Logic Level.
Fall 2007 L16: Memory Elements LECTURE 16: Clocks Sequential circuit design The basic memory element: a latch Flip Flops.
Prof. Kavita Bala and Prof. Hakim Weatherspoon CS 3410, Spring 2014 Computer Science Cornell University See: P&H Appendix B.2 and B.3 (Also, see B.0 and.
CS 105 Digital Logic Design
Chapter 3: Boolean Algebra
Today’s Topics Digital Logic Design Digital Logic Design Boolean Logic Boolean Logic Digital Logic Circuits Digital Logic Circuits.
Lecture 3. Boolean Algebra, Logic Gates Prof. Sin-Min Lee Department of Computer Science 2x.
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.
Introduction to Digital Logic Design Appendix A of CO&A Dr. Farag
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.
1 CHAPTER 4: PART I ARITHMETIC FOR COMPUTERS. 2 The MIPS ALU We’ll be working with the MIPS instruction set architecture –similar to other architectures.
Chapter 4 Gates and Circuits.
1 Logic Gates Digital Computer Logic Kashif Bashir WWW:
Dept. of Computer Science Engineering Islamic Azad University of Mashhad 1 DIGITAL LOGIC CIRCUITS Dept. of Computer Science Engineering Islamic Azad University.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Logic Circuits I.
CPS120: Introduction to Computer Science
School of Computer Science G51CSA 1 Computer Systems Architecture Fundamentals Of Digital Logic.
1 The Chinese University of Hong Kong Faculty of Education Diploma in Education (Part-Time) Winter 1997 Educational Communications and Technology Assignment.
The Digital Logic Level
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.
Digital Logic. 4 Why is 32-bit or 64-bit significant in terms of speed, efficiency? 4 Difference between OR and XOR 4 What is a mux for? PLA 4 Two kinds.
HCL and ALU תרגול 10. Overview of Logic Design Fundamental Hardware Requirements – Communication: How to get values from one place to another – Computation.
1 Lecture #7 EGR 277 – Digital Logic Reading Assignment: Chapter 4 in Digital Design, 3 rd Edition by Mano Chapter 4 – Combinational Logic Circuits A)
CS/COE0447 Computer Organization & Assembly Language
Appendix C Basics of Digital Logic Part I. Florida A & M University - Department of Computer and Information Sciences Modern Computer Digital electronics.
1 Fundamentals of Computer Science Combinational Circuits.
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.
ECE DIGITAL LOGIC LECTURE 5: BINARY LOGIC AND DIGITAL LOGIC GATES Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2016, 01/28/2016.
Logic Gates Dr.Ahmed Bayoumi Dr.Shady Elmashad. Objectives  Identify the basic gates and describe the behavior of each  Combine basic gates into circuits.
Lecture 3 Boolean Algebra and Digital Logic Lecture Duration: 2 Hours.
LOGIC CIRCUITLOGIC CIRCUIT. Goal To understand how digital a computer can work, at the lowest level. To understand what is possible and the limitations.
Week 1: Introduction and Logic gates IT3002 – Computer Architecture
Dr.Ahmed Bayoumi Dr.Shady Elmashad
Dr.Ahmed Bayoumi Dr.Shady Elmashad
Fundamentals & Ethics of Information Systems IS 201
Lecture 3 Boolean Algebra and Digital Logic Lecture Duration: 2 Hours
Basics Combinational Circuits Sequential Circuits
Basics Combinational Circuits Sequential Circuits Ahmad Jawdat
Chapter 4 Gates and Circuits.
CS105 Introduction to Computer Concepts GATES and CIRCUITS
Fundamentals of Computer Science Part i2
The Digital Logic Level
Week 7: Gates and Circuits: PART II
Logic Gates.
COMS 361 Computer Organization
Logic Circuits I Lecture 3.
Digital Circuits and Logic
Presentation transcript:

1 CE 454 Computer Architecture Lecture 5 Ahmed Ezzat The Digital Logic, Ch-3.1, 3.2

CE 454Ahmed Ezzat 2 Outline Transistors and Logic Gates Boolean Algebra Implementation of Boolean Algebra Circuit Equivalence Integrated Circuits Combinational Circuits Arithmetic Circuits Clocks

CE 454Ahmed Ezzat 3 Transistors and Logic Gates Border of Computer Science and Electrical Engineering Digital circuit has 2 logical values: (0 – 2.5) volts and (3.5 – 5) volts. Values outside these ranges are not allowed. Gates are the devices that can compute various functions for these two-values signals. Gates are the basis of digital computers. The heart of the Gate logic is the transistor and its use as a binary switch! Details of how to build gates (device level) is not in our scope – pure Electrical Engineering.

CE 454Ahmed Ezzat 4 Transistors and Logic Gates Transistor Types: Bipolar Transistor :  TTL (Transistor-Transistor Logic)  ECL (Emitter-Coupled Logic) MOSFET (Metal Oxide Semiconductor Field Effect Transistors):  PMOS: p-channel (switch is ON when input is low)  NMOS: n-channel (switch is ON when input is high)  CMOS: Complementary Metal Oxide Semiconductor Bipolar is faster than CMOS. CMOS is much more dense and uses less power than Bipolar. Functionality is the same. Most modern CPUs (logic functions) and Memories (storage elements) use CMOS technology

CE 454Ahmed Ezzat 5 Transistors and Logic Gates Gate Drain Source Switch

CE 454Ahmed Ezzat 6 Transistors and Logic Gates

CE 454Ahmed Ezzat XOR Logic Gate: Logical function “Exclusive OR” AB + AB alternatively A’B + AB’ Input A Output Input B Input A Output Input B Transistors and Logic Gates

CE 454Ahmed Ezzat 8 Transistors and Logic Gates Transistors can be connected together with wires, and create logic functions – these functions are called logic gates In modern computer chips, the transistors and wires are very, very, very small...

CE 454Ahmed Ezzat 9 Boolean Algebra – George Boole New type of algebra is needed to describe these binary devices/Gates – Boolean Algebra! Boolean algebra can take on variables and functions that can have only binary values. Functions in boolean algebra can have one or more input variables and yield a result that only depends on these inputs! F(), can be defined as f(A) = 1 if A = 0, and f(A) = 0 if A = 1 –- this is the “NOT” function A boolean function of n variables has only 2 n possible combinations on inputs, as a result it can be described by a table with 2 n rows, each row stating the outcome for specific combination of the inputs –- called a truth table.

CE 454Ahmed Ezzat 10 Boolean Algebra M = f(A, B, C): M = ABC + ABC + ABC + ABC 

CE 454Ahmed Ezzat 11 Implementation of Boolean Algebra A boolean function can be implemented by logic gates in more than one way. A Generalized Procedure for Generating a Digital Logic Design from a Truth Table: 1. Write down the truth table for the function 2. Provide inverters to generate the complement of each input 3. Draw an AND gate for each term with a 1 in the result column 4. Wire the AND gates to the appropriate inputs 5. Feed the output of all the AND gates into one OR logic gate. The above model uses AND, OR and NOT logic gates, however, we can also use NANDs and NORs logic gates as well

CE 454Ahmed Ezzat 12 Implementation of Boolean Algebra

CE 454Ahmed Ezzat 13 Implementation of Boolean Algebra Switching Expression  Digital Logic Circuit: Example: M = xy + z’ x y z M

CE 454Ahmed Ezzat 14 Circuit Equivalence Typically start with Boolean function, apply laws of Boolean algebra to find simpler but equivalent one.

CE 454Ahmed Ezzat 15 Circuit Equivalence Identity Table for Boolean Algebra: Each law has 2 forms that are dual of each other: by interchanging AND and OR, and 0 and 1, either form can be produced from the other. Except DeMorgan’s law, the absorption law, and the AND form of the distributive law, the result is intuitive!

CE 454Ahmed Ezzat 16 Circuit Equivalence Alternative Boolean Algebra Symbols for the same Gates:

CE 454Ahmed Ezzat 17 Circuit Equivalence

CE 454Ahmed Ezzat 18 Circuit Equivalence Same Gate can Compute Different Functions (conventions used): +ve logic is an AND function, and –ve logic is an OR function.

CE 454Ahmed Ezzat 19 Circuit Equivalence Working with Switching Algebra F(A,B,C) = A’ + B’ + A’BC = A’ + B’ = (AB)’ F(X,Y,Z,W) = XY + W’XYZ + X’Y = XY + X’Y = Y Logic function = ((A + B’)’ B’)’ … using DeMorgan’s law: = (A + B’) + B = A + 1 = 1 Input A Output Input B

CE 454Ahmed Ezzat 20 Integrated Circuits Gates are not manufactured or sold individually, but in units called ICs or chips. IC classes:  SSI: Small Scale Integrated Circuit – 1 to 10 gates  MSI: Medium Scale Integrated Circuit – gates  LSI: Large Scale Integrated Circuit – 100 – 100,000 gates  VLSI: Very Large Scale Integrated Circuit – > 100,000 gates ICs introduce delay (1 – 10 nsec) due to gate delay and switching time delay. Current state-of-the art is close to 100,000,000 transistor on a chip.

CE 454Ahmed Ezzat 21 Combinational Circuits Digital logic that is designed so that the outputs are dependent only upon the current set of inputs is called COMBINATIONAL LOGIC – this is in contrast to SEQUENTIONAL LOGIC where output is a function of input and the current state (i.e., circuits containing memory elements). In the following we will cover few frequently-used combinational circuits:  Multiplexers  Decoders  Comparators  Programmable Logic Arrays (PLA)

CE 454Ahmed Ezzat 22 Combinational Circuits Multiplexers: Eight data inputs, and three control inputs. The control lines (A,B,C) select which of the 8 input lines to be “gated” out. Each AND is enabled by a different combination of the control lines.

CE 454Ahmed Ezzat 23 Combinational Circuits Decoders: The set of n-inputs are decoded to select exactly one of the 2 n output lines.

CE 454Ahmed Ezzat 24 Combinational Circuits Comparators: Compares 2 input words, and produces 1 iff they are equal, otherwise it produces 0.

CE 454Ahmed Ezzat 25 Combinational Circuits PLA: This PLA consists of: 12 input- lines and their inverse (24- inputs), 50 AND gates, each can have any subset of the 24 inputs (supplied by the user), and 6 OR gates as output lines. Total # pins = power, ground = 20 pins. With appropriate internal connections, you can use PLA to implement multiple separate functions. Custom PLA are more common and cheaper.

CE 454Ahmed Ezzat 26 Arithmetic Circuits Shifters: 8-input, 8-output, 1- control line (C) to determine the direction of shift (left/right). Don’t deal with overflow.

CE 454Ahmed Ezzat 27 Arithmetic Circuits Half Adders (Integers): 1-bit integer addition logic, with 2-bits input and 2-bits as out (sum, carry). Not suitable by-itself as it does not propagate carry as input to the next bit!

CE 454Ahmed Ezzat 28 Arithmetic Circuits Full Adders (Integers): 1-bit integer addition logic, with 3-bits input (including carry-bit from previous stage) and 2-bits as out (sum, carry). Full adder is built out of 2 half adders. This type of adder is called ripple carry adder. Addition do not complete until the carry has rippled to the rightmost bit!

CE 454Ahmed Ezzat 29 Arithmetic Circuits Full Adders (Integers): Full Adder A3A3 B3B3 Sum 3 Carry Full Adder A2A2 B2B2 Sum 2 Carry Full Adder A1A1 B1B1 Sum 1 Carry Full Adder A0A0 B0B0 Sum 0 Carry “0”

CE 454Ahmed Ezzat 30 Arithmetic Circuits Full Adders (Integers): Consider breaking a 32-bit adder up into a 16-bit lower half and two upper 16-bit halves. The circuit consists of three 16-bit adders. Let the lower half start as usual, feed 0 in one of the two upper halves, and feed 1 in the other. After 16-bit addition times, it will be known what the carry is into the upper half is, so select the correct upper half immediately. This reduces the addition time by factor of 2! Such an adder is called carry select adder. This trick can then be repeated to build each 16-bit adder out of replicated 8-bit adder, etc.

CE 454Ahmed Ezzat 31 Arithmetic Circuits Arithmetic Logic Unit (ALU): ALU is the math engine for modern digital computers. Performs 4 simple functions:  A AND B // bitwise AND  A OR B // bitwise OR  NOT B // bitwise NOT  A + B // addition operator Operates on single bits “A” and “B”

CE 454Ahmed Ezzat 32 Arithmetic Circuits ALU Block Diagram: Logic Unit (AND, OR, NOT) A B Full Adder 2 to 4 Decoder Output Carry Out Carry In Enable A Enable B Inv A Cntl 1 Cntl 0 Sum A B En OR En AND En NOT En ADD A B

CE 454Ahmed Ezzat 33 Arithmetic Circuits Bit Slice ALU: Four Functions (AND, OR, NOT B, ADDITION) for single bits A i and B i Inputs – INV A Inverse of A i – AThe single bit A i – ENAEnable the A input – BThe single bit B i – ENBEnable the B input – FOControl signal 0 – F1Control signal 1 – Carry InCarry-in signal (usually the carry out signal from the previous state) Outputs – OutputResult of ALU computation – Carry OutCarry out signal from full adder circuit

CE 454Ahmed Ezzat 34 Arithmetic Circuits Control Signals F0 and F1: What do the control signals F0 and F1 do? Both signals go into the 2 to 4 decoder Between the two signals, one of the four ALU functions is selected to be the ALU’s output F0 Output Function 0 A AND B A + B 1 F1 0 A OR B NOT B

CE 454Ahmed Ezzat 35 Arithmetic Circuits How would the ALU subtract two integers? A – B Think about the two’s complement procedure 1. NOT B (take the complement of B) 2. NOT B + 1 (add one to the result of step 1)  2’s complement of B 3. A + (NOT B + 1) (add A to the result of step 2) 4. Ignore any carry out signals

CE 454Ahmed Ezzat 36 Arithmetic Circuits How would the ALU multiply or divide two integers? How about a shifter? Multiplication and division can be thought of as “shift and add” or “shift and subtract” procedures

CE 454Ahmed Ezzat Clocks Just about like everything else in this world, many digital logic designs “run on the clock” Digital circuit designs that use a clock are called synchronous circuits The clock synchronizes when things happen in the digital circuit

CE 454Ahmed Ezzat Clocks Clock Signals: Clocks send out a series of pulses, where the signal alternates between high and low Ideally, a clock signal will look like a square wave High Low Rising Clock EdgeFalling Clock Edge One Clock Cycle

CE 454Ahmed Ezzat Clocks Synchronous Digital Circuits: Synchronous digital circuits operation can be thought of as a series of discrete events The clock is used to trigger these discrete events Clock “triggers” can be on: – Rising clock edge – Falling clock edge – Clock low – Clock high

CE 454Ahmed Ezzat Clocks Asymmetric Clock: Introducing delay can generate asymmetric clock In (b) events can happen when C1 or when C2 is high for example If more intervals are needed, more clocks can be provided, or the state of the clocks can overlap partially which produces 4 distinct intervals: (C1 AND C2), (C1 AND C2), (C1 AND C2), and (C1 AND C2).  

CE 454Ahmed Ezzat 41 Clocks How Might You Use a Clock with ALU to Subtract 2 Integers: 1. Cycle 1: Get the value of B from a register and onto the input lines of the ALU Enable B Select the NOT B function – (store the intermediate results back into a register) 2. Cycle 2: Get the value of B from the intermediate results register and place on the input lines of the ALU Enable B Select the increment function (add with first stage’s carry in = 1) – (store the intermediate results back into a register)

CE 454Ahmed Ezzat 42 Clocks How Might You Use a Clock with ALU to Subtract 2 Integers: Cycle 3: Get the values of A and (NOT B + 1) from the appropriate registers and onto the input lines of the ALU Enable both A and B Select the ADD A + B function Store the result in the appropriate register

CE 454Ahmed Ezzat 43 Clocks How else Might You Use the ALU to Subtract 2 Integers: 1. Cycle 1: Get the value of “B” from a register and place it onto the input lines of the ALU (make it the “A” value) Enable A Enable INV A Note: You now have “the complement of A” going into the ALU Get the value of “A” from a register and place it onto the input lines of the ALU (make it the “B” value) Configure the first stage of the ALU to have “Carry In” signal set to “1” (equivalent of adding 1 or incrementing) Add A and B inputs – (store the results into a register)

CE 454Ahmed Ezzat 44