TMEL53, DIGITALTEKNIK. INTRODUCTION TO SYNCHRONOUS CIRCUITS, FLIP-FLOPS and COUNTERS

Similar documents
CHAPTER 6 COUNTERS & REGISTERS

Figure 30.1a Timing diagram of the divide by 60 minutes/seconds counter

Experiment 8 Introduction to Latches and Flip-Flops and registers

Sequential Digital Design. Laboratory Manual. Experiment #7. Counters

Module -5 Sequential Logic Design

Lecture 8: Sequential Logic

Collections of flip-flops with similar controls and logic

Lecture 11: Synchronous Sequential Logic

Laboratory 1 - Introduction to Digital Electronics and Lab Equipment (Logic Analyzers, Digital Oscilloscope, and FPGA-based Labkit)

Digital Fundamentals: A Systems Approach

Scanned by CamScanner

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

DIGITAL SYSTEM FUNDAMENTALS (ECE421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE422) COUNTERS

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

Asynchronous (Ripple) Counters

ELCT201: DIGITAL LOGIC DESIGN

Digital Circuit And Logic Design I. Lecture 8

Digital Circuit And Logic Design I

DO NOT COPY DO NOT COPY

Name: Date: Suggested Reading Chapter 7, Digital Systems, Principals and Applications; Tocci

Asynchronous Counter

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

Experiment # 9. Clock generator circuits & Counters. Digital Design LAB

Other Flip-Flops. Lecture 27 1

Counters

Digital Logic Design I

Flip-Flops and Sequential Circuit Design

The University of Texas at Dallas Department of Computer Science CS 4141: Digital Systems Lab

EET2411 DIGITAL ELECTRONICS

We are here. Assembly Language. Processors Arithmetic Logic Units. Finite State Machines. Circuits Gates. Transistors

EKT 121/4 ELEKTRONIK DIGIT 1

Logic Design. Flip Flops, Registers and Counters

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

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

CHAPTER1: Digital Logic Circuits

Activity Sequential Logic: An Overview

CHAPTER 4: Logic Circuits

EECS150 - Digital Design Lecture 19 - Finite State Machines Revisited

ECE 341. Lecture # 2

CSE Latches and Flip-flops Dr. Izadi. NOR gate property: A B Z Cross coupled NOR gates: S M S R Q M

Chapter 3 Unit Combinational

Final Exam review: chapter 4 and 5. Supplement 3 and 4

1. Convert the decimal number to binary, octal, and hexadecimal.

Digital Systems Laboratory 3 Counters & Registers Time 4 hours

Logic Design II (17.342) Spring Lecture Outline

Sri Vidya College of Engineering And Technology. Virudhunagar Department of Electrical and Electronics Engineering

Timing Pulses. Important element of laboratory electronics. Pulses can control logical sequences with precise timing.

EE 121 June 4, 2002 Digital Design Laboratory Handout #34 CLK

Sequential Digital Design. Laboratory Manual. Experiment #3. Flip Flop Storage Elements

Today 3/8/11 Lecture 8 Sequential Logic, Clocks, and Displays

CHAPTER 4: Logic Circuits

Counter dan Register

PHYSICS 5620 LAB 9 Basic Digital Circuits and Flip-Flops

Counters. ENT 263 Digital Electronics

CPSC 121: Models of Computation Lab #5: Flip-Flops and Frequency Division

EE 200 Problem Set 3 Cover Sheet Fall 2015

Chapter 9 Counters. Clock Edge Output Q 2 Q 1 Q

ASYNCHRONOUS COUNTER CIRCUITS

Logic Gates, Timers, Flip-Flops & Counters. Subhasish Chandra Assistant Professor Department of Physics Institute of Forensic Science, Nagpur

DALHOUSIE UNIVERSITY Department of Electrical & Computer Engineering Digital Circuits - ECED 220. Experiment 4 - Latches and Flip-Flops

CPSC 121: Models of Computation Lab #5: Flip-Flops and Frequency Division

Register Transfer Level in Verilog: Part II

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

3/5/2017. A Register Stores a Set of Bits. ECE 120: Introduction to Computing. Add an Input to Control Changing a Register s Bits

Dr. Shahram Shirani COE2DI4 Midterm Test #2 Nov 19, 2008

Universal Asynchronous Receiver- Transmitter (UART)

Sequential Logic Basics

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

Exercise 2: D-Type Flip-Flop

Chapter 1: Switching Algebra Chapter 2: Logical Levels, Timing & Delays. Introduction to latches Chapter 9: Binary Arithmetic

Switching Circuits & Logic Design, Fall Final Examination (1/13/2012, 3:30pm~5:20pm)

Sequential Logic Circuits

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

Chapter 5 Sequential Systems. Introduction

LATCHES & FLIP-FLOP. Chapter 7

Administrative issues. Sequential logic

Chapter Contents. Appendix A: Digital Logic. Some Definitions

