Design Example: Demo Display Unit

Similar documents
Introduction. Serial In - Serial Out Shift Registers (SISO)

Register Transfer Level in Verilog: Part II

Asynchronous (Ripple) Counters

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

Counter dan Register

Sequencing and Control

Logic Design. Flip Flops, Registers and Counters

ELCT 501: Digital System Design

Administrative issues. Sequential logic

Counters

Modeling Digital Systems with Verilog

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

State Transistional Logic

Digital Design Datapath Components: Parallel Load Register

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

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

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

Control Unit. Arturo Díaz-Pérez Departamento de Computación Laboratorio de Tecnologías de Información CINVESTAV-IPN

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

Logic. Andrew Mark Allen March 4, 2012

The basic logic gates are the inverter (or NOT gate), the AND gate, the OR gate and the exclusive-or gate (XOR). If you put an inverter in front of

LSN 12 Shift Registers

Logic Design II (17.342) Spring Lecture Outline

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

First Name Last Name November 10, 2009 CS-343 Exam 2

University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Science SOLUTIONS

ENGG 1203 Tutorial. D Flip Flop. D Flip Flop. Q changes when CLK is in Rising edge PGT NGT

Computer Systems Architecture

CprE 281: Digital Logic

EET 1131 Lab #10 Latches and Flip-Flops

Registers and Counters

CSE 352 Laboratory Assignment 3

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

Digital Logic Design ENEE x. Lecture 24

Logic Design II (17.342) Spring Lecture Outline

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

Digital 1 Final Project Sequential Digital System - Slot Machine

Sequential Logic Counters and Registers

Experiment 8 Introduction to Latches and Flip-Flops and registers

EECS150 - Digital Design Lecture 19 - Finite State Machines Revisited

Outcomes. Spiral 1 / Unit 6. Flip-Flops FLIP FLOPS AND REGISTERS. Flip-flops and Registers. Outputs only change once per clock period

CprE 281: Digital Logic

Advanced Devices. Registers Counters Multiplexers Decoders Adders. CSC258 Lecture Slides Steve Engels, 2006 Slide 1 of 20

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

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Electrical Engineering and Computer Sciences

Using minterms, m-notation / decimal notation Sum = Cout = Using maxterms, M-notation Sum = Cout =

ASYNCHRONOUS COUNTER CIRCUITS

VTU NOTES QUESTION PAPERS NEWS RESULTS FORUMS Registers

Synthesis Technology E102 Quad Temporal Shifter User Guide Version 1.0. Dec

Serial In/Serial Left/Serial Out Operation

Computer Organization & Architecture Lecture #5

Unit 11. Latches and Flip-Flops

Universal Asynchronous Receiver- Transmitter (UART)

Registers and Counters

Sequential Logic Notes

Module 4:FLIP-FLOP. Quote of the day. Never think you are nothing, never think you are everything, but think you are something and achieve anything.

Flip-Flops and Sequential Circuit Design

University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Science. EECS 150 Spring 2000

D Latch (Transparent Latch)

University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Science

Registers. Unit 12 Registers and Counters. Registers (D Flip-Flop based) Register Transfers (example not out of text) Accumulator Registers

Digital Systems Laboratory 3 Counters & Registers Time 4 hours

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

CS3350B Computer Architecture Winter 2015

The NOR latch is similar to the NAND latch

Catch or Die! Julia A. and Andrew C. ECE 150 Cooper Union Spring 2010

MODULE 3. Combinational & Sequential logic

CHAPTER 4: Logic Circuits

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

VARIABLE FREQUENCY CLOCKING HARDWARE

Sequential Logic and Clocked Circuits

COMP2611: Computer Organization. Introduction to Digital Logic

INC 253 Digital and electronics laboratory I

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

Why do we need to debounce the clock input on counter or state machine design? What happens if we don t?

Contents Circuits... 1

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

Universidad Carlos III de Madrid Digital Electronics Exercises

Logic Devices for Interfacing, The 8085 MPU Lecture 4

EKT 121/4 ELEKTRONIK DIGIT 1

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

COMP sequential logic 1 Jan. 25, 2016

DIGITAL REGISTERS. Serial Input Serial Output. Block Diagram. Operation

Registers and Counters

CprE 281: Digital Logic

CHAPTER1: Digital Logic Circuits

Lecture 12. Amirali Baniasadi

University of Victoria. Department of Electrical and Computer Engineering. CENG 290 Digital Design I Lab Manual

# "$ $ # %!"$!# &!'$("!)!"! $ # *!"! $ '!!$ #!!)! $ "# ' "

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

Factory configured macros for the user logic

Laboratory Exercise 7

Synchronous sequential circuits

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

Implementation of BIST Test Generation Scheme based on Single and Programmable Twisted Ring Counters

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

Step 1 - shaft decoder to generate clockwise/anticlockwise signals

Digital Electronics II 2016 Imperial College London Page 1 of 8

Read-only memory (ROM) Digital logic: ALUs Sequential logic circuits. Don't cares. Bus

EE178 Spring 2018 Lecture Module 5. Eric Crabill

Transcription:

