Memory Elements. Combinational logic cannot remember



Similar documents
Combinational Logic Design Process

Set-Reset (SR) Latch

Latches, the D Flip-Flop & Counter Design. ECE 152A Winter 2012

Engr354: Digital Logic Circuits

Counters & Shift Registers Chapter 8 of R.P Jain

CHAPTER 11 LATCHES AND FLIP-FLOPS

Lesson 12 Sequential Circuits: Flip-Flops

BINARY CODED DECIMAL: B.C.D.

Chapter 9 Latches, Flip-Flops, and Timers

Modeling Sequential Elements with Verilog. Prof. Chien-Nan Liu TEL: ext: Sequential Circuit

Sequential Logic Design Principles.Latches and Flip-Flops

WEEK 8.1 Registers and Counters. ECE124 Digital Circuits and Systems Page 1

Flip-Flops, Registers, Counters, and a Simple Processor

Digital Logic Design. Basics Combinational Circuits Sequential Circuits. Pu-Jen Cheng

To design digital counter circuits using JK-Flip-Flop. To implement counter using 74LS193 IC.

L4: Sequential Building Blocks (Flip-flops, Latches and Registers)

Digital Fundamentals

ECE380 Digital Logic

Theory of Logic Circuits. Laboratory manual. Exercise 3

CSE140: Components and Design Techniques for Digital Systems

Having read this workbook you should be able to: recognise the arrangement of NAND gates used to form an S-R flip-flop.

Sequential Logic. (Materials taken from: Principles of Computer Hardware by Alan Clements )

DIGITAL TECHNICS II. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute

Flip-Flops and Sequential Circuit Design. ECE 152A Winter 2012

Flip-Flops and Sequential Circuit Design

Master/Slave Flip Flops

Lecture 8: Synchronous Digital Systems

CS311 Lecture: Sequential Circuits

SEQUENTIAL CIRCUITS. Block diagram. Flip Flop. S-R Flip Flop. Block Diagram. Circuit Diagram

Chapter 5. Sequential Logic

Experiment # 9. Clock generator circuits & Counters. Eng. Waleed Y. Mousa

Asynchronous Counters. Asynchronous Counters

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012

Module 3: Floyd, Digital Fundamental

Lecture-3 MEMORY: Development of Memory:

Chapter 7. Registers & Register Transfers. J.J. Shann. J. J. Shann

Counters and Decoders

Chapter 8. Sequential Circuits for Registers and Counters

7. Latches and Flip-Flops

COMBINATIONAL and SEQUENTIAL LOGIC CIRCUITS Hardware implementation and software design

Digital Logic Design Sequential circuits

Design Verification & Testing Design for Testability and Scan

