CSC9R6 Computer Design. Practical Digital Logic

Similar documents
Design of Sequential Circuits

XI STANDARD [ COMPUTER SCIENCE ] 5 MARKS STUDY MATERIAL.

211: Computer Architecture Summer 2016

Digital Logic. CS211 Computer Architecture. l Topics. l Transistors (Design & Types) l Logic Gates. l Combinational Circuits.

MC9211 Computer Organization

Boolean Algebra and Digital Logic 2009, University of Colombo School of Computing

Combinational Logic. By : Ali Mustafa

Boolean Algebra, Gates and Circuits

Fundamentals of Digital Design

Boolean Algebra & Logic Gates. By : Ali Mustafa

Number System. Decimal to binary Binary to Decimal Binary to octal Binary to hexadecimal Hexadecimal to binary Octal to binary

Digital Logic (2) Boolean Algebra

Unit 8A Computer Organization. Boolean Logic and Gates

Digital Techniques. Figure 1: Block diagram of digital computer. Processor or Arithmetic logic unit ALU. Control Unit. Storage or memory unit

Philadelphia University Student Name: Student Number:

CS 226: Digital Logic Design

Department of Electrical & Electronics EE-333 DIGITAL SYSTEMS

Chapter 2: Switching Algebra and Logic Circuits

BOOLEAN ALGEBRA. Introduction. 1854: Logical algebra was published by George Boole known today as Boolean Algebra

ELCT201: DIGITAL LOGIC DESIGN

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified)

on candidate s understanding. 7) For programming language papers, credit may be given to any other program based on equivalent concept.

Outline. EECS150 - Digital Design Lecture 4 - Boolean Algebra I (Representations of Combinational Logic Circuits) Combinational Logic (CL) Defined

Every time has a value associated with it, not just some times. A variable can take on any value within a range

Chapter 7 Logic Circuits

Sample Test Paper - I

S.Y. Diploma : Sem. III [DE/ED/EI/EJ/EN/ET/EV/EX/IC/IE/IS/IU/MU] Principles of Digital Techniques

CHAPTER1: Digital Logic Circuits Combination Circuits

Digital Logic: Boolean Algebra and Gates. Textbook Chapter 3

EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits

EECS150 - Digital Design Lecture 4 - Boolean Algebra I (Representations of Combinational Logic Circuits)

EEE130 Digital Electronics I Lecture #4

ECE 545 Digital System Design with VHDL Lecture 1A. Digital Logic Refresher Part A Combinational Logic Building Blocks

Computer organization

COSC 243. Introduction to Logic And Combinatorial Logic. Lecture 4 - Introduction to Logic and Combinatorial Logic. COSC 243 (Computer Architecture)

( c) Give logic symbol, Truth table and circuit diagram for a clocked SR flip-flop. A combinational circuit is defined by the function

SAU1A FUNDAMENTALS OF DIGITAL COMPUTERS

Boolean algebra. Examples of these individual laws of Boolean, rules and theorems for Boolean algebra are given in the following table.

Combinational Logic. Review of Combinational Logic 1

CS/COE0447: Computer Organization and Assembly Language

ECE 545 Digital System Design with VHDL Lecture 1. Digital Logic Refresher Part A Combinational Logic Building Blocks

CS/COE1541: Introduction to Computer Architecture. Logic Design Review. Sangyeun Cho. Computer Science Department University of Pittsburgh

Computer Organization: Boolean Logic

Building a Computer Adder

Vidyalankar S.E. Sem. III [CMPN] Digital Logic Design and Analysis Prelim Question Paper Solution

of Digital Electronics

Fundamentals of Boolean Algebra

Why digital? Overview. Number Systems. Binary to Decimal conversion

Unit II Chapter 4:- Digital Logic Contents 4.1 Introduction... 4

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING CS6201 DIGITAL PRINCIPLES AND SYSTEM DESIGN

Chap 2. Combinational Logic Circuits

Binary addition example worked out

Chapter 2 (Lect 2) Canonical and Standard Forms. Standard Form. Other Logic Operators Logic Gates. Sum of Minterms Product of Maxterms

CS/COE0447: Computer Organization

Logic Design. Chapter 2: Introduction to Logic Circuits

Chapter 2 Combinational Logic Circuits

Combinational Logic Design Combinational Functions and Circuits

Part 1: Digital Logic and Gates. Analog vs. Digital waveforms. The digital advantage. In real life...

Latches. October 13, 2003 Latches 1

Lecture 22 Chapters 3 Logic Circuits Part 1

