CHW 261: Logic Design

Similar documents
CHW 261: Logic Design

LOGIC CIRCUITS. Basic Experiment and Design of Electronics. Ho Kyung Kim, Ph.D.

LOGIC CIRCUITS. Basic Experiment and Design of Electronics

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

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

SAU1A FUNDAMENTALS OF DIGITAL COMPUTERS

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

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

PGT104 Digital Electronics. PGT104 Digital Electronics

Chapter 7. Sequential Circuits Registers, Counters, RAM

EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits

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

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

Design of Sequential Circuits


Lecture 2 Review on Digital Logic (Part 1)

S.Y. Diploma : Sem. III [CO/CM/IF/CD/CW] Digital Techniques

UNIVERSITI TENAGA NASIONAL. College of Information Technology

KUMARAGURU COLLEGE OF TECHNOLOGY COIMBATORE

Digital Electronics Circuits 2017

Department of Electrical & Electronics EE-333 DIGITAL SYSTEMS

Fundamentals of Boolean Algebra

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) State any two Boolean laws. (Any 2 laws 1 mark each)

Fundamentals of Digital Design

Reg. No. Question Paper Code : B.E./B.Tech. DEGREE EXAMINATION, NOVEMBER/DECEMBER Second Semester. Computer Science and Engineering

Section 3: Combinational Logic Design. Department of Electrical Engineering, University of Waterloo. Combinational Logic

CHAPTER 7. Exercises 17/ / /2 2 0

DIGITAL LOGIC CIRCUITS

Vidyalankar S.E. Sem. III [EXTC] Digital Electronics Prelim Question Paper Solution ABCD ABCD ABCD ABCD ABCD ABCD ABCD ABCD = B

SIR C.R.REDDY COLLEGE OF ENGINEERING ELURU DIGITAL INTEGRATED CIRCUITS (DIC) LABORATORY MANUAL III / IV B.E. (ECE) : I - SEMESTER

Lab 3 Revisited. Zener diodes IAP 2008 Lecture 4 1

MODEL ANSWER SUMMER 17 EXAMINATION Subject Title: Principles of Digital Techniques

ELEN Electronique numérique

Cs302 Quiz for MID TERM Exam Solved

Vidyalankar S.E. Sem. III [INFT] Analog and Digital Circuits Prelim Question Paper Solution

Sample Test Paper - I

Philadelphia University Student Name: Student Number:

Digital Fundamentals

Chapter 7 Logic Circuits

Digital Fundamentals

SUMMER 18 EXAMINATION Subject Name: Principles of Digital Techniques Model Answer Subject Code:

UNIT II COMBINATIONAL CIRCUITS:

Review for Test 1 : Ch1 5

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

DIGITAL LOGIC CIRCUITS

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 9 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

211: Computer Architecture Summer 2016

Digital Logic and Design (Course Code: EE222) Lecture 1 5: Digital Electronics Fundamentals. Evolution of Electronic Devices

Digital Circuits ECS 371

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.

Dept. of ECE, CIT, Gubbi Page 1

Programmable Logic Devices

Schedule. ECEN 301 Discussion #25 Final Review 1. Date Day Class No. 1 Dec Mon 25 Final Review. Title Chapters HW Due date. Lab Due date.

Save from: cs. Logic design 1 st Class أستاذ المادة: د. عماد

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

DE58/DC58 LOGIC DESIGN DEC 2014

Digital Logic Appendix A

3 Logic Function Realization with MSI Circuits

Number System conversions

Digital Logic: Boolean Algebra and Gates. Textbook Chapter 3

Synchronous Sequential Logic

CMPE12 - Notes chapter 1. Digital Logic. (Textbook Chapter 3)

Introduction to Computer Engineering. CS/ECE 252, Fall 2012 Prof. Guri Sohi Computer Sciences Department University of Wisconsin Madison

E40M. Binary Numbers. M. Horowitz, J. Plummer, R. Howe 1

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

Digital System Design Combinational Logic. Assoc. Prof. Pradondet Nilagupta

PAST EXAM PAPER & MEMO N3 ABOUT THE QUESTION PAPERS:

ALU A functional unit

Adders, subtractors comparators, multipliers and other ALU elements

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

of Digital Electronics

Decoding A Counter. svbitec.wordpress.com 1

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

School of Computer Science and Electrical Engineering 28/05/01. Digital Circuits. Lecture 14. ENG1030 Electrical Physics and Electronics

Class Website:

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

Layout of 7400-series Chips Commonly Used in. CDA 3101: Introduction to Computer Hardware and Organization

COE 202: Digital Logic Design Sequential Circuits Part 4. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

Adders, subtractors comparators, multipliers and other ALU elements