Digital Systems Based on Principles and Applications of Electrical Engineering/Rizzoni (McGraw Hill

ASYNCHRONOUS COUNTERS

Sequential Circuit Design

Layout of Multiple Cells

So far we have investigated combinational logic for which the output of the logic devices/circuits depends only on the present state of the inputs.

CpE358/CS381. Switching Theory and Logical Design. Class 10

Sequential Logic: Clocks, Registers, etc.

PROGETTO DI SISTEMI ELETTRONICI DIGITALI. Digital Systems Design. Digital Circuits Advanced Topics

EE 42/100 Lecture 24: Latches and Flip Flops. Rev B 4/21/2010 (2:04 PM) Prof. Ali M. Niknejad

ETEC 2301 Programmable Logic Devices. Chapter 10 Counters. Shawnee State University Department of Industrial and Engineering Technologies

IE1204 Digital Design F12: Asynchronous Sequential Circuits (Part 1)

Contents COUNTER. Unit III- Counters

CHAPTER 3 Boolean Algebra and Digital Logic

Design Example: Counters. Design Example: Counters. 3-Bit Binary Counter. 3-Bit Binary Counter. Other useful counters:

Cascaded Counters. Page 1 BYU

Chapter 4 Register Transfer and Microoperations. Section 4.1 Register Transfer Language

Introduction to CMOS VLSI Design (E158) Lecture 8: Clocking of VLSI Systems

DIGITAL ELECTRONICS. Counters. By: Electrical Engineering Department

DIGITAL TECHNICS II. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute 5. LECTURE: REGISTERS AND RELATED

Modeling Latches and Flip-flops

Lecture 11: Sequential Circuit Design

Fig1-1 2-bit asynchronous counter

Timing Methodologies (cont d) Registers. Typical timing specifications. Synchronous System Model. Short Paths. System Clock Frequency

1. True or False? A voltage level in the range 0 to 2 volts is interpreted as a binary 1.

Lecture 10 Sequential Circuit Design Zhuo Feng. Z. Feng MTU EE4800 CMOS Digital IC Design & Analysis 2010

The components. E3: Digital electronics. Goals:

Lecture 10: Sequential Circuits

Copyright Peter R. Rony All rights reserved.

CHAPTER 11: Flip Flops

Registers & Counters

DIGITAL COUNTERS. Q B Q A = 00 initially. Q B Q A = 01 after the first clock pulse.

Systems I: Computer Organization and Architecture

LAB #4 Sequential Logic, Latches, Flip-Flops, Shift Registers, and Counters

MICROPROCESSOR. Exclusive for IACE Students iacehyd.blogspot.in Ph: /422 Page 1

DATA SHEETS DE COMPONENTES DA FAMÍLIA LÓGICA TTL GATES AND INVERTERS POSITIVES NAND GATES AND INVERTERS DESCRIÇÃO

Asynchronous counters, except for the first block, work independently from a system clock.

Lecture 7: Clocking of VLSI Systems

Counters. Present State Next State A B A B

DEPARTMENT OF INFORMATION TECHNLOGY

INTEGRATED CIRCUITS. For a complete data sheet, please also download:

Gates, Circuits, and Boolean Algebra

Sequential Circuits. Combinational Circuits Outputs depend on the current inputs

DIGITAL TECHNICS II. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute. 2nd (Spring) term 2012/2013

Wiki Lab Book. This week is practice for wiki usage during the project.

Digital Fundamentals. Lab 8 Asynchronous Counter Applications

DATA SHEET. HEF40193B MSI 4-bit up/down binary counter. For a complete data sheet, please also download: INTEGRATED CIRCUITS

Let s put together a Manual Processor

A Lesson on Digital Clocks, One Shots and Counters

NTE2053 Integrated Circuit 8 Bit MPU Compatible A/D Converter

CHAPTER IX REGISTER BLOCKS COUNTERS, SHIFT, AND ROTATE REGISTERS

Computer organization

Chapter 2 Logic Gates and Introduction to Computer Architecture

PROGETTO DI SISTEMI ELETTRONICI DIGITALI. Digital Systems Design. Digital Circuits Advanced Topics

Counters are sequential circuits which "count" through a specific state sequence.

Design: a mod-8 Counter

ECE232: Hardware Organization and Design. Part 3: Verilog Tutorial. Basic Verilog

Transcription:

Memory Elements Combinational logic cannot remember Output logic values are function of inputs only Feedback is needed to be able to remember a logic value Memory elements are needed in most digital logic circuits to hold (remember) logic values 2 basic types of memory elements Latches Level-sensitive to inputs Flip-flops Edge-triggered on active edge of clock C. E. Stroud Latches & Flip-flops (10/12) 1

Reset-Set (RS) Latch (NOR) The simplest memory element Aka set-reset (SR) latch Cross-coupled NOR gates Level sensitive S Active high inputs R (reset) S (set) Only one input can be active To avoid undefined state Outputs: and = current state of latch R R S Function 0 0 Storage 0 1 1 0 Set 1 0 0 1 Reset 1 1 0-? 0-? Undefined C. E. Stroud Latches & Flip-flops (10/12) 2

Reset-Set (RS) Latch (NAND) Dual of NOR RS latch Cross-coupled NAND gates Level sensitive Active low inputs R (reset) S (set) Only one input can be active To avoid undefined state Outputs: and = current state of latch R S R S Function 0 0 1-? 1-? Undefined 0 1 0 1 Reset 1 0 1 0 Set 1 1 Storage C. E. Stroud Latches & Flip-flops (10/12) 3

Enabled Reset-Set (RS) Latch (NOR) Aka gated RS latch When enable E is inactive, RS latch is forced into storage state R and S can do nothing AND gates plus NOR RS latch Level sensitive Active high inputs E (enable) R (reset) S (set) R and S cannot both be active when E is active To avoid undefined state Outputs: and = current state of latch E R S Function 0 X X Storage 1 0 0 Storage 1 0 1 1 0 Set 1 1 0 0 1 Reset 1 1 1 0-? 0-? Undefined C. E. Stroud Latches & Flip-flops (10/12) 4 R E S

Enabled Reset-Set (RS) Latch (NAND) Aka gated RS latch When enable E is inactive, RS latch is forced into storage state R and S can do nothing OR gates plus NAND RS latch Level sensitive Active low inputs E (enable) R (reset) S (set) R and S cannot both be active when E is active To avoid undefined state Outputs: and = current state of latch E R S Function 1 X X Storage 0 0 0 1-? 1-? Undefined 0 0 1 0 1 Reset 0 1 0 1 0 Set 0 1 1 Storage C. E. Stroud Latches & Flip-flops (10/12) 5 R E S

Enabled Data or Delay (D) Latch Aka transparent D latch Overcomes undefined state R & S never active at same time Inverter plus enabled RS latch D E Level sensitive Active high enable for NOR latch Active low enable for NAND latch E D Function 0 X Storage 1 0 0 1 Transparent 1 1 1 0 Transparent C. E. Stroud Latches & Flip-flops (10/12) 6 D E E D Function 0 0 0 1 Transparent 0 1 1 0 Transparent 1 X Storage logic symbols D active low E D active high E

D Flip-Flop Aka Master-Slave flip-flop Two transparent D latches Sensitive to opposite levels of Clock master One is always in storage and the other master transparent transparent slave storage Edge-triggered D D active low E Clock Data moves through on Clock transition Active-low latch followed by active-high D D active Rising edge-triggered high aka leading edge-triggered E Active-high latch followed by active-low master Falling edge-triggered master transparent aka trailing edge-triggered slave storage Clock D active high E slave D active low E master storage slave transparent rising edge slave master storage slave transparent falling edge C. E. Stroud Latches & Flip-flops (10/12) 7

D Flip-Flop Gate-level implementation No need for inverter in slave latch since master has & D active-low active-high Rising edge-triggered D flip-flop D active-high active-low Falling edge-triggered D flip-flop C. E. Stroud Latches & Flip-flops (10/12)

Timing Considerations Set-up time (t su ) = minimum time data (D) must be valid at input to flip-flop prior to the active edge of the clock Hold time (t h ) = minimum time data (D) must remain valid at input to flipflop after the active edge of the clock Clock-to-output delay (t co ) = maximum time before output data () is valid after the active edge of the clock D t su t h t co C. E. Stroud Latches & Flip-flops (10/12) 9

Timing Considerations Set-up & hold time violations in a real circuit result in metastability Flip-flop goes to intermediate logic levels ( = ) Eventually resolves to an unknown state Set-up & hold time violations in a vector set for simulation referred to as clock-data-races Leads to invalid simulation results & manufacturing testing problems C. E. Stroud Latches & Flip-flops (10/12) 10 D t su t h t co

What is the Clock? Typically a periodic signal (a sequence of pulses) used to: sample data, and store the sampled data in memory elements Clock frequency = 1/period f clk = 1/T p T p t co + P del + t su t co time for P del t su 1 P del T p - t co - t su period T p time 0 C. E. Stroud Latches & Flip-flops (10/12) 11

Serial Shift Register Example A series of D flip-flops whose outputs are connected to the input of the next flip-flop serial-in, serial-out = data in on Din, data out on c serial-in, parallel-out = data in on Din, data out on a, b, and c Din a b c time Timing diagram Din a b c C. E. Stroud Latches & Flip-flops (10/12) 12

Another Shift Register Example A series of multiplexers and D flip-flops whose outputs are connected to the input of the next flip-flop parallel-in, parallel-out = data in on Da, Db, and Dc; data out on a, b, and c (Shift/Load = 0) parallel-in, serial-out = data in on Da, Db, and Dc; data out on c (Shift/Load = 0, then Shift/Load = 1) Serial-in, serial-out = data in on Din, data out on c (Shift/Load = 1) Serial-in, parallel-out = data in on Din, data out on a, b, and c (Shift/Load = 1) Da Db Dc Din 0 1 0 1 0 1 Shift/Load a b c C. E. Stroud Latches & Flip-flops (10/12) 13

PSIM Architecture Sequential Logic: Program Memory (MEM) Program Counter (PC) Address Register (AR) Data Register (DR) Input Register (IN) Output Register (OR) Accumulator (AC) ALU Carry Register (C) Instruction Register (IR) Timing Counter (TC) Combinational Logic: Control Logic Arithmetic/Logic Unit (ALU) Multiplexers 1&2 (MUX) C. E. Stroud Latches & Flip-flops (10/12) 14

Another Register Example A series of multiplexers and D flip-flops whose outputs are connected to the input of the MUX Register with active high Load Load = 1 & rising edge of clock: parallel-in, parallel-out = data in on Da, Db, and Dc; data out on a, b, and c Otherwise: Holds data; data out remains on a, b, and c Basic register design used in PSIM for: AR, DR, OR, IN (all -bits) and IR (4-bits) Da Db Dc 0 1 0 1 0 1 Load a C. E. Stroud Latches & Flip-flops (10/12) 15 b c

Accumulator Register Example Accumulator in PSIM Functions controlled by combinational logic design Including holding data when no operations are specified Via feedback of AC i Only need a flip-flop at output of MUX AC register (-bits) C register (1-bit) Similar to AC i design shown here AC-C2 DR i AC i AC-C1 AC i DR i 3 AC_C2-0 C. E. Stroud Latches & Flip-flops (10/12) 16 Cin adder AC i Sum i AC i DR i AC i DR i Clock AC i DR i 0 1 2 3 4 5 6 7 Z i AC i

Random Access Memory (RAM) Assuming MEM from PSIM -bit address => 256 words MADD -bit words Input data = -bits From DR Output data = -bits From MEM Active high write enable WR-MEM When WR-MEM = 1, data from DR is written into address location specified by MADD MADD(7-0) WR-MEM ADD WE DR(7-0) DIN MEM DOUT MEM(7-0) (to DR) C. E. Stroud Latches & Flip-flops (10/12) 17

RAM continued RAM consists of: Address decoder with enable Produces active high enables to registers Registers with parallel load Stores data associated with specified address Read MUX Reads specified address ADD(7-0) WR DECODE W 0 W 255 DIN DI LD Word 0 DO DI LD Word 255 DO ADD(7-0) MUX DOUT C. E. Stroud Latches & Flip-flops (10/12) 1

RAM continued Word Registers with parallel load D-latches with active high enable W i DIN DI LD Word 0 DO WORD i DI 0 DI 7 D LD i D active high E D active high E E DO 0 DO 7 C. E. Stroud Latches & Flip-flops (10/12) 19

RAM continued Read MUX Word 0 MUX DOUT 256-to-1 MUXs Word 255 Functional equivalent Address decoder 256 9-input AND gates inverters ADD0 ADD1 ADD2 ADD3 ADD4 ADD5 ADD6 ADD7 Word 0 B i ADD(7-0) example DOUT i ADD0 W ADD0 0 ADD1 ADD1 ADD2 ADD2 example ADD3 ADD3 ADD4 W 12 ADD4 ADD5 ADD5 WR W ADD6 ADD6 255 ADD7 ADD7 WR Word 255 B i C. E. Stroud Latches & Flip-flops (10/12) 20 ADD(7-0) DECODE

What is Sequential Logic? A collection of logic gates and flip-flops The logic values stored in the flip-flops establish the current state of the sequential logic circuit The logic values at the inputs in conjunction with the current state determines the next state of the sequential logic circuit after the active edge of the clock Primary Inputs Current State Comb Logic Flip- Flips Next State Primary Outputs generalized architecture for sequential logic circuits also known as Huffman model C. E. Stroud Latches & Flip-flops (10/12) 21

Flip-Flop Information for Sequential Logic Design Types of flip-flops D (data) T (toggle) SR (set-reset) Also known as RS (reset-set) JK (Jack Kilby) We will consider only edge-triggered flip-flops Each type has associated: Characteristic equation Characteristic table sometimes called state table State diagram Excitation table All provide same basic information but in slightly different forms C. E. Stroud Latches & Flip-flops (10/12) 22

State Diagrams & State Tables Describe complete operation of sequential logic circuit Vertices (nodes) represent states Edges represent state transitions on active edge of clock based on primary input logic values State diagram & state tables provide exact same information Diagram is graphical representation of same info as in state table Given current state and primary input values we can determine the next state after active edge of clock C. E. Stroud Latches & Flip-flops (10/12) 23

D Flip-Flop Specification state diagram 1 characteristic equation + = D 0 0 1 1 0 characteristic table D + 0 0 1 1 D logic diagram excitation table + D 0 0 0 0 1 1 1 0 0 1 1 1 C. E. Stroud Latches & Flip-flops (10/12) 24

T Flip-Flop Specification state diagram 1 0 0 1 1 characteristic table T + Mode 0 Storage 1 Toggle 0 T characteristic equation + = T + T = T logic diagram excitation table + T 0 0 0 0 1 1 1 0 1 1 1 0 C. E. Stroud Latches & Flip-flops (10/12) 25

RS Flip-Flop Specification state diagram 10 0X 0 1 X0 01 input ordering = SR characteristic table S R + Mode 0 0 Storage 0 1 0 Reset 1 0 1 Set 1 1? Indeterminant R S logic diagram characteristic equation + = S + R excitation table + SR 0 0 0X 0 1 10 1 0 01 1 1 X0 C. E. Stroud Latches & Flip-flops (10/12) 26

JK Flip-Flop Specification state diagram 1X 0X 0 1 X0 X1 input ordering = JK characteristic table J K + Mode 0 0 Storage 0 1 0 Reset 1 0 1 Set 1 1 Toggle J K logic diagram characteristic equation + = J + K excitation table + JK 0 0 0X 0 1 1X 1 0 X1 1 1 X0 C. E. Stroud Latches & Flip-flops (10/12) 27

Flip-Flop Initialization Preset (aka set) => + = 1 Clear (aka reset) => + = 0 Some flip-flops have: Both preset and clear (set and reset) A preset or a clear Neither (JK & SR flops have set/reset functions) Preset and/or clear can be Active high or active low Typical logic symbol with active high preset and active low clear Cannot determine sync or async from symbol Synchronous => with respect to active edge of clock Asynchronous => independent of clock edges Initialization important for: logic simulation to remove undefined logic values (2, 3, U, etc.) system operation to put system in a known state C. E. Stroud Latches & Flip-flops (10/12) 2 D Pre Clr

Synchronous vs. Asynchronous Synchronous => states of memory elements change only with respect to active edge of clock Asynchronous => states of memory elements can change without an active edge of clock Asynchronous designs often have timing problems Example: assume sync preset and async clear D Pre Clr D Pre Clr C. E. Stroud Latches & Flip-flops (10/12) 29