Gates and Flip-Flops

Chapter 2 Boolean Algebra and Logic Gates

Chapter 2 Boolean Algebra and Logic Gates

XOR - XNOR Gates. The graphic symbol and truth table of XOR gate is shown in the figure.

Chapter 5. Digital systems. 5.1 Boolean algebra Negation, conjunction and disjunction

EC-121 Digital Logic Design

Chapter 2 Boolean Algebra and Logic Gates

Slide Set 3. for ENEL 353 Fall Steve Norman, PhD, PEng. Electrical & Computer Engineering Schulich School of Engineering University of Calgary

ENG2410 Digital Design Combinational Logic Circuits

Digital Logic Appendix A

Digital Electronics H H

Boolean Algebra. Digital Logic Appendix A. Postulates, Identities in Boolean Algebra How can I manipulate expressions?

ELCT201: DIGITAL LOGIC DESIGN

EECS150 - Digital Design Lecture 19 - Combinational Logic Circuits : A Deep Dive

COMBINATIONAL LOGIC FUNCTIONS

UC Berkeley College of Engineering, EECS Department CS61C: Representations of Combinational Logic Circuits

CS/COE0447: Computer Organization

Hardware Design I Chap. 2 Basis of logical circuit, logical expression, and logical function

Review: Additional Boolean operations

Systems I: Computer Organization and Architecture

2009 Spring CS211 Digital Systems & Lab CHAPTER 2: INTRODUCTION TO LOGIC CIRCUITS

Appendix A: Digital Logic. Principles of Computer Architecture. Principles of Computer Architecture by M. Murdocca and V. Heuring

Ch 2. Combinational Logic. II - Combinational Logic Contemporary Logic Design 1

Chapter 4. Combinational: Circuits with logic gates whose outputs depend on the present combination of the inputs. elements. Dr.

2 Application of Boolean Algebra Theorems (15 Points - graded for completion only)

Boolean Algebra. Digital Logic Appendix A. Boolean Algebra Other operations. Boolean Algebra. Postulates, Identities in Boolean Algebra

ECE/CS 250 Computer Architecture

EE 209 Spiral 1 Exam Solutions Name:

CS61c: Representations of Combinational Logic Circuits

Synchronous Sequential Logic

Written reexam with solutions for IE1204/5 Digital Design Monday 14/

PART-A. 2. Expand ASCII and BCD ASCII American Standard Code for Information Interchange BCD Binary Coded Decimal

WORKBOOK. Try Yourself Questions. Electrical Engineering Digital Electronics. Detailed Explanations of

Chapter 2: Boolean Algebra and Logic Gates

10/14/2009. Reading: Hambley Chapters

Review. EECS Components and Design Techniques for Digital Systems. Lec 06 Minimizing Boolean Logic 9/ Review: Canonical Forms

WEEK 2.1 BOOLEAN ALGEBRA

Chapter 2. Boolean Algebra and Logic Gates

Logic. Combinational. inputs. outputs. the result. system can

Time Allowed 3:00 hrs. April, pages

Transcription:

CSC9R6 Computer Design Practical Digital Logic 1

References (for this part of CSC9R6) Hamacher et al: Computer Organization App A. In library Floyd: Digital Fundamentals Ch 1, 3-6, 8-10 web page: www.prenhall.com/floyd/ Mano: Computer System Architecture Ch 1 and 2 Green: Digital Electronics Ch 1, 3-11 Tools Digital Works Electronics Workbench CSC9R6 Computer Design. Spring 2006 Slide 2

What s it all about? Computers manipulate information (already seen - Brookshear machine, programming languages, application programs) This part of the course looks at the hardware operations of a computer system can mean CPU, I/0, RAM, devices anything with a circuit or chip Specifically, we look at computer organisation the way basic hardware components work the way they are connected together CSC9R6 Computer Design. Spring 2006 Slide 3

Binary Information How is data represented inside a digital computer? Using groups of digits (bits) in the binary number system (0 to 1 - very reliable) At an even lower level, binary information is physically represented By electrical signals (logic levels HIGH and LOW) e.g. in TTL 2-5 volts = 1 and 0-0.8 volts = 0 The digital circuits accept signals of this type and produce signals of this type. CSC9R6 Computer Design. Spring 2006 Slide 4

Waveforms Voltage levels constantly change back and forth from 0 to 1 during processing. This gives a digital waveform. A Positive Pulse is when a logic level switches from 0 to 1 and back to 0. (So a Negative pulse is?) HIGH rising or leading edge falling or trailing edge HIGH falling or leading edge rising or trailing edge LOW LOW t 0 t 1 t 0 t 1 Ideal pulses - change happens instantaneously. CSC9R6 Computer Design. Spring 2006 Slide 5