Chapter 7 Counters and Registers

EECS 140 Laboratory Exercise 7 PLD Programming

Latches, Flip-Flops, and Registers. Dr. Ouiem Bchir

Registers and Counters

2. Counter Stages or Bits output bits least significant bit (LSB) most significant bit (MSB) 3. Frequency Division 4. Asynchronous Counters

Digital Design, Kyung Hee Univ. Chapter 5. Synchronous Sequential Logic

Chapter 5 Synchronous Sequential Logic

Digital Circuits I and II Nov. 17, 1999

Practice Homework Problems for Module 3

Advanced Digital Logic Design EECS 303

Registers and Counters

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

Course Administration

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

Electrical & Computer Engineering ECE 491. Introduction to VLSI. Report 1

CprE 281: Digital Logic

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

EXPERIMENT 13 ITERATIVE CIRCUITS

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

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

Chapter 5: Synchronous Sequential Logic

Sequential Logic Counters and Registers

VU Mobile Powered by S NO Group

Transcription:

LINKÖPING UNIVERSITY Department of Electrical Engineering TMEL53, DIGITALTEKNIK INTRODUCTION TO SYNCHRONOUS CIRCUITS, FLIP-FLOPS and COUNTERS Mario Garrido Gálvez mario.garrido.galvez@liu.se Linköping, 2017 1

STRUCTURE OF A HW SYSTEM Combinational logic: Its output only depends on the current input. Sequential logic: Its output depends on present and previous values. They are memory elements. At each clock event, the output of the sequential logic is updated. This makes the combinational logic have new inputs, and the combinational logic makes the calculations for the new inputs. Sequential Logic Combinational Logic Sequential Logic Combinational Logic Sequential Logic Input Output clk 2

(DIGITAL) MUSIC The clock is like a conductor in an ochestra. There is only one and assures that everything is synchronized. With two conductors the orchestra cannot be synchronized. Only one clock signal in the system!! The conductor defines the tempo of the music. In a digital system, this tempo is given by the clock frequency (or the clock period). And the instruments? -> Sequential logic. The clock is only connected to the sequential logic and only connected as a clock, not as a normal input. 3

CLOCK The clock of a digital system is a periodical signal that changes alternatively between one and zero. The time in a digital system in measured in clock cycles. The clock period (T CLK ) is the time in seconds between two consecutive clock cycles. The clock frequency (f CLK ) is the inverse of the clock period and indicates the number of clock cycles per second, measured in Hz. Higher clock frequency means faster processing. All the digital system must be synchronized with the clock and updates every clock cycle. The sequential logic is activated only in the rising edge (alternatively the falling edge) of the clock. Rising edge Falling edge CLK T CLK Clock cycles time (s) f CLK 1 T CLK 4

D FLIP-FLOP (D-VIPPA) OR REGISTER clk D Q D(n-1) Q(n-1) Q(n) 0 0 0 0 1 0 1 0 1 1 1 1 Behavior: every time that there is a transition in clk (from 0 to 1 ), the value at the input is stored in the flip-flop. The value stored in the flip-flop is always provided at the output Q. The output at the n-th clock cycle is equal to the input at the (n-1)-th clock cycle, i.e., Q(n) = D(n-1) => the D flip-flop delays data 1 clock cycle. n is the number of clock cycle. Can be used to store data. 5

TIMING DIAGRAM (TIDSDIAGRAM) a clk D Q clk D Q c n 0 1 2 3 4 5 6 clk a 1 0 0 1 0 1 1 b c 1 0 0 1 0 1 1 0 0 1 0 n: number of clock cycle. Signals only change in the rising edge of the clock. Each flip-flop delays the signal one clock cycle. 6

WHAT DOES THIS CIRCUIT DO? a clk D Q b c 1. Complete the timing diagram: n 0 1 2 3 4 5 6 clk a 1 0 0 1 0 1 1 b c 2. What is the function of the circuit? 7

T FLIP-FLOP (T-VIPPA) clk T Q T(n-1) Q(n-1) Q(n) 0 0 0 0 1 1 1 0 1 1 1 0 Behavior: every time that there is a transition in clk (from 0 to 1 ), the value stored in the flip-flop toggles if T=1, and keeps the same value if T=0. The value stored in the flip-flop is always provided at the output Q. The output at the n-th clock cycle is Q(n) = T(n-1) Q(n-1). 8

JK FLIP-FLOP (JK-VIPPA) J K Q Q J(n-1) K(n-1) Q(n) 0 0 Q(n-1) 0 1 0 1 0 1 1 1 Q(n-1) Question 1: How can we create a D flip-flop by using a JK flip-flop and logic gates? Question 2: How can we create a T flip-flop by using a JK flip-flop and logic gates? 9

