ENGN3213 Digital Systems and Microprocessors Sequential Circuits

Similar documents
Logic Design. Flip Flops, Registers and Counters

Chapter 6. Flip-Flops and Simple Flip-Flop Applications

Sequential Circuits. Output depends only and immediately on the inputs Have no memory (dependence on past values of the inputs)

Unit-5 Sequential Circuits - 1

CHAPTER 4: Logic Circuits

Sequential logic. Circuits with feedback. How to control feedback? Sequential circuits. Timing methodologies. Basic registers

SEQUENTIAL LOGIC. Satish Chandra Assistant Professor Department of Physics P P N College, Kanpur

CHAPTER 4: Logic Circuits

Experiment 8 Introduction to Latches and Flip-Flops and registers

Digital Logic Design Sequential Circuits. Dr. Basem ElHalawany

Objectives. Combinational logics Sequential logics Finite state machine Arithmetic circuits Datapath

NH 67, Karur Trichy Highways, Puliyur C.F, Karur District UNIT-III SEQUENTIAL CIRCUITS

Unit 11. Latches and Flip-Flops

CSE115: Digital Design Lecture 23: Latches & Flip-Flops

Figure 1 shows a simple implementation of a clock switch, using an AND-OR type multiplexer logic.

IT T35 Digital system desigm y - ii /s - iii

CHAPTER1: Digital Logic Circuits

Engr354: Digital Logic Circuits

Introduction. NAND Gate Latch. Digital Logic Design 1 FLIP-FLOP. Digital Logic Design 1

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

Sequential Logic Basics

EECS150 - Digital Design Lecture 19 - Finite State Machines Revisited

NH 67, Karur Trichy Highways, Puliyur C.F, Karur District DEPARTMENT OF INFORMATION TECHNOLOGY CS 2202 DIGITAL PRINCIPLES AND SYSTEM DESIGN

MODU LE DAY. Class-A, B, AB and C amplifiers - basic concepts, power, efficiency Basic concepts of Feedback and Oscillation. Day 1

Lecture 8: Sequential Logic

Sequential Logic. Sequential Circuits. ! Timing Methodologies " Cascading flip-flops for proper operation " Clock skew

Flip-flop and Registers

Sequential Logic and Clocked Circuits

Flip-Flops and Sequential Circuit Design

Sequential Circuits. Sequential Logic. Circuits with Feedback. Simplest Circuits with Feedback. Memory with Cross-coupled Gates.

Chapter 5 Synchronous Sequential Logic

EMT 125 Digital Electronic Principles I CHAPTER 6 : FLIP-FLOP

VeriLab. An introductory lab for using Verilog in digital design (first draft) VeriLab

Registers. Unit 12 Registers and Counters. Registers (D Flip-Flop based) Register Transfers (example not out of text) Accumulator Registers

Solar Power for Small Hall

Sequential Logic Circuits

Digital Fundamentals: A Systems Approach

UNIT III. Combinational Circuit- Block Diagram. Sequential Circuit- Block Diagram

Chapter 6 Digital Circuit 6-5 Department of Mechanical Engineering

MC9211 Computer Organization

Chapter 5: Synchronous Sequential Logic

Registers & Counters. BME208 Logic Circuits Yalçın İŞLER

RS flip-flop using NOR gate

! Two inverters form a static memory cell " Will hold value as long as it has power applied

Counters

Chapter 5 Flip-Flops and Related Devices

Sequential Logic. E&CE 223 Digital Circuits and Systems (A. Kennings) Page 1

AIM: To study and verify the truth table of logic gates

MODULE 3. Combinational & Sequential logic

DEPARTMENT OF ELECTRICAL &ELECTRONICS ENGINEERING DIGITAL DESIGN

Name Of The Experiment: Sequential circuit design Latch, Flip-flop and Registers

Digital Fundamentals: A Systems Approach

RS flip-flop using NOR gate

Review of Flip-Flop. Divya Aggarwal. Student, Department of Physics and Astro-Physics, University of Delhi, New Delhi. their state.

CPS311 Lecture: Sequential Circuits