Periodic Pulses Often in a digital system the waveform is a series of pulses. E.g. the clock 1 0 A waveform carries information 1 0 For example, 1010011010 CSC9R6 Computer Design. Spring 2006 Slide 6

Timing Diagrams A timing diagram is a graph of digital waveforms showing the relationship between the waveforms. Clock 1 2 3 4 5 6 7 8 A B C CSC9R6 Computer Design. Spring 2006 Slide 7

Gates (Logic Operations) Binary information is manipulated and processed through gates Gates are the hardware embodiment of particular functions - for a given gate certain patterns of input signals produce certain patterns of output. CSC9R6 Computer Design. Spring 2006 Slide 8

Gates Gates have several representations: A graphic symbol (syntax really) A name (more syntax) A function (semantics) Boolean algebra (familiar from 3111) Algebraic expression (uses literals and logic ops) A truth table (shows all possible inputs and output) We're going to see all of them! Each is important for different tasks. CSC9R6 Computer Design. Spring 2006 Slide 9

AND Algebraically Truth Table x = A.B or x = AB A B x 0 0 0 0 1 0 1 0 0 Pictorially 1 1 1 i.e. true if both inputs are true You can think of 1 (HIGH) as TRUE and 0 (LOW) as FALSE (because AND is just the familiar Boolean AND) CSC9R6 Computer Design. Spring 2006 Slide 10

AND (there s more) AND can also be extended to more inputs x = A.B.C Truth Table A B C x 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1 Only outputs a 1 if all inputs are 1 CSC9R6 Computer Design. Spring 2006 Slide 11

OR x = A + B Truth table A B x 0 0 0 0 1 1 1 0 1 1 1 1 CSC9R6 Computer Design. Spring 2006 Slide 12

NOT x = A' also written x = A Truth table A x 0 1 1 0 CSC9R6 Computer Design. Spring 2006 Slide 13

NAND (Not AND) x = (A.B) ' Truth Table A B x [AND was] 0 0 1 0 0 1 1 0 1 0 1 0 1 1 0 1 NAND is a universal gate CSC9R6 Computer Design. Spring 2006 Slide 14

NOR (Not OR) x = (A + B) ' Truth table A B x [OR was] 0 0 1 0 0 1 0 1 1 0 0 1 1 1 0 1 NOR is a universal gate CSC9R6 Computer Design. Spring 2006 Slide 15

XOR (Exclusive OR) x = (A + B).(A.B) ' Truth Table = A.B' + A'.B A B x 0 0 0 0 1 1 1 0 1 1 1 0 either A or B but not both. CSC9R6 Computer Design. Spring 2006 Slide 16

Putting it Together Using different notations also allows us to design in a convenient way (algebra) and translate to hardware, or to take a circuit and determine its function. CSC9R6 Computer Design. Spring 2006 Slide 17

Example 1 Start with a circuit F = (A+B) ' + (A.C ') A B C (A+B) ' A.C' F 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 CSC9R6 Computer Design. Spring 2006 Slide 18