Introduction to Computer Engineering. CS/ECE 252, Spring 2017 Rahul Nayar Computer Sciences Department University of Wisconsin Madison

Digital Systems Roberto Muscedere Images 2013 Pearson Education Inc. 1

Fundamentals of Computer Systems

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

Digital Circuits ECS 371. Dr. Prapun Suksompong Latches and Flip-Flops

EECS150 - Digital Design Lecture 23 - FFs revisited, FIFOs, ECCs, LSFRs. Cross-coupled NOR gates

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

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) SUMMER 14 EXAMINATION Model Answer

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

Vidyalankar. S.E. Sem. III [EXTC] Digital System Design. Q.1 Solve following : [20] Q.1(a) Explain the following decimals in gray code form

Fundamentals of Computer Systems

3. Complete the following table of equivalent values. Use binary numbers with a sign bit and 7 bits for the value

CSC9R6 Computer Design. Practical Digital Logic

Digital Electronics Sequential Logic

Hakim Weatherspoon CS 3410 Computer Science Cornell University

CMSC 313 Lecture 25 Registers Memory Organization DRAM

Systems I: Computer Organization and Architecture

Hardware Design I Chap. 4 Representative combinational logic

ELCT201: DIGITAL LOGIC DESIGN

Appendix B. Review of Digital Logic. Baback Izadi Division of Engineering Programs

Transcription:

CHW 26: Logic Design Instructors: Prof. Hala Zayed Dr. Ahmed Shalaby http://www.bu.edu.eg/staff/halazayed4 http://bu.edu.eg/staff/ahmedshalaby4# Slide

Digital Fundamentals Digital Concepts Slide 2

What? Logic Design Logic Design defines the fundamentals of Digital systems, such as computers and cell phones. Slide 3

Digital System ( Why ) Easier to design. Flexibility and functionality. easier to store, transmit and manipulate information. Cheaper device. CD drive 0000 Digital data Digital-to-analog converter Analog reproduction of music audio signal Linear amplifier Speaker Slide 4 Sound waves

Digital and Analog Quantities Analog quantities have continuous values Digital quantities have discrete sets of values Slide 5

Digital System ( Why ) Analog vs. Digital Most natural quantities (such as temperature, pressure, light intensity, ) are analog quantities that vary continuously. Analog = continuous Digital = discrete Digital systems can process, store, and transmit data more efficiently but can only assign discrete values to each point. Slide 6

Transistors: nmos Gate = 0 OFF (no connection between source and drain) Gate = ON (channel between source and drain) source gate drain source gate V DD drain GND n p n substrate n +++++++ - - - - - - - channel p n substrate GND GND Slide 7

Transistor Function g = 0 g = nmos g d s d s OFF d s ON pmos g s d s d ON s d OFF Slide 8

CMOS Gates: NOT Gate A NOT Y V DD Y = A A Y 0 0 A P N Y 0 ON OFF OFF ON 0 A P Y N GND Slide 9

Logic Gates NAND A B NAND Y = AB Y A B P2 P N N2 Y A B Y 0 0 0 0 0 A B P P2 N N2 Y 0 0 ON ON OFF OFF 0 ON OFF OFF ON 0 OFF ON ON OFF OFF OFF ON ON 0 Slide 0

Logic Gates AND A B Y V DD A P2 P N Y A P Y N B N2 GND Slide

Digital Fundamentals Number Systems, Operations, and Codes Slide 2

Binary Numbers For digital systems, the binary number system is used. Binary has a radix of two and uses the digits 0 and to represent quantities. The column weights of binary numbers are powers of two that increase from right to left beginning with 2 0 =: 2 5 2 4 2 3 2 2 2 2 0. For fractional binary numbers, the column weights are negative powers of two that decrease from left to right: 2 2 2 2 0. 2-2 -2 2-3 2-4 Slide 3

Decimal Vs. Binary A binary counting sequence for numbers from zero to fifteen is shown. Notice the pattern of zeros and ones in each column. Digital counters frequently have this same pattern of digits: Counter 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Decoder Decimal Number Binary Number 0 0 0 0 0 0 0 0 2 0 0 0 3 0 0 4 0 0 0 5 0 0 6 0 0 7 0 8 0 0 0 9 0 0 0 0 0 0 2 0 0 3 0 4 0 5 Slide 4

Binary Arithmetic Binary Addition The rules for binary addition are 0 + 0 = 0 0 + = Sum = 0, carry = 0 Sum =, carry = 0 + 0 = Sum =, carry = 0 + = 0 Sum = 0, carry = 0 00 7 00 2 00 = 28 Slide 5

Binary Subtraction Binary Arithmetic The rules for binary subtraction are 0-0 = 0 - = 0-0 = 0 - = with a borrow of Subtract the binary number 00 from 00 and show the equivalent decimal subtraction. 00 / / / 00 2 7 00 = 4 Slide 6