Logic and Computer Design Fundamentals. Chapter 7. Registers and Counters

Chapter 2. Digital Circuits


CHAPTER 6 COUNTERS & REGISTERS

Advanced Devices. Registers Counters Multiplexers Decoders Adders. CSC258 Lecture Slides Steve Engels, 2006 Slide 1 of 20

Synchronous Sequential Logic

LATCHES & FLIP-FLOP. Chapter 7

Chapter 3 Unit Combinational

Principles of Computer Architecture. Appendix A: Digital Logic

YEDITEPE UNIVERSITY DEPARTMENT OF COMPUTER ENGINEERING. EXPERIMENT VIII: FLIP-FLOPS, COUNTERS 2014 Fall

Flip-Flops and Related Devices. Wen-Hung Liao, Ph.D. 4/11/2001

problem maximum score 1 28pts 2 10pts 3 10pts 4 15pts 5 14pts 6 12pts 7 11pts total 100pts

CprE 281: Digital Logic

Flip-Flops. Because of this the state of the latch may keep changing in circuits with feedback as long as the clock pulse remains active.

CprE 281: Digital Logic

The basic logic gates are the inverter (or NOT gate), the AND gate, the OR gate and the exclusive-or gate (XOR). If you put an inverter in front of

ENGR 303 Introduction to Logic Design Lecture 10. Dr. Chuck Brown Engineering and Computer Information Science Folsom Lake College

Counter dan Register

ESE 570 STATIC SEQUENTIAL CMOS LOGIC CELLS. Kenneth R. Laker, University of Pennsylvania, updated 25Mar15

D Latch (Transparent Latch)

FPGA Design. Part I - Hardware Components. Thomas Lenzi

EKT 121/4 ELEKTRONIK DIGIT 1

EEE2135 Digital Logic Design Chapter 6. Latches/Flip-Flops and Registers/Counters 서강대학교 전자공학과

Chapter 5. Introduction

CprE 281: Digital Logic

Asynchronous (Ripple) Counters

Registers and Counters

ECE 341. Lecture # 2

Vignana Bharathi Institute of Technology UNIT 4 DLD

Other Flip-Flops. Lecture 27 1

Microprocessor Design

211: Computer Architecture Summer 2016

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

Chapter 6. sequential logic design. This is the beginning of the second part of this course, sequential logic.

Logic Design II (17.342) Spring Lecture Outline

EECS 3201: Digital Logic Design Lecture 9. Ihab Amer, PhD, SMIEEE, P.Eng.

Combinational vs Sequential

Modeling Latches and Flip-flops

DIGITAL SYSTEM FUNDAMENTALS (ECE421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE422) LATCHES and FLIP-FLOPS

EEC 118 Lecture #9: Sequential Logic. Rajeevan Amirtharajah University of California, Davis Jeff Parkhurst Intel Corporation

CprE 281: Digital Logic

(Refer Slide Time: 2:00)

CS8803: Advanced Digital Design for Embedded Hardware

MODEL QUESTIONS WITH ANSWERS THIRD SEMESTER B.TECH DEGREE EXAMINATION DECEMBER CS 203: Switching Theory and Logic Design. Time: 3 Hrs Marks: 100

CS 261 Fall Mike Lam, Professor. Sequential Circuits

Transcription:

ENGN3213 Digital Systems and Microprocessors Sequential Circuits 1 ENGN3213: Digital Systems and Microprocessors L#9-10

Why have sequential circuits? Sequential systems are time sequential devices - many systems are time sequential examples Memory controllers Bit sequential arithmetic operators Finite State Machines filters, Finite string recognisers,digital combination locks and counters Serial line transmitter/receivers - another application for the deserialiser. 2 ENGN3213: Digital Systems and Microprocessors L#9-10

Sequential Devices: What is sequential? In a sequential device the result is only transferred to the output at the active edge of a clock. 3 ENGN3213: Digital Systems and Microprocessors L#9-10

Modelling sequential circuits in Verilog 4 ENGN3213: Digital Systems and Microprocessors L#9-10

