ENGG1015: lab 3. Sequential Logic

Similar documents
Java Bread Board Introductory Digital Electronics Exercise 2, Page 1

UNIVERSITY OF BOLTON SCHOOL OF ENGINEERING BENG (HONS) ELECTRICAL & ELECTRONICS ENGINEERING SEMESTER TWO EXAMINATION 2017/2018

1 Q' 3. You are given a sequential circuit that has the following circuit to compute the next state:

Computer Architecture: Part II. First Semester 2013 Department of Computer Science Faculty of Science Chiang Mai University

Project Board Game Counter: Digital

ENGIN 112 Intro to Electrical and Computer Engineering

PWM System. Microcomputer Architecture and Interfacing Colorado School of Mines Professor William Hoff

Chapter 5 Sequential Logic Circuits Part II Hiroaki Kobayashi 7/11/2011

EE 308-Digital Electronics Laboratory EXPERIMENT 8 FLIP FLOPS AND SEQUENTIAL CIRCUITS

UNIT II: Clocked Synchronous Sequential Circuits. CpE 411 Advanced Logic Circuits Design 1

DIGITAL ELECTRONICS. Methods & diagrams : 1 Graph plotting : - Tables & analysis : - Questions & discussion : 6 Performance : 3

Sequential Logic Design (Latch & FF)

Page 1. Last time we looked at: latches. flip-flop

ECE 2300 Digital Logic & Computer Organization

EECS 270: Lab 7. Real-World Interfacing with an Ultrasonic Sensor and a Servo

Chapter 5 Sequential Logic Circuits Part II Hiroaki Kobayashi 6/30/2008

PHYSICS 536 Experiment 14: Basic Logic Circuits

Module -18 Flip flops

I hope you have completed Part 2 of the Experiment and is ready for Part 3.

COMPUTER ORGANIZATION & ARCHITECTURE DIGITAL LOGIC CSCD211- DEPARTMENT OF COMPUTER SCIENCE, UNIVERSITY OF GHANA

Experiment 5: Basic Digital Logic Circuits

EECS 150 Homework 4 Solutions Fall 2008

COMPUTER ARCHITECTURE AND ORGANIZATION

CS/EE Homework 9 Solutions

First Name: Last Name: Lab Cover Page. Teaching Assistant to whom you are submitting

CHAPTER 16 SEQUENTIAL CIRCUIT DESIGN. Click the mouse to move to the next page. Use the ESC key to exit this chapter.

UNIVERSITY OF CALIFORNIA, DAVIS Department of Electrical and Computer Engineering. EEC 180A DIGITAL SYSTEMS I Winter 2015

Additional Programs for the Electronics Module Part No

UNIVERSITY OF CALIFORNIA College of Engineering Department of Electrical Engineering and Computer Sciences

Design and build a prototype digital motor controller with the following features:

Chapter 4: FLIP FLOPS. (Sequential Circuits) By: Siti Sabariah Hj. Salihin ELECTRICAL ENGINEERING DEPARTMENT EE 202 : DIGITAL ELECTRONICS 1

A-PDF Split DEMO : Purchase from to remove the watermark 114 FSM

EECS-140/141 Introduction to Digital Logic Design Lecture 7:Sequential Logic Basics

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

Finite State Machines CS 64: Computer Organization and Design Logic Lecture #16

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-378:

Data Logger by Carsten Kristiansen Napier University. November 2004

CMOS Digital Integrated Circuits Lec 11 Sequential CMOS Logic Circuits

Serial Addition. Lecture 29 1

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-2700:

Hardware Flags. and the RTI system. Microcomputer Architecture and Interfacing Colorado School of Mines Professor William Hoff

Module-20 Shift Registers

Quartus II Simulation with Verilog Designs

ENGR-4300 Fall 2008 Test 3. Name. Section 1(MR 8:00) 2(TF 2:00) (circle one) Question I (20 points) Question II (15 points) Question III (20 points)

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-2700:

Department of Electronics and Communication Engineering

ICS 151 Final. (Last Name) (First Name)

Brought to you by. Priti Srinivas Sajja. PS01CMCA02 Course Content. Tutorial Practice Material. Acknowldgement References. Website pritisajja.

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-2700:

Evolvable Hardware in Xilinx Spartan-3 FPGA

Solutions. ICS 151 Final. Q1 Q2 Q3 Q4 Total Credit Score. Instructions: Student ID. (Last Name) (First Name) Signature

CHAPTER III THE FPGA IMPLEMENTATION OF PULSE WIDTH MODULATION

EE 42/100 Lecture 24: Latches and Flip Flops. Rev A 4/14/2010 (8:30 PM) Prof. Ali M. Niknejad

Exercise 2: OR/NOR Logic Functions

Practical Workbook Logic Design & Switching Theory

Finite State Machines

Learning Outcomes. Spiral 2 3. DeMorgan Equivalents NEGATIVE (ACTIVE LO) LOGIC. Negative Logic One hot State Assignment System Design Examples