Design Example: Demo Display Unit Say we are given an arrangement of 8 LEDs in a diamond pattern, with the LED labelled 7 at the top of the diamond, then numbered down to 0 in the clockwise direction. (See diagram). We are told that the following behaviour is desired. When the START button is pressed, the system displays 10000000 on the LEDs (that is, LED 7 is lit, and all the rest are off). On every clock pulse, the LED to the left of the current lit LED lights up, and the LED that was lit is turned off. Thus, the LEDs are lit one at a time, in a counterclockwise direction. This continues until 11 clock cycles have passed, or until the user presses the REVERSE button. Then the LEDs are lit one at a time, moving now in the clockwise direction, until 11 clock cycles have passed, or until the user presses the REVERSE button. Then, the LED starts moving counterclockwise again. This process of moving counterclockwise, then clockwise, then counterclockwise, and so on continues until the user presses STOP, at which time the LEDs state however they were when STOP was pressed. This sort of display might be used in a gadget or toy as some kind of fancy display. Or, alternately, if the clock is fast enough, it might serve as a sort of randomizer. (In reality, this is a pretty contrived example, but a useful one). So we consider our overall system. As always, we break things up into control and datapath. The inputs to the controller consist of the top-level system inputs START, STOP, and REVERSE. The LEDs are driven by the datapath. At this point, we don t know enough about the datapath to determine what kind of signals we need between the controller and datapath. Copyright 2003 by Andrew W. H. House Page 1 of 7

So we must now design the datapath. Datapath Well, the behaviour of the system is such that it involves lighting up adjacent LEDs in either the left or right directions. Visually, it appears as if the lit LEDs is moving around the circle. We know of a basic component that allows bits to move to adjacent locations the shift register. So we can conclude that we probably need an 8-bit universal shift register. The shift register will load to the desired 10000000 patter when START is pressed, then shift either left or right to emulate the lit LED moving counterclockwise or clockwise. Not that to do this successfully, we need to hook up the least significant output of the shift register to the SIR (shift-in-right) input, and the most significant output to the SIL (shift-in-left) input to allow the bit to wrap around. We can build our 8-bit shift register out of two 74194 devices, or just assume it exists (see multiplier example). The shift register operation is set by the controller. The LEDs are driven directly by the outputs of the shift register. We also have to count until 11. This suggests a counter. A 4-bit counter will be sufficient. Because the counter starts counting at zero, we actually check to see when the counter has reached 10 before reloading. The loading of the counter to zeroes is controlled by the state machine. The outputs of the counter are used to send a signal to the controller as to how many clock cycles have passed. The datapath is fully drawn in the diagram on the next page. Copyright 2003 by Andrew W. H. House Page 2 of 7

Copyright 2003 by Andrew W. H. House Page 3 of 7

With the datapath designed, we can complete our top level diagram to show the communication between the controller and datapath. Controller Now we can design the controller for our system, since we know its inputs (START, STOP, REVERSE, CLK_11) and its outputs (S0, S1, and LOAD_CNT). We will start in an IDLE state. We can specify that this state holds the output to whatever it currently is, since nothing in our original specification said what the LEDs displayed before START is pressed. When START is pressed, we must load the counter, load the initial pattern into the shift register, and start shifting left until CLK_11 is high or REVERSE is high. Then, we start shifting right until CLK_11 is high or REVERSE is high, and so on. If STOP is pressed at any time after leaving the idle state, we return to idle on the next clock edge. The ASM chart for this algorithm is on the next page. Because there are only three states, and for the sake of a bit of variety from the other examples we ve covered in class, we will use one-hot design. Hence, we need three flip-flops to store the state variables: C k, B k, and A k. We will map the IDLE state to 001, LEFT to 010, and RIGHT to 100. Copyright 2003 by Andrew W. H. House Page 4 of 7

Copyright 2003 by Andrew W. H. House Page 5 of 7

From the ASM chart we can write the state sequences: Current State C k B k A k Next State C k+1 B k+1 A k+1 Conditions IDLE 001 IDLE 001 START LEFT 010 START LEFT 010 LEFT 010 STOP @CLK_11 @REVERSE RIGHT 100 STOP @(REVERSE + CLK_11) IDLE 001 STOP RIGHT 100 RIGHT 100 STOP @CLK_11 @REVERSE LEFT 010 STOP @(REVERSE + CLK_11) IDLE 001 STOP C k+1 = LEFT@STOP @(REVERSE + CLK_11) + RIGHT@STOP @CLK_11 @REVERSE = B k @STOP @(REVERSE + CLK_11) + A k @STOP @CLK_11 @REVERSE B k+1 = IDLE@START + LEFT@STOP @CLK_11 @REVERSE + RIGHT@STOP @(REVERSE + CLK_11) = A k @START + B k @STOP @CLK_11 @REVERSE + C k @STOP @(REVERSE + CLK_11) A k+1 = IDLE@START + LEFT@STOP + RIGHT@STOP = A k @START + STOP@(B k + C k ) The outputs can also be determined. S0 = IDLE@START + LEFT = A k @START + B k S1 = IDLE@START + RIGHT = A k @START + C k LOAD_CNT = IDLE@START + LEFT@STOP @(REVERSE + CLK_11) + RIGHT@STOP @(REVERSE + CLK_11) = A k @START + B k @STOP @(REVERSE + CLK_11) + C k @STOP @(REVERSE + CLK_11) We have reached the point where we can implement using 3 D-type flip-flops and basic logic gates. Copyright 2003 by Andrew W. H. House Page 6 of 7

Class notes by Andrew W. H. House, 02 December 2003. Copyright 2003 by Andrew W. H. House Page 7 of 7