Deserialiser Animation!!! 5 ENGN3213: Digital Systems and Microprocessors L#9-10

VERILOG TIP 1: Unwanted latches in VERILOG Synthesis A reg keeps the value of its last assignment until it is assigned to again. If a reg is assigned to on some path of execution through an always block but not on all paths, it behaves as a latch. Make sure that non-latch reg variables are assigned to through every path - both arms of ifs, and all arms of cases. A case should have a default even if all possible inputs match some label. Also be aware that unintentional feedback in combinational circuits produces latches - see HLAB2 at the end. always @(*) data = data or.. always @(*) data <= data 6 ENGN3213: Digital Systems and Microprocessors L#9-10

VERILOG TIP 2: Incomplete Event Control Lists Make sure that the necessary variables appear in always block sensitivity lists. If an input is missing from the sensitivity list, its lack of influence will induce unexpected behavior. One solution: In combinational always blocks use always @( ). always @(A) begin X = A; Y = B; end 7 ENGN3213: Digital Systems and Microprocessors L#9-10

Circuits with Memory The essential feature of sequential circuits is that they have memory. Example: a burglar alarm must remember whether it was tripped... 8 ENGN3213: Digital Systems and Microprocessors L#9-10

Schmitt Trigger 9 ENGN3213: Digital Systems and Microprocessors L#9-10

Schmitt Trigger 10 ENGN3213: Digital Systems and Microprocessors L#9-10

Bistable Latch A latch is a level controlled memory device There are two stable states for this device. As it has no inputs, the one it assumes depends on its power-up phase. 11 ENGN3213: Digital Systems and Microprocessors L#9-10

Basic SR Latch 12 ENGN3213: Digital Systems and Microprocessors L#9-10

SR Latch Truth Table A Race condition occurs if S = 1 and R = 1 S R Q(t + 1) Q(t + 1) 0 0 Q(t) Q(t) 0 1 0 reset 1 0 1 set 1 1 13 ENGN3213: Digital Systems and Microprocessors L#9-10

SR Latch Timing 14 ENGN3213: Digital Systems and Microprocessors L#9-10

What is wrong with the following circuit? /////////////////////////////////////////////////////////////////////////// module RSlatch_nor_comb(S, R, Q); input S; input R; output Q; wire Qa; wire Qb; assign Qa = (S Qb); assign Qb = (R Qa); assign Q = Qa; endmodule 15 ENGN3213: Digital Systems and Microprocessors L#9-10

What is wrong with the following circuit? module dff (D, Clk, Q); input D, Clk; output Q; wire D, Clk; reg Q; always @(posedge Clk) Q <= D; endmodule 16 ENGN3213: Digital Systems and Microprocessors L#9-10

What is wrong with the following circuit? always @(Clk or D) begin //This works... Q = Q2a; Q2a = (S2 & Q2b); Q2b = (R2 & Q2a); S2 = (Q1a & Clkp); R2 = (Q1b & Clkp); Q1a = (S1 & Q1b); Q1b = (R1 & Q1a); end S1 = (So & Clkn); R1 = (Ro & Clkn); So = D; Ro = D; Clkp = Clk; Clkn = Clk; 17 ENGN3213: Digital Systems and Microprocessors L#9-10

What is wrong with the following circuit? always @(Clk or D) begin //This does not work Q = Q2a; Q2a = (S2 & Q2b); Q2b = (R2 & Q2a); #1S2 = (Q1a & Clk); #1R2 = (Q1b & Clk); Q1a = (S1 & Q1b); Q1b = (R1 & Q1a); S1 = (D & Clk); R1 = ( D & Clk); end 18 ENGN3213: Digital Systems and Microprocessors L#9-10

D Latch and Gated D Latch The SR latch has memory and could therefore serve the role of an alarm control - but it is transparent Also there is the (1,1) ambiguity Gated D-latch 19 ENGN3213: Digital Systems and Microprocessors L#9-10

Gated D Latch Note that the CLOCK still a level control. Undesirable (1,1) condition does not arise. Clock D Q(t + 1) 0 Q(t) 1 0 0 1 1 1 20 ENGN3213: Digital Systems and Microprocessors L#9-10