CSE 260 Digital Computers: Organization and Logical Design. Midterm Solutions

Adder Comparator 7 segment display Decoder for 7 segment display D flip flop Analysis of sequential circuits. Sequence detector

Exercise 1: AND/NAND Logic Functions

ECE 551: Digital System Design & Synthesis

COMBINATIONAL and SEQUENTIAL LOGIC CIRCUITS Hardware implementation and software design

Project 3 Build a 555-Timer

CHAPTER FIVE - Flip-Flops and Related Devices

Exercise 1: EXCLUSIVE OR/NOR Gate Functions

Electronic Instrumentation

Laboratory Manual CS (P) Digital Systems Lab

DIGITAL DESIGN WITH SM CHARTS

B.E. SEMESTER III (ELECTRICAL) SUBJECT CODE: X30902 Subject Name: Analog & Digital Electronics

INTEGRATED CIRCUITS. For a complete data sheet, please also download:

CSE208W Lecture #1 Notes Barry E. Mapen

Spec. Instructor: Center

Digital Circuits Laboratory LAB no. 12. REGISTERS

Chapter 3 Digital Logic Structures

Lecture 7: Components of Phase Locked Loop (PLL)

5. (Adapted from 3.25)

DESIGN OF MULTIPLYING DELAY LOCKED LOOP FOR DIFFERENT MULTIPLYING FACTORS

LOGIC DIAGRAM: HALF ADDER TRUTH TABLE: A B CARRY SUM. 2012/ODD/III/ECE/DE/LM Page No. 1

Hardware Implementation of BCH Error-Correcting Codes on a FPGA

DIGITAL CIRCUITS AND SYSTEMS ASSIGNMENTS 1 SOLUTIONS

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) SUMMER-16 EXAMINATION Model Answer

Computer Architecture (TT 2012)

Computer Architecture Laboratory

Fan in: The number of inputs of a logic gate can handle.

Quartus II Simulation with Verilog Designs

2014 Paper E2.1: Digital Electronics II

Chapter 9. sequential logic technologies

UNIVERSITI MALAYSIA PERLIS

EE 109 Midterm Review

Interfacing Clockaudio microphones with the Logic Box

logic system Outputs The addition of feedback means that the state of the circuit may change with time; it is sequential. logic system Outputs

Written exam IE1204/5 Digital Design Friday 13/

Simulation using Tutorial Verilog XL Release Date: 02/12/2005

ELECTROVATE. Electromania Problem Statement Discussion

Lab 6. Binary Counter

ANALOG TO DIGITAL CONVERTER

INTEGRATED CIRCUITS. For a complete data sheet, please also download:

The SOL-20 Computer s Cassette interface.

ENGR-2300 Electronic Instrumentation Quiz 3 Spring Name: Solution Please write you name on each page. Section: 1 or 2

CHAPTER 5 DESIGNS AND ANALYSIS OF SINGLE ELECTRON TECHNOLOGY BASED MEMORY UNITS

Transcription:

ENGG1015: lab 3 Sequential Logic 1 st Semester 2012-13 This lab explores the world of sequential logic design. By the end of this lab, you will have implemented a working prototype of a Ball ounter that you will use in the project. 1 Finding your lab partner You will be working with a randomly assigned partner for this lab. To find your assigned lab partner and the assigned table, 1. Log in to Moodle. 2. Select the assignment Lab 3 Partner Please proceed to your assigned table. 2 Getting the Files ownload the files for this lab from http://www.eee.hku.hk/~engg1015/fa12/labs/lab3.zip 3 Getting the Basic Right lock & Flip-Flop We will start with a simple circuit to experiment with the behavior of sequential circuit. 3.1 In Logisim, construct the following circuit: a b c d clk Figure 1: Simple sequential circuit You can find symbols of -flip-flop (FF) from the Memory library. The symbol of a -flip-flop in Logisim is shown in Figure 2. Note that the symbol is different from the one in lecture notes and from the Xilinx ISE tools. In Logisim, the input to the FF is labeled in the bottom left corner of the symbol. The output is located in top right corner of the symbol. Figure 2: -Flip-Flop in Logisim