Binary Multiplication Binary Arithmetic Partial products formed by multiplying a single digit of the multiplier with multiplicand. Shifted partial products summed to form result. Decimal 230 x 42 460 + 920 9660 multiplicand multiplier partial products result + Binary 00 x 0 00 00 00 0000 0000 230 x 42 = 9660 5 x 7 = 35 Slide 7

Signed Binary Numbers Signed Numbers There are several ways to represent signed binary numbers. In all cases, the MSB in a signed number is the sign bit, that tells you if the number is positive or negative. Computers use a modified 2 s complement for signed numbers. Positive numbers are stored in true form (with a 0 for the sign bit) and negative numbers are stored in complement form (with a for the sign bit). Sign bit For example, the positive number 58 is written using 8-bits as 0000 (true form). Magnitude bits The sign bit is the left-most bit in a signed binary number Slide 8

Arithmetic Operations with Signed Numbers - Overflow Arithmetic Operations with Signed Numbers Note that if the number of bits required for the answer is exceeded, overflow will occur. This occurs only if both numbers have the same sign. The overflow will be indicated by an incorrect sign bit. Two examples are: 0000000 = +28 000000 = +29 000000 = -26 Discard carry 000000 = -27 000000 = -27 0000000 = +2 Wrong! The answer is incorrect and the sign bit has changed. Slide 9

Arithmetic Operations with Signed Numbers Signs for Addition When both numbers are positive, the sum is positive. When both numbers are negative, the sum is negative (2 s complement form). The carry bit is discarded. When the larger number is positive and the smaller is negative, the sum is positive. The carry is discarded. When the larger number is negative and the smaller is positive, the sum is negative (2 s complement form). Slide 20

Digital Numbers Representations Hexadecimal Numbers Hexadecimal is a weighted number system. The column weights are powers of 6, which increase from right to left. Octal Numbers Octal is also a weighted number system. The column weights are powers of 8, which increase from right to left. BCD Binary coded decimal (BCD) is a weighted code that is commonly used in digital systems when it is necessary to show decimal numbers such as in clock displays. Slide 2

Digital Codes Gray code Gray code is an unweighted code that has a single bit change between one code word and the next in a sequence. Gray code is used to avoid problems in systems where an error can occur if more than one bit changes at a time. ASCII ASCII is a code for alphanumeric characters and control characters. In its original form, ASCII encoded 28 characters and symbols using 7-bits. The first 32 characters are control characters, that are based on obsolete teletype requirements, so these characters are generally assigned to other functions in modern usage. Slide 22

Parity error codes Parity Method The parity method is a method of error detection for simple transmission errors involving one bit (or an odd number of bits). A parity bit is an extra bit attached to a group of bits to force the number of s to be either even (even parity) or odd (odd parity). The parity can detect up to One bit error and can t correct the error. Slide 23

Hamming error codes Hamming code can detect up to 2 bits and correct bit error. Hex equivalent of the data bits 0000000 0000 000 000 0000 000 000 0000 000 0000 0000 000 0000 000 000 0 2 3 4 5 6 7 8 9 A B C D E F Slide 24

Signed Fixed-Point Numbers Representations: Sign/magnitude Two s complement Example: Represent -7.5 0 using 4 integer and 4 fraction bits Sign/magnitude: 000 s complement: 0000 2 s complement: 0000. +7.5: 0000 2. Invert bits: 0000 3. Add to lsb: + 000000 Slide 25

Signed Fixed-Point Numbers Number System Range Unsigned [0, 2 N -] Sign/Magnitude [-(2 N- -), 2 N- -] Two s Complement [-2 N-, 2 N- -] For example, 4-bit representation: -8-7 -6-5 -4-3 -2-0 2 3 4 5 6 7 8 9 0 2 3 4 5 Unsigned 0000 000 000 00 000 00 00 0 000 00 00 0 00 0 0 000 00 00 0 00 0 0 0000 000 000 00 000 00 00 0 Two's Complement 0 0 00 0 00 00 0000 000 000 00 000 00 00 0 000 Sign/Magnitude Slide 26

Floating-Point Numbers bit 8 bits 23 bits Sign Exponent Mantissa In general, a number is written in scientific notation as: M = mantissa B = base E = exponent ± M B E IEEE 754 - floating-point standard Slide 27

Single-Precision: 32-bit Floating-Point Precision sign bit, 8 exponent bits, 23 fraction bits bias = 27 Double-Precision: 64-bit sign bit, exponent bits, 52 fraction bits bias = 023 bit 8 bits 23 bits 0 00000 0 000 0000 0000 0000 0000 Sign Biased Exponent Fraction Slide 28