COUNTERS (RÄKNARE) Each clock cycle when the count is enabled, the counter counts. Generally the counters count up, but some counters can also count down. There are binary counters (0 2^(b-1)) and decade counters (0 9). 4-bit decade count (up) 0000 0001 0010 1001 0000 5-bit binary count (down) 11111 11110 00001 00000 11111 10

COUNTER CHIPS 74LS160: 4-bit decade counter. 74LS163: 4-bit binary counter. 74LS669: 4-bit up/down binary counter. 74LS160 74LS163 How would the 74LS669 count? 11

COUNTERS 74LS160 and 74LS163 74LS160 and 74LS163 CLR LD ENP ENT A B C D CLK QA QB QC QD RCO By default, the counter counts up. After it reaches 9 (74LS160) or 15 (74LS163), it continues with 0. The count is shown in the bits [QD, DC, QB, QA]. CLK: clock input. CLR (clear): sets the count to 0. Active LOW. LD (load): loads the value in [D,C,B,A] to the count. Active LOW. D is the MSB and A the LSB. ENP & ENT: enable signals. They have to be active to enable the count. RCO (Ripple-carry output): It is active when the counter reaches 9 (74LS160) or 15 (74LS163). Allows for interconnecting several counters and make a bigger one. 12

TIMING DIAGRAM 74LS160 13

COUNT FROM 0 TO 9 WITH A 74LS163 The 74LS163 is a 4-bit binary counter. How can we make it count from 0 to 9? 74LS163 CLOCK +5 V R CLK CLR LD ENP ENT A B C D QA QB QC QD RCO Q0 Q1 Q2 Q3 14

EXERCISE Use a 74LS163 and logic gates to count cyclically from 5 to 10, i.e., 5,6,7,8,9,10,5,6, 15

COUNTER: 74LS669 74LS669 CLK U/D LD ENP ENT A QA B QB C QC D QD RCO Similar to the 74x163, but can count up and down using the signal UP/DN. Note that some signals are active LOW. 16

LAB 1 Time to finish the preparations of lab 1 17

EXERCISES (1) Draw the first 10 clock cycles of the timing diagram of the following circuit. Consider that the values in the registers are Q1 = 0 and Q0 = 0 at n = 0. clk D Q clk D Q Q1 Q0 18

EXERCISES (2) Describe the behavior of this circuit. If you need it, you can make use of a timing diagram. a) When Q[0] = 0. b) When Q[0] = 1. x clk D Q u 19

EXERCISES (3) What does this circuit do? If you need it, you can make use of a timing diagram. 74LS163 CLOCK +5 V R CLK CLR LD ENP ENT A B C D QA QB QC QD RCO 20

EXERCISES (4) What does this circuit do? If you need it, you can make use of a timing diagram. The only difference with respect to the previous exercise is that we are using a 74LS160 instead of a 74LS163. 74LS160 CLOCK +5 V R CLK CLR LD ENP ENT A B C D QA QB QC QD RCO 21

EXERCISES (5) What does this circuit do? If you need it, you can make use of a timing diagram. 74LS669 CLOCK D Q +5 V R CLK U/D LD ENP ENT A B C D QA QB QC QD RCO 22

LINKÖPING UNIVERSITY Department of Electrical Engineering TMEL53, DIGITALTEKNIK STATE MACHINES Mario Garrido Gálvez mario.garrido.galvez@liu.se Linköping, 2017 23

FINITE-STATE MACHINES (TILLSTÅNDSMASKIN) sequential logic next state combinational logic clk current state next state logic inputs output logic outputs - Moore: The output is obtained from the current state => it only changes when the clock changes. - Mealy: The output is obtained from the current state and from the inputs=> it may change at any time due to a change in the inputs. 24

FINITE-STATE MACHINES A finite-state machine or just state machine is a circuit that evolves through different states (tillstånd). It can only be at one state at a time. Every clock cycle the state is updated. The transitions among states and the output values depend on the current state and on the input values. It combines sequential and combinational logic. The sequential logic consists in one or several registers that store the current state. The combinational logic is used to calculate the next state and the outputs. 25

HOW TO DESIGN A STATE MACHINE 1) Define the states of the state machine: -Moore: One state for each combination of internal variables. - Mealy: One state for each combination of internal variables and input values. 2) Draw the state diagram. 3) Do the coding of the states. 4) Draw the transition table. The transition table is a truth table with the input signals and current states as inputs. From them we calculate the values for the next state and for the output signals. 5) Obtain the logic function of each of the variables that define the next state as a function of the inputs and the current state. Obtain the logic function of each output as a function of the current state (and also the inputs in case of Mealy). 6) Implement the circuit. 26

HOW TO ANALYZE A STATE MACHINE The analysis is the inverse process to the design of a state machine: It goes from the circuit to the state diagram. The steps are: 1) Obtain the logic functions: the next states and outputs as a function of the current states and inputs. 2) Draw the transition table. Put input signals and current states as inputs. From them, calculate the values for the next state and for the output signals. 3) Draw the state diagram. 27