BINARY NUMBER SYSTEM electronic circuits that handle information encoded in binary form (deal with signals that have only two values, 0 and 1) Digital.

Slides:



Advertisements
Similar presentations
Digital Circuits.
Advertisements

التصميم المنطقي Second Course
Appendix A Logic Circuits. Logic circuits Operate on binary variables that assume one of two distinct values, usually called 0 and 1 Implement functions.
Multiplexors Sequential Circuits and Finite State Machines Prof. Sin-Min Lee Department of Computer Science.
Sequential Circuit Analysis & Design Dr. Aiman H. El-Maleh Computer Engineering Department King Fahd University of Petroleum & Minerals Dr. Aiman H. El-Maleh.
Combinational Logic Circuits Is the logic circuit where the output always depends on the inputs irrespective of the previous state with out the feed back.
The Map Method Boolean expressions may be simplified by algebraic means as discussed in Previous lecture However, this procedure of minimization is awkward.
Relationship Between Basic Operation of Boolean and Basic Logic Gate The basic construction of a logical circuit is gates Gate is an electronic circuit.
CHAPTER 3 Digital Logic Structures
Contemporary Logic Design Two-Level Logic © R.H. Katz Transparency No. 3-1 Chapter #2: Two-Level Combinational Logic Section 2.1, Logic Functions.
EET 1131 Unit 5 Boolean Algebra and Reduction Techniques
Chapter 12 Digital Logic Circuit Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Boolean Algebra and Logic Simplification
Digital Computer Design Fundamental
Introduction to Digital Logic Design Appendix A of CO&A Dr. Farag
COE 202: Digital Logic Design Sequential Circuits Part 1
Binary Numbers.
1 Fundamentals of Computer Science Propositional Logic (Boolean Algebra)
Lecture 2 – Boolean Algebra Lecturer: Amy Ching Date: 21 st Oct 2002.
Digital Logic Chapter 4 Presented by Prof Tim Johnson
Dept. of Computer Science Engineering Islamic Azad University of Mashhad 1 DIGITAL LOGIC CIRCUITS Dept. of Computer Science Engineering Islamic Azad University.
Dr. Ahmed El-Bialy, Dr. Sahar Fawzy Combinational Circuits Dr. Ahmed El-Bialy Dr. Sahar Fawzy.
BOOLEAN ALGEBRA Saras M. Srivastava PGT (Computer Science)
Logic Design A Review. Binary numbers Binary numbers to decimal  Binary 2 decimal  Decimal 2 binary.
1 DIGITAL ELECTRONICS. 2 OVERVIEW –electronic circuits capable of carrying out logical (boolean) and arithmetic operations on information stored as binary.
1 © 2015 B. Wilkinson Modification date: January 1, 2015 Designing combinational circuits Logic circuits whose outputs are dependent upon the values placed.
Chapter 2Basic Digital Logic1 Chapter 2. Basic Digital Logic2 Outlines  Basic Digital Logic Gates  Two types of digital logic circuits Combinational.
Module 9.  Digital logic circuits can be categorized based on the nature of their inputs either: Combinational logic circuit It consists of logic gates.
Digital Electronics Lecture 6 Combinational Logic Circuit Design.
Chapter 3: Digital Logic Dr Mohamed Menacer Taibah University
Lecture 4 Nand, Nor Gates, CS147 Circuit Minimization and
Instructor: Alexander Stoytchev CprE 281: Digital Logic.
LOGIC GATES & BOOLEAN ALGEBRA
1 Lecture 6 BOOLEAN ALGEBRA and GATES Building a 32 bit processor PH 3: B.1-B.5.
1 ENGG 1015 Tutorial Digital Logic (II) (70 pages) 15 Oct Learning Objectives  Learn about Boolean Algebra (SoP/PoS, DrMorgan's Theorem, simplification),
ENG241 Digital Design Week #2 Combinational Logic Circuits.
Computer Arithmetic, K-maps Prof. Sin-Min Lee Department of Computer Science.
Computer Architecture and Organization Unit -1. Digital Logic Circuits – Logic Gates – Boolean Algebra – Map Simplification – Combinational Circuits –
Hamming Code,Decoders and D,T-flip flops Prof. Sin-Min Lee Department of Computer Science.
LOGIC CIRCUITLOGIC CIRCUIT. Goal To understand how digital a computer can work, at the lowest level. To understand what is possible and the limitations.
Boolean Algebra and Reduction Techniques
Boolean Algebra & Logic Circuits Dr. Ahmed El-Bialy Dr. Sahar Fawzy.
CS/COE0447 Computer Organization & Assembly Language
BOOLEAN ALGEBRA AND LOGIC SIMPLIFICATION
CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Binary Numbers For digital systems, the.
Digital Logic (Karnaugh Map). Karnaugh Maps Karnaugh maps (K-maps) are graphical representations of boolean functions. One map cell corresponds to a row.
Digital Logic Design Basics Combinational Circuits Sequential Circuits Pu-Jen Cheng Adapted from the slides prepared by S. Dandamudi for the book, Fundamentals.
BOOLEAN ALGEBRA LOGIC GATES. Introduction British mathematician George Boole( ) was successful in finding the link between logic and mathematics.
Boolean Algebra. BOOLEAN ALGEBRA Formal logic: In formal logic, a statement (proposition) is a declarative sentence that is either true(1) or false (0).
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.
1 CS/COE0447 Computer Organization & Assembly Language Logic Design Appendix C.
K-maps and Decoders Prof. Sin-Min Lee Department of Computer Science.
Boolean Algebra & Logic Gates
Lecture 4 Nand, Nor Gates, CS147 Circuit Minimization and
DIGITAL LOGIC CIRCUITS
DeMorgan’s Theorem DeMorgan’s 2nd Theorem
Boolean Algebra.
Logic Gates and Boolean Algebra
EKT 221 : Digital 2 COUNTERS.
Basics of Digital Logic Design Presentation D
Reading: Hambley Chapters
ECE Digital logic Lecture 16: Synchronous Sequential Logic
Digital Design Fundamentals
Basics Combinational Circuits Sequential Circuits Ahmad Jawdat
CS/COE0447 Computer Organization & Assembly Language
3-Variable K-map AB/C AB/C A’B’ A’B AB AB’
14 Digital Systems.
Computer Architecture
Presentation transcript:

BINARY NUMBER SYSTEM electronic circuits that handle information encoded in binary form (deal with signals that have only two values, 0 and 1) Digital …. computers, watches, controllers, telephones, cameras,... Digital logic circuits Number ….in whatever base Decimal value of the given number ___________________________________________________________________________________________________________________________________________________________________ Decimal: 1,998 = 1x x x x10 0 =1, =1,998 Binary: = 1x x2 9 +1x2 8 +1x2 7 +1x2 6 +1x2 3 +1x2 2 +1x2 1 = 1, = 1,998 © Emil M. Petriu Sensing and Modelling Research Laboratory SMRLab - Prof.. Emil M. Petriu University of Ottawa - School of Information Technology - SITE DIGITAL LOGIC CIRCUITS

____________________________________________________________________________________________________________________________________________________________________ N 2 N Comments _____________________________________________________________________________________________________________________________________________________________________ ,024 “Kilo”as 2 10 is the closest power of 2 to 1,000 (decimal) 11 2,048 ……………………………………………………… , Hz often used as clock crystal frequency in digital watches …………………………………………………… ,048,576 “Mega” as 2 20 is the closest power of 2 to 1,000,000 (decimal) ………………………………………………… ,073,741,824 “Giga” as 2 30 is the closest power of 2 to 1,000,000,000(decimal) ____________________________________________________________________________________________________________________________________________________________________ Powers of 2 © Emil M. Petriu

_____________________________________________________________ N <0 2 N ____________________________________________________________ = = = = = = = = = = … _____________________________________________________________ Negative Powers of 2 Binary numbers less than 1 = 1x x x x2 -6 = Binary Decimal value © Emil M. Petriu

Hexadecimal: 7CE <== Decimal Binary: = 7x x x16 0 = Binary Decimal Hexadecimal A B C D E F HEXADECIMAL © Emil M. Petriu

LOGIC OPERATIONS AND TRUTH TABLES Digital logic circuits handle data encoded in binary form, i.e. signals that have only two values, 0 and 1. Binary logic dealing with “true” and “false” comes in handy to describe the behaviour of these circuits: 0 is usually associated with “false” and 1 with “true.” Quite complex digital logic circuits (e.g. entire computers) can be built using a few types of basic circuits called gates, each performing a single elementary logic operation : NOT, AND, OR, NAND, NOR, etc.. Boole’s binary algebra is used as a formal / mathematical tool to describe and design complex binary logic circuits. © Emil M. Petriu

A B A + B _____________________________________ _____________________________________ A B F = A + B OR AF =A A A ______________________ NOT A B F =A. B A B A. B _____________________________________ _____________________________________ AND GATES © Emil M. Petriu

NAND A B A. B _____________________________________ _____________________________________ NOR A B A + B _____________________________________ _____________________________________ A B F =A. B A B F = A + B … more GATES © Emil M. Petriu

XOR A B F = A B A B A B _____________________________________ _____________________________________ EQU or XNOR A B F = A B A B A B _____________________________________ _____________________________________ … and more GATES © Emil M. Petriu

GATES … with more inputs A B C A. B. C ______________________________________________ _______________________________________________ F =A. B. C A B C A B C F = A+B+C A B C A B C A+B+C ___________________ 0 1 ___________________ A. B. C ___________________ 1 0 ___________________ A+B+C ___________________ 1 0 ___________________ AND OR NANDNOR EXAMPLES OF GATES WITH THREE INPUTS © Emil M. Petriu

Logic Gate Array that Produces an Arbitrarily Chosen Output A B C F ________________________________________ _________________________________________ ABC ABC ABC A. B. C F F = + A. B. C + + “Sum-of-products” form of the logic circuit. © Emil M. Petriu

B OOLEAN ALGEBRA AND rules A. A = A A. A = 0 0. A = 0 1. A = A A. B = B. A A. ( B. C) = (A. B). C A. ( B + C) = A. B + A. C A. B = A + B A B C A. (B+C) A. B+A. C ____________________________________________________________ “ Proof ”: © Emil M. Petriu

OR rules A + A = A A + A = A = A 1 + A = 1 A + B = B + A A + ( B + C) = (A + B) + C A + B. C = (A + B). (A +C) A + B = A. B A B C A + B. C (A+B). (A+C) _____________________________________________________________________ B OOLEAN ALGEBRA … continued © Emil M. Petriu

A. B = A + B A + B = A. B DeMorgan’s Theorem A B A. B A + B A + B A. B _______________________________ © Emil M. Petriu

ABC ABC ABC A. B. C F F =ABC + ABC + ABC + ABC Sum-of-products form of the logic function: Simplifying logic functions using Boolean algebra rules © Emil M. Petriu

F = ABC + ABC + ABC + ABC F = (ABC + ABC) + (ABC + ABC) F = A(BC + BC) + A ( BC + BC) F = AB( C + C) + AC ( B + B) 11 Simplifying logic functions using Boolean algebra rules … continued ABC AA A. C F A. B F = AB + AC © Emil M. Petriu

Simplifying logic functions using Karnaugh maps A B C F (0) (1) (2) (3) (4) (5) (6) (7) Each line in the truth table corresponds to a square in the Karnaugh map. Karnaugh map => graphical representation of a truth table for a logic function. The Karnaugh map squares are labeled so that horizontally or vertically adjacent squares differ only in one variable. (Each square in the top row is considered to be adjacent to a corresponding square in the bottom row. Each square in the left most column is considered to be adjacent to a corresponding square in the right most column.) C A B Karnaugh map © Emil M. Petriu

C D A B A B C D F (0) (1) (2) (3) (4) (5) (6) (7) … (8) … (9) … (10) … (11) … (12) … (13) … (14) … (15) Simplifying logic functions of 4 variables using Karnaugh maps © Emil M. Petriu

A B C F (0) (1) (2) (3) (4) (5) (6) (7) Simplifying logic functions using Karnaugh maps … looping The logic expressions for an output can be simplified by properly combining squares (looping) in the Karnaugh maps which contain 1s. Looping a pair of adjacent 1s eliminates the variable that appears in both direct and complemented form. ACAB C F = AB + AC © Emil M. Petriu

Looping a quad of adjacent 1s eliminates the two variables that appears in both direct and complemented form. A B C D F (0) (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (12) (13) (14) (15) Simplifying logic functions using Karnaugh maps … more looping C D A B BD A B D AB F = A B D + AB + BD © Emil M. Petriu

A B A+B A. B A B = A+BA B A. B A B = DeMorgan’s Theorem A. B = A + B A + B = A. B Equivalent Gate Symbols © Emil M. Petriu

NAND gate implementation of the “sum-of-product” logic functions NAND gates are faster than ANDs and ORs in most technologies ABC AA F ABC F A F = AB + AC X = ( X ) © Emil M. Petriu

A DDING B INARY N UMBERS 0+ 1 __________ __________ __________ 1 0 The binary number 10 is equivalent to the decimal 2 Carry (over) Sum 0+ 0 __________ 0 Inputs Outputs A B Carry Sum Truth table A B Sum Carry Sum = A + B Carry = A. B Half-Adder circuit Adding two bits: © Emil M. Petriu

Adding multi-bit numbers: ____________________________________ D + 90 D 198 D Sum Carry A B CO CI S A B CO CI S A B CO CI S A B CO CI S A B CO CI S A B CO CI S A B CO CI S A B CO CI S S 7 S 6 S 5 S 4 S 3 S 2 S 1 S 0 A 7 B 7 A 6 B 6 A 5 B 5 A 4 B 4 A 3 B 3 A 2 B 2 A 1 B 1 A 0 B 0 Carry Out Carry In = 0 A 7 A 6 A 5 A 4 A 3 A 2 A 1 A 0 + B 7 B 6 B 5 B 4 B 3 B 2 B 1 B 0 S 7 S 6 S 5 S 4 S 3 S 2 S 1 S 0 © Emil M. Petriu

Carry Out Carry In A B CO CI S Sum Bits of the same rank of the two numbers Full Adder Inputs Outputs A B CI CO S CI A B S S = A. B. CI + A. B. CI + A. B. CI + A. B. CI C = A. B + B. CI + A. CI B. CI A. B A. CI CI A B CO © Emil M. Petriu

HEX-TO-7 SEGMENT DECODER B3 B2 B1 B0 _________________________ (0) (1) (2) (3) (4) (5) (6) (7) (8) (9) (A) (B) (C) (D) (E) (F) HEX 7 SEGMENT S7 S6 S5 S4 S3 S2 S1 S1 S2 S3 S4 S7 S6 S5 B3 B2 B1 B0 This examples illustrates how a practical problem is analyzed in order to generate truth tables,and then how truth table-defined functions are mapped on Karnaugh maps. Binary outputs; when such a signal is = 1 then the corresponding segment in the 7-segment display is on (you see it), when the signal is = 0 then the segment is off (you can’t see it). The four-bit representation of the hex digits 7-segment display to allow the user see the natural representation of the hex digits. “Natural” (i.e.as humans write) representation of the “hex” digits. Four-bit “machine” representation of the hex digits © Emil M. Petriu

S1 S2 S3 S4 S7 S6 S5 S1 S2 S3 S4 S7 S6 S5 S1 S2 S3 S4 S7 S6 S5 S1 S2 S3 S4 S7 S6 S5 S1 S2 S3 S4 S7 S6 S5 S1 S2 S3 S4 S7 S6 S5 S1 S2 S3 S4 S7 S6 S5 S1 S2 S3 S4 S7 S6 S5 S1 S2 S3 S4 S7 S6 S5 S1 S2 S3 S4 S7 S6 S5 S1 S2 S3 S4 S7 S6 S5 S1 S2 S3 S4 S7 S6 S5 S1 S2 S3 S4 S7 S6 S5 S1 S2 S3 S4 S7 S6 S5 S1 S2 S3 S4 S7 S6 S5 S1 S2 S3 S4 S7 S6 S5 B3 B2 B1 B0 _________________________ (0) (1) (2) (3) (4) (5) (6) (7) (8) (9) (A) (B) (C) (D) (E) (F) S1 = A+C+E+F S2 = A+D S3 = A+B+D S4 = B+C+D+E S5 = A+B+C+D+E+F S6 = A+B+C+E+F S7 = A+B+D+E+F We are developing ad-hoc”binary-hex logic” expressions used just for our convenience in the problem analysis process. Each expression will enumerate only those hex digits when the specific display-segment is “on”: © Emil M. Petriu

S1 = A+C+E+F S2 = A+D S3 = A+B+D S4 = B+C+D+E S5 = A+B+C+D+E+F S6 = A+B+C+E+F S7 = A+B+D+E+F B3 B2 B1 B0 _________________________ (0) (1) (2) (3) (4) (5) (6) (7) (8) (9) (A) (B) (C) (D) (E) (F) B1 B0 B3 B C D F B 2 6 E A Hex-to-7 segment As we are using ad-hoc “binary-hex logic” equations, (i.e. binary S… outputs as functions of hex variables) it will useful in this case to have hex-labeled Karnaugh map, instead of the usual 2-D (i.e. two dimensional) binary labeled K maps. This will allow for a more convenient mapping of the “binary-hex” logic equations onto the K-maps. © Emil M. Petriu

11 11 B1 B0 B3 B S1 S1 = A+C+E+F B1 B0 B3 B C D F B 2 6 E A S2 = A+D S3 = A+B+D S4 = B+C+D+E B1 B0 B3 B S B1 B0 B3 B S B1 B0 B3 B S4 Hex-to-7 segment Mapping the ad-hoc “binary-hex logic” equations onto Karnaugh maps: © Emil M. Petriu

B1 B0 B3 B C D F B 2 6 E A B1 B0 B3 B S B1 B0 B3 B S B1 B0 B3 B S7 S5 = A+B+C+D+E+F S6 = A+B+C+E+F S7 = A+B+D+E+F Hex-to-7 segment © Emil M. Petriu

Compare two 2-bit numbers: A 1 A 0 B 1 B 0 F 1 F 2 F 3 (0) (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (12) (13) (14) (15) A>B F 2 =  (4,8,9,12,13,14) A<B F 3 =  (1,2,3,6,7,11) A=B F 1 =  (0,5,10,15) 2- bit Comparator SYSTEMS of LOGIC FUNCTIONS © Emil M. Petriu

2- bit Comparator A=B F 1 =  (0,5,10,15) A1A0A1A0 B1B0B1B0 B 1 B 0 A 1 A F 1 = (A 0  B 0 ) (A 1  B 1 ) F 1 = 1 when both numbers, A and B, are equal which happens when all their bits of the same order are identical, i.e. A 0 = B 0 AND A 1 = B 1 © Emil M. Petriu

A<B F 3 =  (1,2,3,6,7,11) 2- bit Comparator B 1 B 0 A 1 A A 1 B 1 + A 1 A 0 B 0 F 3 = A 0 B 1 B B1B0B1B0 A1A0A1A © Emil M. Petriu

A1A0A1A0 B1B0B1B0 2- bit Comparator A>B F 2 =  (4,8,9,12,13,14) B 1 B 0 A 1 A B1B0B1B0 A1A0A1A F 1 +F 3 F 2 = F 1 + F B1B0B1B0 A1A0A1A F3F A1A0A1A0 B1B0B1B0 F1F1 © Emil M. Petriu

B 1 B 0 A 1 A 0 A 0  B 0 A 1  B 1 F 1 = (A 0  B 0 ) (A 1  B 1 ) F 2 = F 1 + F 3 F 3 = A 0 B 1 B 0 +A 1 B 1 +A 1 A 0 B 0 2- bit Comparator F 2 = F 1 + F 3 F 3 = A 0 B 1 B 0 +A 1 B 1 +A 1 A 0 B 0 F 1 = (A 0  B 0 ) (A 1  B 1 ) © Emil M. Petriu

A B C F 0 F 1 F 2 F 3 F 4 F 5 F 6 F 7 (0) (1) (2) (3) (4) (5) (6) (7) F0F0 F2F2 F3F3 F1F1 F4F4 F5F5 F6F6 F7F7 A B C 3-to-8 Decoder © Emil M. Petriu

F0F0 F2F2 F3F3 F1F1 F4F4 F5F5 F6F6 F7F7 A B C E F 0 F 1 F 2 F 3 F 4 F 5 F 6 F 7 (x) x x x (0) (1) (2) (3) (4) (5) (6) (7) E A B C 3-to-8 Decoder (74 138) © Emil M. Petriu

BCD-TO-7 SEGMENT DECODER B3 B2 B1 B0 _________________________ (0) (1) (2) (3) (4) (5) (6) (7) (8) (9) (x) (x) (x) (x) (x) (x) BCD 7 SEGMENT S7 S6 S5 S4 S3 S2 S1 S1 S2 S3 S4 S7 S6 S5 B3 B2 B1 B0 B1 B0 B3 B x x x x 2 6 x x “Don’t Care” states/situations. As it is expected that these states are never going to occur, then we may just as well use them as fill-in “1s” in a Karnaugh map if this helps to make larger loopings © Emil M. Petriu

S1 S2 S3 S4 S7 S6 S5 S1 S2 S3 S4 S7 S6 S5 S1 S2 S3 S4 S7 S6 S5 S1 S2 S3 S4 S7 S6 S5 S1 S2 S3 S4 S7 S6 S5 S1 S2 S3 S4 S7 S6 S5 S1 S2 S3 S4 S7 S6 S5 S1 S2 S3 S4 S7 S6 S5 S1 S2 S3 S4 S7 S6 S5 S1 S2 S3 S4 S7 S6 S5 B3 B2 B1 B0 _________________________ (0) (1) (2) (3) (4) (5) (6) (7) (8) (9) (x) (x) (x) (x) (x) (x) S1 = S2 = S3 = S4 = S5 = S6 = S7 = BCD-to-7 segment © Emil M. Petriu

1x1x 1x B1 B0 B3 B2 x 0 0 x x S B1 B0 0 1 B3 B x x x x x x S2 1 B3 S2 = + B2 +B1B0 + S1 = S2 = B1 B0 B3 B x x x x 2 6 x x BCD-to-7 segment S1 = B3 + B2B0 + + B2B1 + B2B0 B1 © Emil M. Petriu

1 1 B1 B0 B3 B S3 x x x x x x S3 = + B1B0 + B2 B3 + B1 S3 = B1 B0 B3 B S4 x x x x x x B1B0 S4 = B2B1B B2B0 B3 + B2B1 S4 = B1 B0 B3 B x x x x 2 6 x x BCD-to-7 segment © Emil M. Petriu

B1 B0 1 0 B3 B S5 x x x x x x B1B0 S5 = + B2B0 B1B2 B3 + S6 = + B1B0 + B1B2 B2B1 + S7 = B3 + + S6 = S5 = S7 = B1 B0 B3 B x x x x 2 6 x x BCD-to-7 segment S6 x x x x x x B1 B0 B3 B2 B1 B0 B3 B S7 x x x x 11 x x © Emil M. Petriu

MEMORY ELEMENTS: LATCHES AND FLIP-FLOPS Q S R Q R-S Latch (Reset-Set) S R Q Q Q Q Weird state Set state Reset state Hold state I1 I2 F I1 I2 F S Q R Q = 1 S Q R Q = 0 = 1 S Q R Q = 0 = 1 S Q R Q = 0 = 1 = 0 = 1 © Emil M. Petriu

D (Transparent) Latch Q S R Q D Enable S R Q Q Q Q Enable D S R Q Q Q When the Enable input is =1 (i.e. TRUE or HIGH) the information present at the D input is stored in the latch and will “appear as it is” at the Q output ( => it is like that there is a “transparent” path from the D input to the Q output) Enable D Q Q Q x © Emil M. Petriu

D Latch Q S R Q D Enable Enable D S R Q Q Q Enable D S Q R Hold “Hold”state “Transparent” state © Emil M. Petriu

Synchronous D Flip-Flop D CLK Q Q D1 EN1EN2 Q Q D Enab. Q Q D Latch 1Latch D CLK EN1 EN2 D1 Q Latch 2 is Transparent Latch 2 is Holding Latch 1 is Transparent Latch 1 is Holding Latch 1 is Transparent D1 = Din* Din* Q = D1 = Din* Input data D may change Changed input data D enter Latch 1 The state of the flip-flop’s output Q copies input D when the positive edge of the clock CLK occurs Positive-Edge-Triggered D Flip-Flop Q Q D CLK Positive-Edge -Triggered D Flip-Flop © Emil M. Petriu

Connection diagram of the 7474 Dual Positive-Edge-Triggered D Flip-Flops with Preset and Clear. CLR1 D1 CLK1 PR1 Q1 Q1 GND Vcc CLR2 D2 CLK2 PR2 Q2 Q2 Synchronous D Flip-Flop © Emil M. Petriu

COUNTERS 4-Bit Synchronous Counter using D Flip-Flops Q =  Qi. 2i i = Q3Q1 Q0 Q2 CK 4-Bit BINARY COUNTER CL 1 0 CK Q CL 1 0 © Emil M. Petriu

DECIMAL BINARY STATE OF FLIP FLOP INPUTS STATE THE COUNTER (for the next state) Q Q3 Q2 Q1 Q0 D3 D2 D1 D Using D flip-flops has the distinct advantage of a straightforward definition of the flip-flop inputs: the current state of these inputs is the next state of the counter. The logic equations for all four flip-flop inputs D3, D2, D1, and D0 are derived from this truth table as functions of the current states of the counter’s flip-flops: Q3, Q2, Q1, and Q0. Karnaugh maps can be used to simplify these equations. Q1 Q0 Q3 Q D2 Q1 Q0 Q3 Q D3 Q1 Q0 Q3 Q D1 Q1 Q0 Q3 Q D0 Synchronous 4-bit Counter Q1 Q0 Q3 Q © Emil M. Petriu

Synchronous 4-bit Counter Q1 Q0 Q3 Q D Q1 Q0 Q3 Q D1 1 1 D3 = Q3. Q2 + Q3. Q1 + Q3. Q0 + Q3. Q2. Q1. Q0 D2 = Q2. Q0 + Q2. Q1 + Q2. Q1. Q0 D1 = Q1. Q0 + Q1. Q0 D0 = Q0 Q1 Q0 Q3 Q D0 Q1 Q0 Q3 Q D © Emil M. Petriu

D3 = Q3. Q2 + Q3. Q1 + Q3. Q0 + Q3. Q2. Q1. Q0 D2 = Q2. Q0 + Q2. Q1 + Q2. Q1. Q0 D1 = Q1. Q0 + Q1. Q0 D0 = Q0 Synchronous 4-bit Counter D CLK Q Q R Q0 D CLK Q Q R Q1 D CLK Q Q R Q2 D CLK Q Q R Q3 CL CK © Emil M. Petriu