Digital Fundamentals Logic Gates Slide 29

Logic Gates A BUF Y A NOT Y A B AND Y A B OR Y Y = A Y = A Y = AB Y = A + B A Y 0 0 A Y 0 0 A B Y 0 0 0 0 0 0 0 A B Y 0 0 0 0 0 Slide 30

Logic Gates XOR NAND NOR XNOR A B Y A B Y A B Y A B Y Y = A + B Y = AB Y = A + B Y = A + B A B Y 0 0 0 0 0 0 A B Y 0 0 0 0 0 A B Y 0 0 0 0 0 0 0 A B Y 0 0 0 0 0 0 Slide 3

Digital Fundamentals Boolean Algebra and Logic Simplification Slide 32

Commutative Laws Laws Boolean Algebra The commutative laws are applied to addition and multiplication. For addition, the commutative law states In terms of the result, the order in which variables are ORed makes no difference. A + B = B + A For multiplication, the commutative law states In terms of the result, the order in which AB = BA variables are ANDed makes no difference. Slide 33

Laws Boolean Algebra Associative Laws The associative laws are also applied to addition and multiplication. For addition, the associative law states A + (B +C) = (A + B) + C For multiplication, the associative law states A(BC) = (AB)C Slide 34

Distributive Law Laws Boolean Algebra The distributive law is the factoring law. A common variable can be factored from an expression just as in ordinary algebra. That is A(B+ C) = AB + AC Slide 35

Rules of Boolean Algebra. A + 0 = A 2. A + = 3. A. 0 = 0 4. A. = A 5. A + A = A 6. A + A = 7. A. A = A 8. A. A = 0 = 9. A = A 0. A + AB = A. A + AB = A + B 2. (A + B)(A + C) = A + BC Slide 36

DeMorgan s Theorem DeMorgan s Theorem Theorem Theorem 2 XY X X Y Y XY Apply DeMorgan s theorem to remove the overbar covering both terms from the expression X = C + D. To apply DeMorgan s theorem to the expression, you can break the overbar covering both terms and change the sign between the terms. This results in X = C =. D. Deleting the double bar gives X = C. D. Slide 37

Digital Fundamentals Combinational Logic Analysis Slide 38

Boolean Analysis of Logic Circuits SOP and POS forms Boolean expressions can be written in the sum-of-products form (SOP) or in the product-of-sums form (POS). These forms can simplify the implementation of combinational logic, particularly with PLDs. In both forms, an overbar cannot extend over more than one variable. An expression is in SOP form when two or more product terms are summed as in the following examples: A B C + A B A B C + C D C D + E An expression is in POS form when two or more sum terms are multiplied as in the following examples: (A + B)(A + C) (A + B + C)(B + D) (A + B)C Slide 39

Combinational Logic Analysis Combinational Logic Circuits When the output of a SOP form is inverted, the circuit is called an AND-OR-Invert (AOI) circuit. The AOI configuration lends itself to product-of-sums (POS) implementation. An example of an AOI implementation is shown. The output expression can be changed to a POS expression by applying DeMorgan s theorem twice. A B ABC C X = ABC + DE X = ABC + DE AOI D E DE X = (ABC)(DE) DeMorgan X = (A + B + C)(D + E) POS Slide 40

Karnaugh maps Boolean Analysis of Logic Circuits The Karnaugh map (K-map) is a tool for simplifying combinational logic with 3 or 4 variables. For 3 variables, 8 cells are required (2 3 ). The map shown is for three variables labeled A, B, and C. Each cell represents one possible product term. Each cell differs from an adjacent cell by only one variable. 3-Variable Karnaugh Map Slide 4

Karnaugh maps Boolean Analysis of Logic Circuits K-maps can simplify combinational logic by grouping cells and eliminating variables that change. Group the s on the map and read the minimum logic. B changes across this boundary AB C 00 0 0 0 C changes across this boundary. Group the s into two overlapping groups as indicated. 2. Read each group by eliminating any variable that changes across a boundary. 3. The vertical group is read AC. 4. The horizontal group is read AB. X = AC +AB Slide 42

Universal Gates Combinational Logic Analysis NAND gates are sometimes called universal gates because they can be used to produce the other basic Boolean functions. Inputs Output A B X 0 0 0 0 0 A A A B AB Inverter AND gate A B A + B A B A + B OR gate NOR gate Slide 43

Universal Gates Combinational Logic Analysis NOR gates are also universal gates and can form all of the basic gates. Inputs Output A B X 0 0 0 0 0 0 0 A A A B A + B Inverter OR gate A AB A AB B B AND gate NAND gate Slide 44

