Digital Logic Design Lecture # 21 University of Tehran.

Slides:



Advertisements
Similar presentations
COUNTERS Counters with Inputs Kinds of Counters Asynchronous vs
Advertisements

Lecture 23: Registers and Counters (2)
State-machine structure (Mealy)
Registers and Counters
Analysis of Clocked Sequential Circuits
1 Introduction Sequential circuit –Output depends not just on present inputs (as in combinational circuit), but on past sequence of inputs Stores bits,
Sequential Circuits1 DIGITAL LOGIC DESIGN by Dr. Fenghui Yao Tennessee State University Department of Computer Science Nashville, TN.
Digital Logic Design Lecture # 17 University of Tehran.
Asynchronous Sequential Logic
Sequential Circuits and Finite State Machines Prof. Sin-Min Lee
Sequential Logic Design
Digital Logic Design Lecture 26. Announcements Exams will be returned on Thursday Final small quiz on Monday, 12/8. Final homework will be assigned Thursday,
KU College of Engineering Elec 204: Digital Systems Design
A.Abhari CPS2131 Registers A register is a group of n flip-flops each of them capable of storing one bit of information There are two types of registers:
Sequential Circuit  It is a type of logic circuit whose output depends not only on the present value of its input signals but on the past history of its.
A presentation on Counters
1 Sequential Circuits Registers and Counters. 2 Master Slave Flip Flops.
EE345: Introduction to Microcontrollers Register and Counters Prof. Ahmad Abu-El-Haija.
Digital Computer Design Fundamental
Rabie A. Ramadan Lecture 3
Unit 14 Derivation of State Graphs
Implementing software in IEC Languages in IEC IEC uses the following languages Instruction List – Assembly level programming using.
Chapter 8 -- Analysis and Synthesis of Synchronous Sequential Circuits.
1 Lecture #12 EGR 277 – Digital Logic Synchronous Logic Circuits versus Combinational Logic Circuits A) Combinational Logic Circuits Recall that there.
1 Lecture 22 Sequential Circuits Analysis. 2 Combinational vs. Sequential  Combinational Logic Circuit  Output is a function only of the present inputs.
Chapter 1_4 Part III more on … Counters Chapter 1_4 Part III more on … Counters.
1 © 2014 B. Wilkinson Modification date: Dec Sequential Logic Circuits Previously, we described the basic building blocks of sequential circuits,
Introduction to State Machine
Digital Logic Design Lecture # 19 University of Tehran.
Counters.
Synchronous Counter Design
CS151 Introduction to Digital Design Chapter 5: Sequential Circuits 5-1 : Sequential Circuit Definition 5-2: Latches 1Created by: Ms.Amany AlSaleh.
1 Lecture #14 EGR 277 – Digital Logic Self-starting counters Counters are considered to be self-starting if all unused counts eventually lead to the correct.
Sequential Logic Circuit Design Eng.Maha Alqubali.
1 Registers A register is a group of n flip-flops each of them capable of storing one bit of information There are two types of registers: parallel and.
Digital Design - Sequential Logic Design
Combinational circuits
CS 352 Introduction to Logic Design
EKT 124 / 3 DIGITAL ELEKTRONIC 1
Instructor: Alexander Stoytchev
EKT 221 – Counters.
EKT 221 : Digital 2 COUNTERS.
COMP541 Sequential Logic – 2: Finite State Machines
FIGURE 5.1 Block diagram of sequential circuit
Sequential Circuit: Counter
Counters Next, we’ll look at different kinds of counters and discuss how to build them. These are not only examples of sequential analysis and design,
Sequential Circuit - Counter -
Instructor: Alexander Stoytchev
Digital Fundamentals with PLD Programming Floyd Chapter 10
Registers and Counters Register : A Group of Flip-Flops. N-Bit Register has N flip-flops. Each flip-flop stores 1-Bit Information. So N-Bit Register Stores.
Sequential circuit design
Instructor: Alexander Stoytchev
Sequential circuit design
Instructor: Alexander Stoytchev
Sequential circuit design
Instructor: Alexander Stoytchev
Sequential Systems with Random Inputs
EET107/3 DIGITAL ELECTRONICS 1
Instructor: Alexander Stoytchev
DESIGN OF SEQUENTIAL CIRCUITS
Instructor: Alexander Stoytchev
ECE 352 Digital System Fundamentals
Binary Adder/Subtractor
ECE 352 Digital System Fundamentals
Outline Registers Counters 5/11/2019.
EGR 2131 Unit 12 Synchronous Sequential Circuits
Counters.
Chapter5: Synchronous Sequential Logic – Part 3
Digital Electronics and Logic Design
COE 202: Digital Logic Design Sequential Circuits Part 3
Presentation transcript:

Digital Logic Design Lecture # 21 University of Tehran

Outline Counter Designing a Garage Door Opener

Counter Counters are structures that are basically simple state machines. Let’s design a binary up-down counter (modulo 4), as shown in this figure, that will count up when clocked with u=1 and count down otherwise.

Counter (continued…) The state diagram and the state table:

Counter (continued…) Note that we can do state assignment in any particular form we like, here we have done our state assignment based on the outputs of the circuit. Considering that we want to use D flip flops, so the transition table and the excitation table are the same.

Counter (continued…) Now we can easily derive KMs and the circuit:

Counter (continued…) As you can see, no extra logic is needed for the outputs because we based our state assignment on our outputs. In problems such as the above we can skip some of the steps of sequential circuit design such as the state diagram and the state table because of the fairly straight forward nature of the problem description.

Counter (continued…) Consider the following modulo 5 counter design:

Counter (continued…) In such cases, the KMs can be easily drawn, because for instance the state after 000 is 001, so we place 0, 0 and 1 in the 000 square of respective KMs. The circuit:

Counter (continued…) In problem such as the above unwanted states are an important issue. For instance in this circuit we have 101, 010 and 110 as three unwanted states. Now if the circuit powers up into an unwanted state we must analyze the circuit to see what happens. This analysis can be done by either looping through the circuit or using the KMs. For instance in this circuit we will have (considering mapped don’t cares as 1s and unmapped ones as 0s): 101    010

Counter (continued…) We can usually tolerate unwanted states at power up if we are lead back into the circuit’s course after one clock pulse. This is not always the case as in the 110 state in the last example. In such cases or if we don’t want unwanted states to occur, one of the following measures can be applied: Use asynchronous set and reset as shown in the figure for this circuit. Use fixed mapping. Meaning that we forget using don’t cares in our mapping.

Counter (continued…) Repair after mapping. Meaning that we change the mappings of our circuit in order to always enter the wanted sequence after at most one clock pulse. In our example for instance we could map 101 and 100 instead of 100 and 110. Insert synchronous set and reset. This is done when asynchronous set and reset features are not available in our flip flops. Thus we can no longer override the clock and we have to add gates outside the flip flop to clear or set the flip flops value at clock pulse time:

Counter (continued…) With this solution we can redraw our design:

Counter (continued…) As a historic comment, we must mention ASM (Arithmetic State Machine) that were used historically to design state machines, but nowadays Verilog coding can be easily used instead.

Designing a Garage Door Opener Now we will see a larger design of a garage door opener.

Designing a Garage Door Opener (continued…) As a problem description, it must be said that we use a remote control with a push button that will open and close the door once pushed, changing between close and open every time it’s pressed. The door will roll completely up or completely down if not blocked. There are sensors that will sends signals to show when the door is completely down or up, another signal will also inform us when the path of the door has become blocked. Thus we will have four input signals to our system named P (Push button), U (up), D (Down) and B (Blocked).

Designing a Garage Door Opener (continued…) Our system will have three output signals to control the door O (Open), C (Close), H (Halt). The last signal occurs when something has gone badly wrong in our system and repairing is needed like when both U and D are 1. Note: Outputs O and C aren’t necessarily complements because when we don’t want the door to move, both outputs must be 0. To construct our state machine we’ll consider the following basic form for our nodes:

Designing a Garage Door Opener (continued…)

The following scenarios have been considered in our state machine: If anything gets in the path of the door when opening, nothing will happen and the door opens. When the door is closing if something appears in it’s path then B=1. When the door is opening, pressing the button will cause it to stop, and the user will have to press the button again in order to close it. HLTC (Halt During Close) is a state where the door stops moving and we know that we will be going to the opening state afterwards.

Designing a Garage Door Opener (continued…) We have considered 4 inputs for each state and thus 16 different combinations but all combinations will never be detected thus aren’t issued. An emergency state can also be considered where everything will halt and an emergency light put on. A starting state must be considered for the system at power on. For instance the door must be completely closed at the beginning.