Example 2 Start with an expression X = A.B. (C.D ' + E.F) CSC9R6 Computer Design. Spring 2006 Slide 19

Putting it together From these simple components more complex circuits can be built to carry out essential functions. Eg. comparison - comparator arithmetic - adder, ALU code conversion encoding - encoder decoding - decoder data selection - multiplexer, demultiplexer storage - flip-flops, registers counting - counter Small and medium sized integration - circuits of < 100 gates CSC9R6 Computer Design. Spring 2006 Slide 20

Boolean Algebra How to play around with the algebraic representation of a circuit. Why? - because it can lead us to better designs efficient cheaper smaller CSC9R6 Computer Design. Spring 2006 Slide 21

Example F = B.((A+B').(B+C)) But F is also A.B A B C A+B B+C (A+B').(B+C) F 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 A.B Needs 2 AND gates, 2 OR gates, 1 NOT gate, therefore is expensive. We can show this using Boolean algebra (later) CSC9R6 Computer Design. Spring 2006 Slide 22

Laws for OR Basic laws for manipulating expressions using OR (+) OR1 A + 1 = 1 OR2 A + 0 = A OR3 A + A = A OR4 A + A' = 1 Illustration of 1 and 2 CSC9R6 Computer Design. Spring 2006 Slide 23

Laws for AND Basic laws for manipulating expressions using AND (.) AND1 A.1 = A AND2 A.0 = 0 AND3 A.A = A AND4 A.A' = 0 Illustration of 1 and 2 CSC9R6 Computer Design. Spring 2006 Slide 24

Laws for NOT Basic law for manipulating expressions using NOT (') NOT (A')' = A CSC9R6 Computer Design. Spring 2006 Slide 25

Commutative laws It doesn't matter which order the inputs are in. AND A.B = B.A OR A + B = B + A CSC9R6 Computer Design. Spring 2006 Slide 26

Associative laws It doesn t matter where the brackets are. AND (A.B).C = A.(B.C) OR (A + B) + C = A + (B + C) So, often we leave out the brackets. Note: this only works if they're all the same operator! e.g. (A.B) + C A.(B + C) CSC9R6 Computer Design. Spring 2006 Slide 27

Distributive laws Changing the top level operator. DIST1 (A.B) + C = (A + C).(B + C) DIST2 (A + B).C = (A.C) + (B.C) DIST3 A.(B + C) = A.B + A.C CSC9R6 Computer Design. Spring 2006 Slide 28

De Morgan's Laws Very important!! How to distribute a NOT inside a bracket. DM 1 (A + B)' = A'.B' DM 2 (A.B)' = A' + B' Why care about De Morgan's laws? Because we can turn an AND into an OR and vice versa. So if we only want one kind of gate (particularly NAND or NOR gates) in a circuit then De Morgan's laws help us derive that circuit. CSC9R6 Computer Design. Spring 2006 Slide 29

Absorption Theorems ABS1 A + (A.B) = A Proof of ABS1 ABS2 A.(A + B) = A goes here You can also verify by truth table A B A + B A.(A + B) 0 0 0 0 0 1 1 0 1 0 1 1 1 1 1 1 Proof of ABS2 goes here CSC9R6 Computer Design. Spring 2006 Slide 30

More absorption A + (A'.B) = A + B proof goes here A.(A' + B) = A.B proof goes here CSC9R6 Computer Design. Spring 2006 Slide 31

Applying Boolean Algebra: Example Show (X + Y).(X' + Y') = ((X + Y)' + (X' + Y')')' To give a NOR gate implementation Let Z = (X + Y).(X' + Y') then (Z')' = (((X + Y).(X' + Y'))')' NOT = ((X + Y)' + (X' + Y')')' DM2 CSC9R6 Computer Design. Spring 2006 Slide 32

Going even further! We can even remove the NOT gates. making use of the equivalence A ' = (A + A) ' CSC9R6 Computer Design. Spring 2006 Slide 33

Example (cont.) An alternative derivation: Z= = X'.Y + X.Y' Depends what kind of gates you want to use. CSC9R6 Computer Design. Spring 2006 Slide 34

Complementation and De Morgan's laws Complement of A is A'; complement of A' is A (where A is any Boolean expression). Transformation using De Morgan's laws to obtain the complement of any expression. Substitute AND for OR and vice versa, and complement every literal. E.g. (A.B)' = A' + B' (A + B) ' = A'.B' We ll come back to Boolean algebra again. CSC9R6 Computer Design. Spring 2006 Slide 35

Combinational Logic Systems Definition: A Combination Logic System (CLS) is a binary digital 'black box' system with a set of inputs and a set of outputs. Its outputs depend only on its currents inputs (and not on the history of the system - there is no feedback) inputs CLS outputs A major part of digital electronic design is the construction of more complex CLSs using the fundamental gates as building blocks. CSC9R6 Computer Design. Spring 2006 Slide 36

Description of a CLS The operation of a CLS is completely described by its input/output relationship. This describes the value of the output for each and every possible combination of the inputs to the system. Two ways to do this: Truth table Boolean algebra CSC9R6 Computer Design. Spring 2006 Slide 37

Truth Table for a CLS Consider a CLS with N inputs and M outputs. There are 2 N possible combinations of inputs and therefore 2 N rows in the truth table. For each row M columns are required (one for each of the M outputs). Example 3 inputs (A, B, C), 2 outputs (X, Y). A B C CLS X Y 2 3 rows = 8 rows 3 columns for inputs, 2 columns for outputs in each row. CSC9R6 Computer Design. Spring 2006 Slide 38

