Design: a mod-8 Counter



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

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

Module 3: Floyd, Digital Fundamental

Lecture 8: Synchronous Digital Systems

CHAPTER 11 LATCHES AND FLIP-FLOPS

Counters and Decoders

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

Flip-Flops and Sequential Circuit Design

ECE380 Digital Logic

Counters & Shift Registers Chapter 8 of R.P Jain

CHAPTER IX REGISTER BLOCKS COUNTERS, SHIFT, AND ROTATE REGISTERS

Lesson 12 Sequential Circuits: Flip-Flops

Take-Home Exercise. z y x. Erik Jonsson School of Engineering and Computer Science. The University of Texas at Dallas

Digital Logic Design Sequential circuits

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.

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

Decimal Number (base 10) Binary Number (base 2)

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

DIGITAL ELECTRONICS. Counters. By: Electrical Engineering Department

ENEE 244 (01**). Spring Homework 5. Due back in class on Friday, April 28.

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

Chapter 8. Sequential Circuits for Registers and Counters

Engr354: Digital Logic Circuits

Contents COUNTER. Unit III- Counters

Sequential Logic Design Principles.Latches and Flip-Flops

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

Asynchronous Counters. Asynchronous Counters

Registers & Counters

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

CS311 Lecture: Sequential Circuits

7. Latches and Flip-Flops

Memory Elements. Combinational logic cannot remember

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

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

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

The components. E3: Digital electronics. Goals:

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

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

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

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

The 104 Duke_ACC Machine

3.Basic Gate Combinations

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

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

Combinational Logic Design Process

BINARY CODED DECIMAL: B.C.D.

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

Counters. Present State Next State A B A B

Gates, Plexers, Decoders, Registers, Addition and Comparison

CSE140: Components and Design Techniques for Digital Systems

Upon completion of unit 1.1, students will be able to

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

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

(Refer Slide Time: 00:01:16 min)

EXPERIMENT 8. Flip-Flops and Sequential Circuits

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

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

Digital Fundamentals. Lab 8 Asynchronous Counter Applications

1.1 The 7493 consists of 4 flip-flops with J-K inputs unconnected. In a TTL chip, unconnected inputs

CHAPTER 3 Boolean Algebra and Digital Logic

Reading 13 : Finite State Automata and Regular Expressions

[ 4 ] Logic Symbols and Truth Table

Digital Electronics Detailed Outline

RETRIEVING DATA FROM THE DDC112

Register File, Finite State Machines & Hardware Control Language

Digital Controller for Pedestrian Crossing and Traffic Lights

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

Topics. Flip-flop-based sequential machines. Signals in flip-flop system. Flip-flop rules. Latch-based machines. Two-sided latch constraint

Lecture-3 MEMORY: Development of Memory:

CHAPTER 11: Flip Flops

Napier University. School of Engineering. Electronic Engineering A Module: SE42205 Digital Design

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

Gray Code Generator and Decoder by Carsten Kristiansen Napier University. November 2004

Gates, Circuits, and Boolean Algebra

Microprocessor & Assembly Language

2 : BISTABLES. In this Chapter, you will find out about bistables which are the fundamental building blocks of electronic counting circuits.

ASYNCHRONOUS COUNTERS

Lab #5: Design Example: Keypad Scanner and Encoder - Part 1 (120 pts)

Lecture 12: More on Registers, Multiplexers, Decoders, Comparators and Wot- Nots

CSE140 Homework #7 - Solution

Cascaded Counters. Page 1 BYU

Chapter 5. Sequential Logic

Using Xilinx ISE for VHDL Based Design

Sequential Circuit Design

Figure 8-1 Four Possible Results of Adding Two Bits

3-Digit Counter and Display

Chapter 2 Logic Gates and Introduction to Computer Architecture

Fig1-1 2-bit asynchronous counter

Chapter 9 Latches, Flip-Flops, and Timers

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

DM74LS112A Dual Negative-Edge-Triggered Master-Slave J-K Flip-Flop with Preset, Clear, and Complementary Outputs

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

Lab 11 Digital Dice. Figure Digital Dice Circuit on NI ELVIS II Workstation

Finite State Machine. RTL Hardware Design by P. Chu. Chapter 10 1

PURDUE UNIVERSITY NORTH CENTRAL

Binary Adders: Half Adders and Full Adders

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

Transcription:

Design: a mod-8 Counter A mod-8 counter stores a integer value, and increments that value (say) on each clock tick, and wraps around to 0 if the previous stored value was 7. So, the stored value follows a cycle: 000 00 00 0 00 0 0

Design: State Machine 2 We need eight different states for our counter, one for each value from 0 to 7. We can describe the operation by drawing a state machine. The nodes represent states and the edges represent transitions and are labeled with the input (clock in this case) that causes the transition to occur. 000 00 00 0 0 0 00