Combinational Logic Analysis Circuit: C C A B changes across this boundary AB AB C A B X = A C + A B AB AB C changes across this boundary A C A B A C + A B Recall from Boolean algebra that double inversion cancels. By adding inverting bubbles to above circuit, it is easily converted to NAND gates. X = Slide 45

A C A B NAND Logic Combinational Logic Analysis Recall from DeMorgan s theorem that AB = A + B. By using equivalent symbols, it is simpler to read the logic of SOP forms. The earlier example shows the idea: X = A C + A B The logic is easy to read if you (mentally) cancel the two connected bubbles on a line. Inputs Output A B AB A + B 0 0 0 0 0 0 A B AB A B A + B NAND Negative-OR Slide 46

A B A C NOR Logic Combinational Logic Analysis Alternatively, DeMorgan s theorem can be written as A + B = AB. By using equivalent symbols, it is simpler to read the logic of POS forms. For example, X = (A + B)(A + C) Again, the logic is easy to read if you cancel the two connected bubbles on a line. A B A + B Inputs Output A B A + B AB 0 0 0 0 0 0 0 0 0 0 A B AB Slide 47 NOR Negative-AND

Combinational and Sequential A combinational logic circuit is a circuit whose output depends only on the circuit s current inputs. Has no memory of the past. Gates, Comparator, Decoders, Encoders, MUXs, DEMUXs, Adders A sequential logic circuit is a circuit whose output may depend on the circuit s previous states as well as its current inputs. Has a memory. Latches, FlipFlops, Counters, Shift registers, Memories. Slide 48

Digital Fundamentals Functions of Combinational Logic Slide 49

Half-Adder Combinational Logic - Basic Adders Basic rules of binary addition are performed by a half adder, which has two binary inputs (A and B) and two binary outputs (Carry out and Sum). Slide 50

Full-Adder Combinational Logic - Basic Adders By contrast, a full adder has three binary inputs (A, B, and Carry in) and two binary outputs (Carry out and Sum). Slide 5

Full-Adder Combinational Logic - Basic Adders A full-adder can be constructed from two half adders as shown: Slide 52

Combinational Logic - Parallel Binary Adders Parallel Adders Full adders are combined into parallel adders that can add binary numbers with multiple bits. A 4-bit adder is shown. A 4 B 4 A 3 B 3 A 2 B 2 A B C 0 A B C in A B C in A B C in A B C in C out S C out S C out S C out S C 4 C 3 S 4 C S 3 The output carry (C 4 ) is not ready until it propagates through all of the full adders. This is called ripple carry, delaying the addition process. Slide 53 C 2 S 2 S

Comparators Combinational Logic - Comparators The function of a comparator is to compare the magnitudes of two binary numbers to determine the relationship between them. In the simplest form, a comparator can test for equality using XNOR gates. The output is when the inputs are equal Slide 54

Combinational Logic - Decoders Decoders A decoder is a logic circuit that detects the presence of a specific combination of bits at its input. Two simple decoders that detect the presence of the binary code 00 are shown. The first has an active HIGH output; the second has an active LOW output. A 0 A X A 0 A X A 2 A 2 A 3 A 3 Active HIGH decoder for 00 Active LOW decoder for 00 Slide 55

Encoders Combinational Logic - Encoders An encoder accepts an active logic level on one of its inputs and converts it to a coded output, such as BCD or binary. The decimal to BCD is an encoder with an input for each of the ten decimal digits and four outputs that represent the BCD code for the active digit. The basic logic diagram is shown. There is no zero input because the outputs are all LOW when the input is zero. Slide 56 2 3 4 5 6 7 8 9 A 0 A A 2 A 3

Combinational Logic Code Converter Code Converters There are various code converters that change one code to another. Two examples are the four bit binary-to-gray converter and the Gray-to-binary converter. Show the conversion of binary 0 to Gray and back. 0 LSB 0 LSB 0 0 0 0 MSB 0 0 MSB Binary-to-Gray Gray-to-Binary Slide 57

Multiplexers Combinational Logic Multiplexer A multiplexer (MUX) selects one data line from two or more input lines and routes data from the selected line to the output. The particular data line that is selected is determined by the select inputs. Slide 58

Combinational Logic DeMultiplexer Demultiplexers A demultiplexer (DEMUX) performs the opposite function from a MUX. It switches data from one input line to two or more data lines depending on the select inputs. Slide 59

Functions of Combinational Logic Parity Generators/Checkers Parity is an error detection method that uses an extra bit appended to a group of bits to force them to be either odd or even. In even parity, the total number of ones is even; in odd parity the total number of ones is odd. Slide 60

Digital Fundamentals Latches, Flip-Flops and Timers Slide 6