You should connect the clock signal clk to the clock input located in top left corner of the symbol of all FFs. Instead of using a simple Pin as input, use a lock symbol instead. You can find the clock symbol under the Wiring library. 3.2 heck Yourself Test the behavior of the circuit using the Poke tool. You can toggle the value of a clock input similar to the way you toggle the value of a pin. If you toggle the value of an input to a FF when the value of clk is 0, does the value at the output change? What if the value of clk is 1? When does the output of a FF toggle? 3.3 Timing iagram omplete the following timing diagram of the above circuit given. a b c d clk 3.4 heckoff 1 Show to your TA the completed timing diagram of Figure 1. If the value of d is 1 in cycle n, what is the value of a in cycle n 3? What is the function of this circuit? 4 Ball ounting... Simple As 1, 2, 3 Here will build a logic circuit that counts the number of times a metal ball has passed through a detector. It stops counting when 3 balls have been detected, only after that will the circuit output a 1 on the done signal. The output should stay at 1 permanently until the state machine is reset. The digital logic control will be implemented in this lab, while the detection circuit will be built in next lab. 4.1 State Machine A simple way to implement the function of counting is to build a state machine that memorizes the number of balls it has detected so far. We will use a state machine with 4 states, namely Seen0, Seen1, Seen2, Seen3, which memorizes the fact that we have detected 0, 1, 2, and 3 balls respectively. At reset, the system should be in state Seen0. Page 2 of 5

The machine has 1 input signal, det, that is 1 if a ball is detected, 0 otherwise. It has 1 output signal, done, that is 1 only after 3 balls have been detected. In the following space, draw the state transition diagram of this ball counting machine. Make sure your state machine is a complete state machine all the necessary transition arcs must be included. 4.2 heck Yourself State Encoding We will encode the states using a simple binary scheme as follows: Encoding State s1 s0 Seen0 0 0 Seen1 0 1 Seen2 1 0 Seen3 1 1 How many states are there in our state machine? How many -flip-flops are needed to encode the states? 4.3 Next State Logic The next state logic is a combinational function that determines the state that a state machine should be at after the next clock tick. From a state transition diagram, the next state logic for a particular state can be obtained by enumerating the conditions of all the arcs entering that state. We denote the two bit next state signal as ns1 and ns0. omplete the following truth table of the next state logic of our state machine:

s1 s0 det ns1 ns0 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 4.4 Output Logic The output signal done should be 1 only after 3 balls have been detected. Write down the logic equation for done. done = 4.5 omplete State Machine You are now ready to implement the entire state machine. In Logisim, open the design cnt3.circ. Use the above results and the skills you have developed in the past few labs, implement the complete state machine by implementing the next state logic, the output logic, as well as the FFs that store the states. Some of the connections have already been implemented for you. In Logisim, you can use a Tunnel to connect signals in the circuit by its name instead of drawing long wires. To connect two signals in Logisim without drawing a wire between them, simply connect each of them to a tunnel. Then, label the tunnel with the same signal name in the setting pane. 4.6 heckoff 2 emonstrate your completed state machine to your TA and answer the following questions. Where are the states of the machine stored at? How will your circuit be different if a different encoding of the states were used? Which state does your machine start in? How is that accomplished in the real circuit? Is there any requirement in the state encoding to ensure this behavior? What if we want to count to 5 balls? How many states do we need? How many bits do we need if we use a binary encoding? Page 4 of 5

5 Getting to the board At the end of the semester, you need to incorporate the ball counting function to the project using the Basys2 board. Here, we will start the implementation work based on the previous results. 5.1 Open the file lab3.xise using Xilinx Project Navigator. ouble-click to open cnt3.sch from the esign pane. A display module is already placed in the design for your convenience. The current state (s1, s0) are connected to the display so you know which state you are at. Also, a ball detection module called detector has been added to your design. It takes the din input and output the det signal when a ball is detected. Use this det signal as an input to your state machine. 5.2 Implement the same design you had in Logisim above using the Xilinx ISE tools. To insert a -flip-flop, select the Flip Flop ategories and use the symbol fdc. (There are many similar variations of FF in that category, make sure you use fdc in this part of the lab.) For fdc, is input port, is output. lock input is labeled with a wedge in the pin. Finally, the pin clr is the clear signal. When clr is 1, it clears the content of the flip-flop to it s default value of 0 regardless of the value of the clock input. HINT : There are 3-input gates available in the Xilinx ISE tools, under the Logic category. NOT gates are listed as inv (Inverter). However, a better solution is to use the built-in symbols with inverted input. For example, the symbol and2b1 is a 2-input AN gate with 1 of the input inverted already. It saves time in constructing your circuit. Make sure you use the following naming convention for your signals to ensure correct connection in the.ucf file and to the rest of the design. name Signal din Input from the ball detection circuit. It is connected to button 3 in this lab. det Signal that indicates detection of a ball by processing din. done output signal that indicates 3 balls have been detected. onnected to led7 s1, s0 current state. ns1, ns0 next state. clr clear the states. onnected to button 0. clk clock input You do not need to create any I/O port in the design, they are all created for you already. To connect two points in the design, apart from drawing a physical wire, you can simply name the two nets with the same name. To give a name to a net, click the Add Net Name button, then on the Add Net Name Options pane, type the name in the Name field. Finally click on the net that you want to set the name. i.e., there is no need to use a tunnel as in Logisim to connect two nets in ISE. 5.3 heckoff 3 emonstrate to your TA a complete working ball counting machine on the Basys2 board. Email to your partners the design files. You may need them for your final project. Page 5 of 5