Design: State Table 3 A state table summarizes the state machine and is useful in deriving equations later: Current State Input Next State ------------------------------------ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 000 00 00 0 0 0 00

Design: Deriving Equations We will derive an equation for each of the next state functions: Current State Input Next State C2 C C0 N2 N N0 ------------------------------------ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 N0= C2 C C0+ C2 C C0+ C2 C C0+ C2 C C0= C0 4 N= C2 C C0+ C2 C C0+ C2 C C0+ C2 C C0= C C0+ C C0 N 2= C2 C C0+ C2 C C0+ C2 C C0+ C2 C C0 = C2 C C0+ C2 C+ C2 C0

Design: Mapping to D Flip-flops 5 Since each state is represented by a 3-bit integer, we can represent the states by using a collection of three flip-flops (more-or-less a mini-register). We will implement the circuit using D flip-flops, which make for a simple translation from the state table because a D flip-flop simply accepts its input value. D Q ~Q ------------ 0 0 0 0 0 0 So, we just need to feed each of the flip-flops the value of the appropriate next-state function equation derived earlier

D Flip-flop 6 The D flip-flop takes one data input and updates its state Q, on a clock tick, according to the table: D Q ~Q ------------ 0 0 D CK Q ~Q In the following Logisim diagrams, the D flip-flops update state on the falling edge (when the clock goes from high to low).

JK Flip-flop 7 The JK flip-flop takes two data inputs and updates its state Q, on a clock tick, according to the table: J K Q ~Q ---------------------- 0 0 no change 0 0 0 0 opposite J K CK Q ~Q In the following Logisim diagrams, the JK flip-flops update state on the falling edge (when the clock goes from high to low).

Implementation 8 N 2= C2 C C0+ C2 C+ C2 C0 N= C C0+ C C0 N0= C0

Design: Mapping to JK Flip-flops We could also implement the circuit using JK flip-flops. 9 J K Q ~Q ---------------------- 0 0 no change 0 0 0 0 opposite This will require a little more effort, since the inputs to the JK flip-flops cannot merely be set to equal the next state functions.

Design: Deriving JK Inputs 0 We must examine each current/next state pair and determine how/if the relevant flip-flop needs to change state: Flip-flop Inputs Current State Next State J2 K2 J K J0 K0 ------------------------------------------------------ 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 0 0 0 0 0 0 0 0 0 0 0 0 For this simple circuit, we either want the JK flip-flop to hold state (both inputs 0) or to toggle state (both inputs ).

Design: Deriving JK Input Equations We can derive equations in the usual manner from the previous table: J 0= K0= Flip-flop Inputs Current State J2 K2 J K J0 K0 C2 C C0 ---------------------------------------- 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 J= K= C2 C C0+ C2 C C0+ C2 C C0+ C2 C C0 = C0 J 2= K 2= C2 C C0+ C2 C C0= C C0

Implementation 2 J= K= C0 J 2= K 2= C C0 J 0= K0=

A mod-6 Counter 3 We can use JK flip-flops to implement a 4-bit counter: Note that the J and K inputs are all set to the fixed value, so the flip-flops "toggle". As the clock signal runs, the circuit will cycle its outputs through the values 0000, 000, 000,..., and then repeat the pattern. So, it counts clock ticks, modulo 6.

mod-6 Counter: first tick 4 Suppose the counter is in the initial state shown below (output is 0000). When the clock cycles from high to low: - the right-most sees its (inverted) clock signal go from low to high, and so it toggles its state to - the next flip-flop sees its clock signal go from high to low, and so it doesn't toggle - and so, neither do the other flip-flops So, the output is 000:

mod-6 Counter: second tick 5 Suppose the counter is now in the state shown below (output is 000). When the clock cycles from high to low (2 nd cycle): - the right-most sees its (inverted) clock signal go from low to high, and so it toggles its state to 0 - the next flip-flop sees its clock signal go from low to high, and so it toggles its state to - the next flip-flop sees its clock signal go from high to low, so it doesn't toggle So the output is 000.

mod-6 Counter: third tick 6 Suppose the counter is now in the state shown below (output is 000). When the clock cycles from high to low (3rd cycle): - the right-most sees its (inverted) clock signal go from low to high, and so it toggles its state to - the next flip-flop sees its clock signal go from high to low, and so it doesn't toggle So the output is 00.

mod-6 Counter: fourth tick 7 Suppose the counter is now in the state shown below (output is 00). When the clock cycles from high to low (4th cycle): - the right-most sees its (inverted) clock signal go from low to high, and so it toggles its state to 0 - the next flip-flop sees its clock signal go from low to high, and so it toggles its state to 0 - the next flip-flop sees its clock signal go from low to high, and so it toggles its state to So the output is 000.