Latches Latches A latch is a temporary storage device that has two stable states (bistable). It is a basic form of memory. The S-R (Set-Reset) latch is the most basic type. It can be constructed from NOR gates or NAND gates. With NOR gates, the latch responds to active-high inputs. With NAND gates, the latch responds to active-low inputs. R Q S Q S Q NOR Active-HIGH Latch R Q NAND Active-LOW Latch Slide 62

Active-HIGH S-R Latch Latches Slide 63

Active-LOW S-R Latch Latches Slide 64

Latches Gated Latches A gated latch is a variation on the basic latch. The gated latch has an additional input, called enable (EN) that must be HIGH in order for the latch to respond to the S and R inputs. S EN R 0 Q Q Show the Q output with relation to the input signals. Assume Q starts LOW. Keep in mind that S and R are only active when EN is HIGH. S R EN Q Slide 65

Latches Latches The D latch is an variation of the S-R latch but combines the S and R inputs into a single D input as shown: D Q D Q EN EN Q Q Inputs Outputs A simple rule for the D latch is: Q follows D when the Enable is active. D 0 X EN 0 Q 0 Q 0 Q 0 Q 0 Comments RESET SET No change Slide 66

Edge-Triggered Flip-Flops Flip-flops The truth table for a positive-edge triggered D flip-flop shows an up arrow to remind you that it is sensitive to its D input only on the rising edge of the clock; otherwise it is latched. The truth table for a negative-edge triggered D flip-flop is identical except for the direction of the arrow. Inputs Outputs Inputs Outputs D CLK Q Q Comments D CLK Q Q Comments 0 SET 0 0 RESET 0 SET 0 0 RESET (a) Positive-edge triggered (b) Negative-edge triggered Slide 67

Edge-Triggered Flip-Flops Edge-triggered D flip-flop Slide 68

Edge-Triggered Flip-Flops Flip-flops The J-K flip-flop is more versatile than the D flip flop. In addition to the clock input, it has two inputs, labeled J and K. When both J and K =, the output changes states (toggles) on the active clock edge (in this case, the rising edge). Inputs Outputs J K CLK Q Q Comments 0 0 Q 0 Q 0 No change 0 0 RESET 0 0 SET Toggle Q 0 Q 0 Slide 69

Edge-Triggered Flip-Flops Edge-triggered J-K flip-flop J Q Determine the Q output for the J-K flip-flop, given the inputs shown. CLK Notice that the outputs change on the leading edge of the clock. K Q Set Toggle Set Latch CLK J K Q Slide 70

Multivibrator Monostable The monostable or one-shot multivibrator is a device with only one stable state. When triggered, it goes to its unstable state for a predetermined length of time, then returns to its stable state. Slide 7

Multivibrator Astable An astable multivibrator is a device that has no stable states; it changes back and forth (oscillates) between two unstable states without any external triggering. The resulting output is typically a square wave that is used as a clock signal in many types of sequential logic circuits. Slide 72

Digital Fundamentals CHAPTER Counters Slide 73

Counters Counting in Binary A counter can form the same pattern of 0 s and s with logic levels. The first stage in the counter represents the least significant bit notice that these waveforms follow the same pattern as counting in binary. LSB 0 0 0 0 0 0 0 0 0 0 MSB 0 0 0 0 0 Slide 74

Asynchronous binary counter 2-bit Asynchronous binary counter Slide 75

Asynchronous binary counter Asynchronous decade counter Slide 76

Asynchronous binary counter Propagation Delay Asynchronous counters are sometimes called ripple counters, because the stages do not all change together. For certain applications requiring high clock rates, this is a major disadvantage. Notice how delays are cumulative as each stage in a counter is clocked later than the previous stage. CLK Q 0 Q Q 2 2 3 4 Q 0 is delayed by propagation delay, Q 2 by 2 delays and Q 3 by 3 delays. Slide 77

Synchronous binary counter 2-bit Synchronous binary counter Inputs Outputs J K CLK Q Q Comments 0 0 Q 0 Q 0 No change 0 0 RESET 0 0 SET Toggle Q 0 Q 0 Slide 78

Synchronous binary counter Synchronous decade counter This gate detects 00, and causes FF3 to toggle on the next clock pulse. FF0 toggles on every clock pulse. Thus, the count starts over at 0000. Slide 79

A 4-bit Synchronous Binary Counter CLR LOAD D 0 Data inputs D D 2 D 3 CLK ENP ENT Q 0 Data outputs Q Q 2 Q 3 RCO 2 3 4 5 0 2 Clear Preset Count Inhibit Slide 80

Synchronous binary counter Up/Down Synchronous Counters Up counter Q Q0 0 0 0 0 Down counter Q Q0 Q0 0 0 0 0 0 0 An up/down counter is capable of progressing in either direction depending on a control input. Slide 8