Example (cont.) A B C X Y 0 0 0 1 1 0 0 1 1 1 0 1 0 1 1 0 1 1 0 1 1 0 0 0 1 1 0 1 0 1 1 1 0 0 1 1 1 1 1 0 X and Y outputs depend on the particular CLS being described. A value for each of X and Y is required for every possible combination of inputs. Consider more inputs - Tedious!! A more compact description of the CLS is obtained using Boolean algebra (fewer gates = lower cost). CSC9R6 Computer Design. Spring 2006 Slide 39

Boolean Functional Representation of a CLS The operation of the CLS is given by the Boolean expression relating each output of the system to its inputs. Example (I/O as before) A B C CLS X Y Let output X be F x = (A'.B')+(A'.C')+A.B.C Let output Y be F y = (A.B.C) ' How do we move between the two representations? CSC9R6 Computer Design. Spring 2006 Slide 40

Truth Table to Boolean Function Consider an N input, single output system. Step 1: Identify the rows in the truth table that give 1 at the output. Step 2: For each such row, write an expression containing all literals. Eg. A B C X...... Step 3: 0 0 1 1 A'.B'.C Combine each such expression with the others using '+'. This is a Boolean representation of the CLS. CSC9R6 Computer Design. Spring 2006 Slide 41

Example A B C X 0 0 0 1 0 0 1 1 0 1 0 1 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1 F x =???? This form of Boolean expression has a special name: The canonical sum of products form (CSOP) Because it is the 'OR' of a set of 'AND' terms, and each 'AND' term contains all of the input literals or their complements. Each 'AND' term is called a minterm CSC9R6 Computer Design. Spring 2006 Slide 42

Implementation of CSOP The CSOP form suggests that the CLS is realised by a circuit consisting of a collection of 'AND' gates followed by a multiinput 'OR' gate. Each 'AND' gate implements a minterm, and the 'OR' gate gives the final output. E.g. CSC9R6 Computer Design. Spring 2006 Slide 43

Example CSC9R6 Computer Design. Spring 2006 Slide 44

Conversion to NAND only The CSOP form may be written as F x = M 1 + M 2 + M 3 +.. where M i are the minterms. Therefore (F x )' = (M 1 + M 2 + M 3 +..)' ((F x )')' = M 1 '.M 2 '.M 3 '... DM1 = (M 1 '.M 2 '.M 3 '...)' F x = (M 1 '.M 2 '.M 3 '...)' NOT i.e. NAND representation (instead of using the OR gate of the previous implementation) Not only that, but each minterm is also implemented by a NAND gate CSC9R6 Computer Design. Spring 2006 Slide 45

Example E.g. let minterm M I = A'.B'.C Then we have CSC9R6 Computer Design. Spring 2006 Slide 46

Design of a CLS So design of a CLS has 5 steps: 1. Statement of the problem 2. Assign I/O variables to letter symbols 3. Derive a truth table defining the relationship between inputs and outputs 4. Derive the Boolean functions for each output 5. Draw the circuit diagram CSC9R6 Computer Design. Spring 2006 Slide 47

Example: Half Adder Basic function - add two bits together: (weird name because in full adder you also consider the carry - so add 3 bits together) Variables Input: A, B Output: S(sum), C(carry) Truth Table A B S C 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1 CSC9R6 Computer Design. Spring 2006 Slide 48

Half Adder (2) Boolean functions for S and C (in CSOP) S = A'.B + A.B' C = A.B Desired circuit is CSC9R6 Computer Design. Spring 2006 Slide 49

Half Adder (3) Could also convert to NAND form S' = (A'.B + A.B')' C = ((A.B)')' = (A'.B)'.(A.B')' S = (S')' = ((A'.B)'.(A.B')')' To implement complement using NAND, note A' = (A.A)' CSC9R6 Computer Design. Spring 2006 Slide 50

Half Adder and Full Adder These components are available as macros in DW. Schematic is Called a half adder because doesn't perform full adding function, but ok for LSB - no carry-in. Full Adder Required for other than LSB CSC9R6 Computer Design. Spring 2006 Slide 51

Boolean expression to truth table Given a function F x, first expand to CSOP form F x = (A+B).C' = A.C' + B.C' DISTR = (A.C'.1) + (B.C'.1) AND1 = (A.C'.(B +B')) + (B.C'.(A + A')) OR4 = A.B.C' + A.B'.C'. + A.B.C' + A'.B.C' DISTR = A.B.C' + A.B'.C'. + A'.B.C' OR3 Then mark a 1 in the appropriate row. A B C X 0 0 0 0 0 0 1 0 0 1 0 1 0 1 1 0 1 0 0 1 1 0 1 0 1 1 0 1 1 1 1 0 CSC9R6 Computer Design. Spring 2006 Slide 52