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

Similar documents
EECS 270 Midterm Exam Spring 2011

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

Administrative issues. Sequential logic

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

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

Experiment 8 Introduction to Latches and Flip-Flops and registers

Digital Circuit And Logic Design I. Lecture 8

Digital Circuit And Logic Design I

Digital Fundamentals: A Systems Approach

Digital Fundamentals

EE292: Fundamentals of ECE

Chapter 5: Synchronous Sequential Logic

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

EECS 270 Midterm 2 Exam Closed book portion Fall 2014

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

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

Fundamentals of Computer Systems

More on Flip-Flops Digital Design and Computer Architecture: ARM Edition 2015 Chapter 3 <98> 98

Lecture 8: Sequential Logic

LATCHES & FLIP-FLOP. Chapter 7

Chapter 11 Latches and Flip-Flops

UNIT-3: SEQUENTIAL LOGIC CIRCUITS

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

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

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

The word digital implies information in computers is represented by variables that take a limited number of discrete values.

CHAPTER 6 COUNTERS & REGISTERS

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

Counters

Fundamentals of Computer Systems

A clock is a free-running signal with a cycle time. A clock may be either high or low, and alternates between the two states.

Review of digital electronics. Storage units Sequential circuits Counters Shifters

`COEN 312 DIGITAL SYSTEMS DESIGN - LECTURE NOTES Concordia University

ASYNCHRONOUS COUNTER CIRCUITS

3 Flip-Flops. The latch is a logic block that has 2 stable states (0) or (1). The RS latch can be forced to hold a 1 when the Set line is asserted.

Computer Organization & Architecture Lecture #5

CprE 281: Digital Logic

Step 1 - shaft decoder to generate clockwise/anticlockwise signals

The reduction in the number of flip-flops in a sequential circuit is referred to as the state-reduction problem.

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

FLIP-FLOPS AND RELATED DEVICES

Digital Logic Design ENEE x. Lecture 19

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

Unit 11. Latches and Flip-Flops

Digital Logic & Computer Design CS Professor Dan Moldovan Spring Chapter 3 :: Sequential Logic Design

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

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

EE 109 Homework 6 State Machine Design Name: Score:

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

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.

Clocks. Sequential Logic. A clock is a free-running signal with a cycle time.

Topic D-type Flip-flops. Draw a timing diagram to illustrate the significance of edge

CS8803: Advanced Digital Design for Embedded Hardware

Chapter 11 State Machine Design

Practice Homework Problems for Module 3

INTRODUCTION TO SEQUENTIAL CIRCUITS

Department of Electrical and Computer Engineering Mid-Term Examination Winter 2012

Decade Counters Mod-5 counter: Decade Counter:

CHAPTER 4: Logic Circuits

Vignana Bharathi Institute of Technology UNIT 4 DLD

CS 151 Final. Instructions: Student ID. (Last Name) (First Name) Signature

VU Mobile Powered by S NO Group

RS flip-flop using NOR gate

cascading flip-flops for proper operation clock skew Hardware description languages and sequential logic

CPS311 Lecture: Sequential Circuits

PGT104 Digital Electronics. PGT104 Digital Electronics

ECEN454 Digital Integrated Circuit Design. Sequential Circuits. Sequencing. Output depends on current inputs

CprE 281: Digital Logic

The outputs are formed by a combinational logic function of the inputs to the circuit or the values stored in the flip-flops (or both).

Chapter 4. Logic Design

Switching Theory And Logic Design UNIT-IV SEQUENTIAL LOGIC CIRCUITS

Previous Lecture Sequential Circuits. Slide Summary of contents covered in this lecture. (Refer Slide Time: 01:55)

MODULE 3. Combinational & Sequential logic

Chapter 5 Sequential Circuits

2.6 Reset Design Strategy

Digital Systems Laboratory 3 Counters & Registers Time 4 hours

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

Logic Design ( Part 3) Sequential Logic- Finite State Machines (Chapter 3)

Chapter 3. Boolean Algebra and Digital Logic

Chapter 6 Digital Circuit 6-5 Department of Mechanical Engineering

Computer Architecture and Organization

CHAPTER 4: Logic Circuits

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

Find the equivalent decimal value for the given value Other number system to decimal ( Sample)

COMP2611: Computer Organization. Introduction to Digital Logic

CS8803: Advanced Digital Design for Embedded Hardware

Logic Design II (17.342) Spring Lecture Outline

Introduction to Sequential Circuits

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

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

DO NOT COPY DO NOT COPY

PRE J. Figure 25.1a J-K flip-flop with Asynchronous Preset and Clear inputs

EECS 270 Group Homework 4 Due Friday. June half credit if turned in by June

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

12/31/2010. Overview. 12-Latches and Flip Flops Text: Unit 11. Sequential Circuits. Sequential Circuits. Feedback. Feedback

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

Digital Circuits ECS 371

Computer System Structures cz:struktury počítačových systémů

CS3350B Computer Architecture Winter 2015

Asynchronous (Ripple) Counters

Transcription:

EE 2 June 4, 22 igital esign Laboratory Handout #34 Midterm Examination #2 Solutions Open book, open notes. Time limit: 75 minutes. (2 points) Setup and hold times. The flip-flops below have setup time t s = 8 ns and hold time t h = 4 ns. ns ns a. Suppose the clock is delayed by exactly ns. (See the left device in the figure above.) What are the setup and hold times for this modified flip-flop? When the clock is delayed, the data may be delayed by the same amount without violating the setup time. But the hold time is increased because the clock does not arrive until later. Setup time: t s = 8 = 8 ns Hold time: t h = 4 + = 4 ns b. Suppose the data input is delayed by exactly ns. (See the right device in the figure above.) What are the setup and hold times for this modified flip-flop? Setup time: t s = 8 + = 28 ns Hold time: t h = 4 = 6 ns c. A negative-edge-triggered flip-flop can be built from a positive-edge-triggered flip-flop by inverting the clock input. (See the left device in the figure above.) Propagation delays in nanoseconds for the inverter are given in the following table. min max t LH 2 22 t HL 8 6 Find the setup and hold times for the modified flip-flop. We must use minimum rising clock delay for setup time, maximum delay for hold time. Setup time: t s = 8 2 = 6 ns Hold time: t h = 4 + 22 = 26 ns d. As you have discovered in parts (a) and (c), delaying the clock increases the hold time. To reduce the hold time, we might add delay to the data input, as shown in the right

2 EE 2, Spring 2-22 device in the figure above. (Note that the output of the modified flip-flop must now be taken from the internal flip-flop s complemented output.) Find the setup and hold times for this negative-edge-triggered flip-flop. The data window has increased from 22 ns to 46 ns not a good way to build a flip-flop! Setup time: t s = 8 2 + max(22, 6) = 28 ns Hold time: t h = 4 + 22 min(2, 8) = 8 ns 2. (2 points) Fun with counters. a. A superstitious counter is a free-running 4-bit counter that skips the value 3. Build a superstitious counter using one 74x63 4-bit counter and two 2-input gates. 74x63 CLR L ENP ENT A B C A B C RCO The combinational logic, which is equivalent to NAN3A, a 3-input NAN gate with one active low input, detects when the count is 2 (or 3). When the count reaches 2, the value 4 is loaded on the next clock, skipping 3. Otherwise, the counter runs freely. b. The output of a chirp counter is the following waveform. 6 5 4 3 4 3 2 6 The chirp output is high for 6 clocks, low for 5, high for 4, and so on until it is high of one clock duration. Then the cycle repeats. The overall period of this counter is 6 + 5 + + 2 + = (7 6)/2 = 36. Use two 4-bit counters and assorted gate(s) to build a chirp counter.

Midterm Examination #2 Solutions 3 VCC WAV 74x63 74x63 CLR CLR L L ENP ENP ENT ENT A A A A B B B B C C C C RCO RCO The left counter loads the right counter with a new start value each time the right counter reaches the maximum value of 5 and RCO goes high. At the same time, the left counter is incremented. Suppose that the value to be loaded into the right counter is. When the right counter reaches 5, RCO goes high, and at the next rising clock edge, the left counter value increments to, so the output WAV is high. The right counter increments at the next clock. After 6 clock cycles, RCO causes to be loaded into the right counter and the output WAV toggles low. After 5 clocks, 2 is loaded into the right counter, the left counter increments so WAV toggles high, and so on. 3. (3 points) FIFO. A 3-deep FIFO stores up to three words of data that are retrieved ( read ) in a first-in first-out manner. The state of the FIFO control unit is the two-bit binary number in the range {,..., 3 that tells how many words are stored in the FIFO. The FIFO state machine has two control inputs, R ( read ) and WR ( write ), and two outputs, FULL and EMPTY. The FIFO controller also has internal signals, SEL and SEL, that select which stored data value to supply to the output. IN WR E E E 2 OUT 3 R WR SEL[:] FIFOCTL R EMPTY EMPTY FULL FULL

4 EE 2, Spring 2-22 The control inputs are examined at each rising edge of the system clock. When WR alone is asserted, the FIFO state is incremented by, whereas when R alone is asserted, the FIFO state is decremented by. If both R and WR are asserted when the FIFO is nonempty, the FIFO state remains unchanged, since a new word is written into the FIFO while the oldest word is read and removed. Finally, when neither R nor WR is active, the FIFO remains unchanged. The FIFO silently ignores attempts to write when it is full or to read when it is empty. The Moore outputs FULL and EMPTY report when the FIFO is full or empty, respectively. a. Fill in the following transition/output table for the FIFO state machine. R, WR FULL EMPTY *,* b. Find simplified transition/output equations for the FIFO state machine. The canonical sums for and each have 8 minterms. Using Karnaugh maps, we obtain simpler sum-of-products representations. Other simplified equations might make use of intermediate expressions such as R WR. * = + R + WR + R WR * = R WR + WR + R + WR + R WR FULL = EMPTY =

Midterm Examination #2 Solutions 5 4. (3 points) Mouse encoder. The optical encoder wheel in a mechanical ball mouse produces detector pulses that indicate the speed and direction of motion. ET + + ET2 counterclockwise stopped clockwise stopped CCW CW raw the state diagram of a clocked synchronous state machine whose inputs are the detector pulses and whose outputs are signals that can be used by an up/down counter. MOUSE ET CW ET2 CCW This state machine has two Moore outputs, CW and CCW. CW should be active for one clock period when the encoder wheel has completed a clockwise step (indicated by the down arrows in the timing diagram), and CCW should be active for one clock period when the disk has completed a counterclockwise step. Your state machine must accommodate input signals that are not debounced; you may assume that the output of each detector is stable before the other detector output changes. This problem is open ended; there are quite a few situations to consider. More credit will be given for more complete solutions. A single state diagram is not the proper way to represent the optical encoder processing machine, for two reasons: The state machine can be more simply realized by breaking it into two or more smaller machines. Much of the state consists of past values of the inputs and outputs, which can be stored in external flip-flops. In fact, the Moore outputs are really pipelined Mealy outputs, which store the values of Mealy outputs for a complete clock period. First we design a state machine assuming that the inputs are debounced. The software for version of this state machine uses four variables: PREV and PREV2 are the values of the detector outputs during the previous clock cycle, and CW and CCW are the outputs that are pulsed for one clock period when a falling edge is detected on one detector output while the other detector output is high. The debounced inputs are EB and EB2.

6 EE 2, Spring 2-22 for (;;) { if (EB2 == && EB == && PREV == ) CCW = ; if (EB == && EB2 == && PREV2 == ) CW = ; PREV = EB; PREV2 = EB2; The hardware realization uses four flip-flops for state variables and Moore outputs. EB PREV CCW EB2 PREV2 CW The detector signals can be used to debounce each other. When one signal changes, further changes of that signal can be ignored until the other signal changes. In order to detect changes, the previous value of the detector signals are remembered. We need one more variable: the value of the signal that changed most recently; call this variable CHANGE. for (;;) { if (ET!= PREV == && CHANGE == 2) { EB = ET; CHANGE = ; if (ET2!= PREV == 2 && CHANGE == ) { EB2 = ET2; CHANGE = 2; PREV = ET; PREV2 = ET2; In the hardware realization shown below, the flip-flop that stores CHANGE represents detector by value. Clock connections are omitted to simplify the diagram. CHANGE_CHANGE S CHANGE ET PREV S EB ET2 PREV2 S EB2