Synchronous binary counter Synchronous Counter Design Most requirements for synchronous counters can be met with available ICs. In cases where a special sequence is needed, you can apply a step-by-step design process. Start with the desired sequence and draw a state diagram and nextstate table. The gray code sequence from the text is illustrated: State diagram: Next state table: 00 000 00 Present State Q 2 Q Q 0 Next State Q 2 Q Q 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Slide 82

Synchronous binary counter Synchronous Counter Design The J-K transition table lists all combinations of present output (Q N ) and next output (Q N+ ) on the left. The inputs that produce that transition are listed on the right. Each time a flip-flop is clocked, the J and K inputs required for that transition are mapped onto a K-map. An example of the J 0 map is: Q 2 Q Q 0 00 0 0 0 0 0 X X X X J 0 map Slide 83 Q 2 Q Q 2 Q Output Transitions Q N Q N+ 0 0 0 0 Present State Q 2 Q Q 0 0 0 0 0 0 0 0 0 0 0 0 0 Flip-Flop Inputs J K 0 X X X X 0 Next State Q 2 Q Q 0 0 0 0 0 0 0 0 0 0 0 0 0

Synchronous binary counter Synchronous Counter Design J 0 FF0 FF FF2 J Q 0 Q C C C J 2 Q 2 K 0 Q 0 Q K Q K 2 2 CLK The logic for each input is read and the circuit is constructed. The slide shows the circuit for the gray code counter Slide 84

Digital Fundamentals Shift Registers Slide 85

Shift Registers Basic Shift Register Operations A shift register is an arrangement of flip-flops with important applications in storage and movement of data. Some basic data movements are illustrated here. Data in Data in Data out Data out Data in Data out Serial in/shift right/serial out Serial in/shift left/serial out Parallel in/serial out Data in Data in Data out Data out Serial in/parallel out Parallel in/parallel out Rotate right Rotate left Slide 86

Shift Registers Serial-in/Serial out Shift Register Shift registers are available in IC form or can be constructed from discrete flip-flops. Each clock pulse will move an input bit to the next flip-flop. For example, a is shown as it moves across. Slide 87

Shift Registers Serial in/parallel out Shift Register An application of shift registers is conversion of serial data to parallel form. Slide 88

Shift Registers Parallel in/serial out Shift Register An application of shift registers is conversion of parallel data to serial form. Slide 89

Shift Registers Parallel in/parallel out Shift Register Slide 90

Bidirectional Shift Register Shift Registers Bidirectional shift registers can shift the data in either direction using a RIGHT/LEFT input. Slide 9

Shift Register Counters Shift Registers Inputs Outputs D CLK Q Q Comments 0 SET 0 0 RESET Shift registers can form useful counters by recirculating a pattern of 0 s and s. Two important shift register counters are the Johnson counter and the ring counter. The Johnson counter is useful when you need a sequence that changes by only one bit at a time but it has a limited number of states (2n, where n = number of stages). FF0 FF FF2 FF3 D 0 Q 0 D Q D 2 Q 2 D 3 Q 3 C C C C Q 3 Q 3 CLK The Johnson counter can be made with a series of D flip-flops Slide 92

Ring Counter Shift Registers The ring counter can also be implemented with either D flip-flops or J-K flip-flops. Here is a 4-bit ring counter constructed from a series of D flip-flops. Notice the feedback. CLK FF0 FF FF2 FF3 D 0 Q 0 D Q D 2 D 3 Q 2 Q 3 C C C C Q 3 Like the Johnson counter, it can also be implemented with J-K flip flops. J 0 Q 0 J Q J 2 Q 2 J 3 C FF0 C FF C FF2 C FF3 Q K 0 Q 0 K Q K 2 Q 2 K 3 Q 3 Q 3 Q 3 3 CLK Slide 93

Digital Fundamentals Applications Slide 94

Random Access Memory Applications RAM is for temporary data storage. It is read/write memory and can store data only when power is applied, hence it is volatile. Two categories are static RAM (SRAM) and dynamic RAM (DRAM). Bits stored in a semiconductor latch or flip-flop Static RAM (SRAM) Random- Access Memory (RAM) Dynamic RAM (DRAM) Bits stored as charge on a capacitor Asynchronous SRAM (ASRAM) Synchronous SRAM with burst feature (SB SRAM) Fast Page Mode DRAM (FPM DRAM) Extended Data Out DRAM (EDO DRAM) Burst EDO DRAM (BEDO DRAM) Synchronous DRAM (SDRAM) Slide 95

Applications Memory Units The location of a unit of data in a memory is called the address. In PCs, a byte is the smallest unit of data that can be accessed. In a 2-dimensional array, a byte is accessed by supplying a row number. For example the blue byte is located in row 7. 2 3 4 5 6 7 8 Row Select 0 Row Select Row Select 2 Row Select n Memory cell SRAM uses semiconductor latch memory cells Slide 96 Data Input/Output Buffers and Control