module Gated_D_latch(Clk, d, Q); input Clk; input d; output Q; /** assign Q = Clk? q : d; **/ reg Q; always @(*) begin if(clk) Q = D; end endmodule 21 ENGN3213: Digital Systems and Microprocessors L#9-10

D Flip Flop 22 ENGN3213: Digital Systems and Microprocessors L#9-10

module D_flip_flop(Clk, d, Q); input Clk; input d; output Q; reg Q; always @(negedge Clk) begin Q <= D; end endmodule 23 ENGN3213: Digital Systems and Microprocessors L#9-10

D Flip Flop with ASYNCHRONOUS Preset and Clear 24 ENGN3213: Digital Systems and Microprocessors L#9-10

module DFF_AR (D, Clock, Presetn, Q); input D; input Clock; input Presetn; output Q; reg Q; always @(negedge Presetn or negedge Clock) if (!Presetn) Q <= 0; else Q <= D; endmodule 25 ENGN3213: Digital Systems and Microprocessors L#9-10

D Flip Flop with SYNCHRONOUS Preset and Clear The way to avoid generating glitches in sequential digital designs is by making all inputs to be synchronous Gating the input signal and the Clear signal through the AND gate eliminates glitches. 26 ENGN3213: Digital Systems and Microprocessors L#9-10

module DFF_SR (D, Clock, Resetn, Q); input D; inptu Clock; input Resetn; output Q; reg Q; always @(negedge Clock) if (!Resetn) Q <= 0; else Q <= D; endmodule 27 ENGN3213: Digital Systems and Microprocessors L#9-10

ENGN3213 Digital Systems and Microprocessors Examples of sequential circuits 28 ENGN3213: Digital Systems and Microprocessors L#9-10

DFF Timing parameters t su t h t w CLOCK D Q t p 29 ENGN3213: Digital Systems and Microprocessors L#9-10

Flip flops-1: T-flip flop 30 ENGN3213: Digital Systems and Microprocessors L#9-10

Flip flops-2: T-flip flop T-latch???? 31 ENGN3213: Digital Systems and Microprocessors L#9-10

Flip flops-3: T-flip flop 32 ENGN3213: Digital Systems and Microprocessors L#9-10

Flip-flops-4: J-K flip flop 33 ENGN3213: Digital Systems and Microprocessors L#9-10

Flip-flops-5: J-K flip flop - Two implementations 34 ENGN3213: Digital Systems and Microprocessors L#9-10

Applications of Registers 35 ENGN3213: Digital Systems and Microprocessors L#9-10

Counters: Asynchronous Binary Upcounter 36 ENGN3213: Digital Systems and Microprocessors L#9-10

Counters: Asynchronous Binary Upcounter or Ripple Counter T-flip flops: Q Q if T = 1, Q Q if T = 0 Works by changing only on the rising edge of the clock inputs. Asynchronous because the flip-flops do not toggle synchronously with the clock There is an increasing delay from flip-flop to flip-flop from left to right which leads to a constraint on size and speed. The propagationn effect leads to the term: ripple counter. Eliminate this problem with a synchronous counter. 37 ENGN3213: Digital Systems and Microprocessors L#9-10

Counters: Synchronous Counter 38 ENGN3213: Digital Systems and Microprocessors L#9-10

Modelling counters Counters are simple state machines FSM model has the advantage that the outputs of the counter can be arbitrary (not just count up / count down) Si S0 S1 S2 S3 S4 S5 S6 S7 Sp RESET 39 ENGN3213: Digital Systems and Microprocessors L#9-10

Parallel to Serial and Serial to Parallel Conversion Conversion from serial communications channels or in low hardware resources situations one oftens uses serial data. Need to convert from parallel to serial and vice versa. Performed by shift registers 40 ENGN3213: Digital Systems and Microprocessors L#9-10

Serial-in Serial-out Shift Register 41 ENGN3213: Digital Systems and Microprocessors L#9-10