Write Operation Applications The two main memory operations are called read and write. A simplified write operation is shown in which new data overwrites the original data. Data moves to the memory. Address register 0 Data register 0 0 0 0. The address is placed on the address bus. 2. Data is placed on the data bus. 3. A write command is issued. Address bus Address decoder 0 2 3 4 5 6 Byte organized memory array 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 Data bus 7 0 0 0 0 3 Slide 97 Write

Applications Read Operation The read operation is actually a copy operation, as the original data is not changed. The data bus is a two-way path; data moves from the memory during a read operation. Address register 0 Data register 0 0 0 0 0 Address decoder Byte organized memory array. The address is placed on the address bus. 2. A read command is issued. 3. A copy of the data is placed in the data bus and shifted into the data register. Address bus 0 2 3 4 5 6 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 Read 3 Data bus Slide 98

Applications FIFO Memory FIFO means first in-first out. This type of memory is basically an arrangement of shift registers. It is used in applications where two systems communicate at different rates. Memory array stores 64 4-bit data words 64-bit shift register Data input I 0 I I 2 I 3 Input buffers 64-bit shift register 64-bit shift register Output buffer O 0 O O 2 O 3 Data output 64-bit shift register Control lines Control lines Shift in (SI) Input control logic Marker register and controls Output control logic Output ready (OR) Shift out (SO) Slide 99

Programmable Logic Applications Programmable Logic Devices (PLDs) are ICs with a large number of gates and flip flops that can be configured with basic software to perform a specific logic function or perform the logic for a complex circuit. Major types of PLDs are: SPLD: (Simple PLDs) are the earliest type of array logic used for fixed functions and smaller circuits with a limited number of gates. (The PAL and GAL are both SPLDs). CPLD: (Complex PLDs) are multiple SPLDs arrays and interconnection arrays on a single chip. FPGA: (Field Programmable Gate Array) are a more flexible arrangement than CPLDs, with much larger capacity. Slide 00

PALs and GALs Applications All PLDs contain arrays. Two important SPLDs are PALs (Programmable Array Logic) and GALs (Generic Array Logic). A typical array consists of a matrix of conductors connected in rows and columns to AND gates. PALs have a one time programmable (OTP) array, in which fuses are permanently blown, creating the product terms in an AND array. A A B B Simplified AND-OR array X Slide 0

PALs and GALs Applications The GAL (Generic Array Logic) is similar to a PAL but can be reprogrammed. For this reason, they are useful for new product development (prototyping) and for training purposes. GALs were developed by Lattice Semiconductor. They are high speed, extremely fast devices and can interface with both 3.3 V or 5 V logic signals. A A B B X Slide 02

CPLDs Applications A complex programmable logic device (CPLD) has multiple logic array blocks (LABs) that are actually SPLDs on a single IC. LABs are connected via a programmable interconnect array (PIA). Various CPLDs have different structures for these elements. The PIA is the interconnection between the LABs. Logic is fitted to the CPLD and routing is determined by a high-level programming language called a hardware description language (HDL). I/O I/O Logic array block (LAB) SPLD Logic array block (LAB) SPLD PIA Logic array block (LAB) SPLD Logic array block (LAB) SPLD I/O I/O I/O Logic array block (LAB) SPLD Logic array block (LAB) SPLD I/O Slide 03

Macrocells Applications In addition to combination logic, some macrocells have registered outputs available (using programmable flip-flops). This allows the CPLD to perform sequential logic. Parallel expanders from other macrocells Global clear Global clock MUX 5 From I/O Productterm selection matrix MUX 2 MUX PRE D/T Q C EN CLR To I/O V CC MUX 3 Shared expander MUX 4 36 lines from PIA 5 expander product terms from other macrocells Slide 04

FPGAs Applications A field programmable gate array (FPGA) uses a different architecture than a CPLD. The configurable logic block (CLB) is the basic element which is replicated many times. CLBs are arranged in a row and column structure. Within the CLBs are logic modules joined by local interconnects. Generally, the logic modules are composed of a look-up table (LUT), a flip-flop, and a MUX that can be used to bypass the flip-flop for strictly combinational logic. CLB Local interconnect Logic module Logic module Logic module Logic module Global column interconnect CLB Local interconnect Logic module Logic module Logic module Logic module Global row interconnect Slide 05

Applications : Tablet-bottling System Slide 06

Applications: Security Code Logic with Keypad Slide 07

Applications : Elevator controller logic Slide 08

Applications : Digital Clock Slide 09

Applications : Traffic Light Controller Slide 0