Serial-in Serial-out Shift Register Timing 42 ENGN3213: Digital Systems and Microprocessors L#9-10

Parallel-in Parallel-out Shift Register 43 ENGN3213: Digital Systems and Microprocessors L#9-10

Parallel Access Shift Register The parallel access shift register can be used for both serial to parallel and parallel to serial conversion. 44 ENGN3213: Digital Systems and Microprocessors L#9-10

Arithmetic Processors Can do operations in serial rather than parallel. E.G. Serial adder versus parallel adder (e.g. ripple carry adder) Good for saving hardware. Good for saving hardware. Bad for speed. In1 In2 Processor Out Ci Co DFF Clock 45 ENGN3213: Digital Systems and Microprocessors L#9-10

Serial Multiplier Have already seen ripple carry adders Can apply serial processing to multiplication as well Input b is in parallel and the bits of a in increasing significance are processed serially - same as textbook multiplication. 46 ENGN3213: Digital Systems and Microprocessors L#9-10

Asynchronous Communications: A sequential Device Asynchronous serial: very common communications protocol many descendents: SPI (serial peripheral interface), RS485, I2C, packet radio (AX25) Used to be widely used by computers (e.g. PC, MAC,...) but still dominant in microprocessors. Many micros have built in serial comms. Asynchronous means that the data clock is unimportant. The receiver assumes that its local clock is about the same as that of the transmitter. This is not good enough for some of the descendents.e.g radio packet has a synchronising protocol in the PHY protocol layer called HDLC (High level data link control). C.F. A synchronous communications protocol where the receiver must lock onto the clock and synchronously decode the data. E.G. All wireless protocols are synchronous Asynchronous serial comes as either RS232 ±(12 15)V olts or TTL levels (0-5 V for e.g.). You may remember RS232 from the dial-up days. Rather slow: 1200 baud, 19 Kbaud, 56 kbaud even 900 kbaud in specialised circumstances. In anycase all high speed Internet uses synchronous protocols e.g. Ethernet. 47 ENGN3213: Digital Systems and Microprocessors L#9-10

RS232 Signal traces 48 ENGN3213: Digital Systems and Microprocessors L#9-10

RS232 pinouts(uart = Universal Asynchronous Receiver Transmitter 49 ENGN3213: Digital Systems and Microprocessors L#9-10

RS232 pinouts 50 ENGN3213: Digital Systems and Microprocessors L#9-10

RS232 pinouts 51 ENGN3213: Digital Systems and Microprocessors L#9-10

DVB-T Transmitter Block Diagram (ETSI EN 300 744 V1.4.1 (2001-01)) (ETSI = European Telecommunications Standards Institute) 52 ENGN3213: Digital Systems and Microprocessors L#9-10

DVB-T ETSI EN 300 744 V1.4.1 (2001-01) (ctd) The system is defined as the functional block of equipment performing the adaptation of the baseband TV signals from the output of the MPEG-2 transport multiplexer, to the terrestrial channel characteristics. The following processes shall be applied to the data stream (see figure 1): transport multiplex adaptation and randomization for energy dispersal; outer coding (i.e. Reed-Sol omon code); outer interleaving (i.e. convolutional interleaving); inner coding (i.e. punctured convolutional code); inner interleaving; mapping and modulation; Orthogonal Frequency Division Multiplexing (OFDM) transmission. The system is directly compatible with MPEG-2 coded TV signals ISO/IEC 13818 [1]. 53 ENGN3213: Digital Systems and Microprocessors L#9-10

DVB-T Transport Multiplexer (ETSI EN 300 744 V1.4.1 (2001-01)) To ensure adequate binary transitions, the data of the input MPEG-2 multiplex shall be randomized in accordance with the configurations depicted below. 54 ENGN3213: Digital Systems and Microprocessors L#9-10

DVB-T Inner Coder (ETSI EN 300 744 V1.4.1 (2001-01)) The system shall allow for a range of punctured convolutional codes, based on a mother convolutional code of rate 1/2 with 64 states. 55 ENGN3213: Digital Systems and Microprocessors L#9-10