Lecture 6. Digital Design Laboratory. Copyright 2007, 2009, 2010, 2014 Thomas R. Collins, Kevin Johnson

Size: px
Start display at page:

Download "Lecture 6. Digital Design Laboratory. Copyright 2007, 2009, 2010, 2014 Thomas R. Collins, Kevin Johnson"

Transcription

1 Lecture 6 Digital Design Laboratory Copyright 2007, 2009, 2010, 2014 Thomas R. Collins, Kevin Johnson

2 Recent changes We updated the train simulator, lecture slides, and lab manual in Fall 2014 and again this semester Updated lecture slides and lab manual pages are available on the website Changes are fairly minor, but to avoid confusion, be sure to use the updated versions.

3 Train scenario Two electric trains Four switches (sw1-sw6) Six sensors (S1-S6)

4 Lab 6: General Textbook describes an older track setup! Lecture slides which follow apply to either old or new setup (new features aren t used) Lab Manual instructions are generic, allowing for different train patterns Download the specific assignment from the web site (Lab 6 download page)

5 Train enhancements in lab Track 4 extends all the way across the network, whereas the textbook has just a stub. A fourth switch (Sw4) makes the new connection to the right side of Track 4. An additional sensor (S6) monitors trains near switch Sw3. Track graphics more closely resemble the shape of the network. Switch graphics show the switch position. Train speeds have a larger range than the textbook version (1, 2, 4, 8, 16 instead of just 1, 2, 3, 4). A switch connecting outside track to inside track A switch connecting the outside track

6 Image from train simulation New sensor (S6) New track segment and switch (Sw4)

7 Train problem formulation You know Initial positions of two trains When something passes over sensors You control Direction of movement (or stoppage) for each train How tracks are connected Therefore, a state machine can always keep track of where each train is At least to the extent of knowing which sensors it is between

8 State machine interface This is what you build the controller Based on sensors S1-S6, it must control train directions and track switch positions

9 State machine I/O definitions Sensor (Sn) = 1 Train on sensor n = 0 Train not on sensor n Switch (Swn) = 0 Switch n connected to outside track ( straight ) = 1 Switch n connected to inside track ( angled ) Direction A (DA[1..0]) = 00 No power (stopped) for Train A = 01 Train A moves forward (counterclockwise) = 10 Train A moves backward (clockwise) Direction B (DB[1..0]) = same as for Direction A, but applies to Train B

10 Train direction Each of the two trains can move forward, reverse, or stop The trains are placed such that forward is counterclockwise and reverse is clockwise Forward directions are shown below

11 Train speed State machine does NOT control speed Only forward/reverse/off The speed of each train is controlled by slide switches You can change them to test your design TAs will change them to make sure your design is not speed-dependent SW17-SW14 for Train A SW3-SW0 for Train B

12 EXAMPLE problem (Not your problem) Train A moves CCW on Tracks 1 and 2 Train B moves CCW on Tracks 2 and 3 First one to reach Sensor 1 or Sensor 2 moves into Track 2 without either train stopping If the other train reaches Sensor 1 or Sensor 2 while the first train is still in Track 2, it waits until the shared track is clear before moving into it.

13 Working diagrams of train positions To solve the problem, start by drawing the UNIQUE states that can occur Use provided worksheets (printable from website) Worksheets are parts of required lab results, so don t throw them away

14 Inside/Outside terminology of textbook Textbook describes trains (in example problem) as either being In the shared track (Track 2) or Out of the shared track Terminology like this makes it easier to verbally describe states You are not confined to this terminology for your assignment Use words that make sense for your train path state Ain

15 Example problem state: ABout This is the reset position: Train A on Track 1 and Train B on Track 3. If Train A reaches Sensor 1, it moves into Track 2, and the state becomes Ain. Same logic for Train B, Sensor 2, and state Bin. A A B ABout S1 Ain S2 Bin S1+S2 Ain

16 Without two-sensor transitions An incorrect state can be reached if two-sensor cases are not handled and the state machine clock is not very fast relative to the train speed For example, state ABout will transition to Ain because S1 is active, but Train B might move past S2 before the next state machine clock Fixed by transitioning directly from ABout to Bstop when S1&S2= 11 ABout => Ain Ain => Ain

17 Example problem state: Ain Train A has moved into Track 2. Train B is still on Track 3, and has NOT reached S2. If Train B does reach Sensor 2, it must stop: state Bstop. If Train A reaches S4, then it is back on Track 1, which is state ABout again. B A Ain S2 Bstop S4 ABout S2+S4 Bin

18 Example problem solution Compare this to textbook drawing of 5 states (Figure 8.7)

19 State machine outputs States Outputs About Ain Astop Bin Bstop Sw Sw Sw Sw DA[1..0] DB[1..0] Create from working diagrams Although don t care values are included here, you can specify values for all cases if desired

20 tcontrol: UML statechart Reminder: Out means outside of the common track, not in the outer loop In means using the common track

21 VHDL implementation notes Variable names change S1-6 Sensor1-6 Sw1-4 Switch1-4 DA DirA DB DirB Your state machine works in parallel with a much more complex state machine (TrainSetSimulator)

22 tcontrol.vhd ENTITY LIBRARY IEEE; USE IEEE.STD_LOGIC_1164.ALL; USE IEEE.STD_LOGIC_ARITH.ALL; USE IEEE.STD_LOGIC_UNSIGNED.ALL; Do not change ENTITY statement given to you in download! ENTITY Tcontrol IS PORT(reset, clock, sensor1, sensor2 : IN std_logic; sensor3, sensor4, sensor5, sensor6 : IN std_logic; switch1, switch2, switch3, switch4 : OUT std_logic; dira, dirb : OUT std_logic_vector(1 DOWNTO 0) ); END Tcontrol;

23 tcontrol.vhd ARCHITECTURE ARCHITECTURE a OF Tcontrol IS TYPE STATE_TYPE IS (ABout,Ain,Bin,Astop,Bstop); SIGNAL state : STATE_TYPE; SIGNAL sensor12, sensor13, sensor24 : std_logic_vector(1 DOWNTO 0); BEGIN PROCESS (clock, reset) BEGIN IF reset = '1' THEN -- Reset to this state state <= ABout; ELSIF clock'event AND clock = '1' THEN Concatenation of sensor bits compare with state diagram to see why this is done

24 tcontrol.vhd CASE for states CASE state IS WHEN ABout => CASE Sensor12 IS WHEN "00" => state <= About; WHEN "01" => state <= Bin; WHEN "10" => state <= Ain; WHEN "11" => state <= Bstop; WHEN OTHERS => state <= ABout; END CASE;

25 State Ain WHEN Ain => CASE Sensor24 IS WHEN "00" => WHEN "01" => WHEN "10" => WHEN "11" => WHEN OTHERS => END CASE; state <= Ain; state <= ABout; state <= Bstop; state <= Bin; state <= ABout;

26 State Bin WHEN Bin => CASE Sensor13 IS WHEN "00" => WHEN "01" => WHEN "10" => WHEN "11" => WHEN OTHERS => END CASE; state <= Bin; state <= ABout; state <= Astop; state <= Ain; state <= ABout;

27 States Astop and Bstop, and ENDs WHEN Astop => IF Sensor3 = '1' THEN state <= Ain; ELSE state <= Astop; END IF; WHEN Bstop => IF Sensor4 = '1' THEN state <= Bin; ELSE state <= Bstop; END IF; END CASE; END IF; END PROCESS;

28 Internal signals and constant outputs sensor12 <= sensor1 & sensor2; sensor13 <= sensor1 & sensor3; sensor24 <= sensor2 & sensor4; Concatenation, not AND Switch3 <= '0'; Switch4 <= '0'; Outputs that are not state-dependent

29 Switch outputs as Moore outputs WITH state SELECT Switch1 <='0' WHEN ABout, '0' WHEN Ain, '1' WHEN Bin, '1' WHEN Astop, '0' WHEN Bstop; WITH state SELECT Switch2 <='0' WHEN ABout, '0' WHEN Ain, '1' WHEN Bin, '1' WHEN Astop, '0' WHEN Bstop;

30 Dir outputs and END of ARCHITECTURE WITH state SELECT DirA <= "01" WHEN ABout, "01" WHEN Ain, "01" WHEN Bin, "00" WHEN Astop, "01" WHEN Bstop; WITH state SELECT DirB <= "01" WHEN ABout, "01" WHEN Ain, "01" WHEN Bin, "01" WHEN Astop, "00" WHEN Bstop; END a;

31 OPTIONAL alternate format WITH state SELECT DirA <= "00" WHEN Astop, "01" WHEN OTHERS; WITH state SELECT DirB <= "00" WHEN Bstop, "01" WHEN OTHERS; Only makes sense when there are values that only occur in a limited number of cases

32 Quartus Project: TrainTop.bdf tcontrol Switches TrainSetSimulator Sensors DirA Clock DirB Reset Other inputs Other outputs TrainSetSimulator is a black box it takes care of simulating and displaying the trains and tracks without you needing to learn all the details.

33 Prelab Follow all instructions in manual: Read Chapter 8 of textbook Download assignment Build UML statechart No need to get train files (VHDL, etc.) yet But if you do, use the ones on web site, not the textbook s CD Work alone and produce your own worksheets and UML statechart for a prelab checkoff

Concurrent & Sequential Stmts. (Review)

Concurrent & Sequential Stmts. (Review) VHDL Introduction, Part II Figures in this lecture are from: Rapid Prototyping of Digital Systems, Second Edition James O. Hamblen & Michael D. Furman, Kluwer Academic Publishers, 2001, ISBN 0-7923-7439-

More information

[VARIABLE declaration] BEGIN. sequential statements

[VARIABLE declaration] BEGIN. sequential statements PROCESS statement (contains sequential statements) Simple signal assignment statement

More information

DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 6

DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 6 DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 6 FINITE STATE MACHINES (FSMs) Moore Machines Mealy Machines FINITE STATE MACHINES (FSMs) Classification: Moore Machine: Outputs depend only on the current state

More information

Sequential Logic - Module 5

Sequential Logic - Module 5 Sequential Logic Module 5 Jim Duckworth, WPI 1 Latches and Flip-Flops Implemented by using signals in IF statements that are not completely specified Necessary latches or registers are inferred by the

More information

ECOM 4311 Digital Systems Design

ECOM 4311 Digital Systems Design ECOM 4311 Digital Systems Design Eng. Monther Abusultan Computer Engineering Dept. Islamic University of Gaza Page 1 Agenda 1. Counters Page 2 Counters - special name of any clocked sequential circuit

More information

Schedule. ECE U530 Digital Hardware Synthesis. Rest of Semester. Midterm Question 1a

Schedule. ECE U530 Digital Hardware Synthesis. Rest of Semester. Midterm Question 1a ECE U530 Digital Hardware Synthesis Prof. Miriam Leeser mel@coe.neu.edu November 8, 2006 Midterm Average: 70 Lecture 16: Midterm Solutions Homework 6: Calculator Handshaking HW 6: Due Wednesday, November

More information

Lab 3. Advanced VHDL

Lab 3. Advanced VHDL Lab 3 Advanced VHDL Lab 3 Advanced VHDL This lab will demonstrate many advanced VHDL techniques and how they can be used to your advantage to create efficient VHDL code. Topics include operator balancing,

More information

CSE 260 Introduction to Digital Logic and Computer Design. Exam 1. Your name 2/13/2014

CSE 260 Introduction to Digital Logic and Computer Design. Exam 1. Your name 2/13/2014 CSE 260 Introduction to Digital Logic and Computer Design Jonathan Turner Exam 1 Your name 2/13/2014 1. (10 points) Draw a logic diagram that implements the expression A(B+C)(C +D)(B+D ) directly (do not

More information

EEL 4712 Digital Design Test 1 Spring Semester 2008

EEL 4712 Digital Design Test 1 Spring Semester 2008 IMPORTANT: Please be neat and write (or draw) carefully. If we cannot read it with a reasonable effort, it is assumed wrong. Also, as always, the best answer gets the most points. COVER SHEET: Problem:

More information

The University of Alabama in Huntsville ECE Department CPE Midterm Exam Solution Spring 2016

The University of Alabama in Huntsville ECE Department CPE Midterm Exam Solution Spring 2016 The University of Alabama in Huntsville ECE Department CPE 526 01 Midterm Exam Solution Spring 2016 1. (15 points) Write a VHDL function that accepts a std_logic_vector of arbitrary length and an integer

More information

The University of Alabama in Huntsville Electrical and Computer Engineering CPE/EE 422/522 Spring 2005 Homework #6 Solution

The University of Alabama in Huntsville Electrical and Computer Engineering CPE/EE 422/522 Spring 2005 Homework #6 Solution 5.3(a)(2), 5.6(c)(2), 5.2(2), 8.2(2), 8.8(2) The University of Alabama in Huntsville Electrical and Computer Engineering CPE/EE 422/522 Spring 25 Homework #6 Solution 5.3 (a) For the following SM chart:

More information

Example 58: Traffic Lights

Example 58: Traffic Lights 208 Chapter 8 Listing 8.7(cont.) doorlock2_top.vhd btn012

More information

Lab 3: Standard Combinational Components

Lab 3: Standard Combinational Components Lab 3: Standard Combinational Components Purpose In this lab you will implement several combinational circuits on the DE1 development board to test and verify their operations. Introduction Using a high-level

More information

EECE 353: Digital Systems Design Lecture 10: Datapath Circuits

EECE 353: Digital Systems Design Lecture 10: Datapath Circuits EECE 353: Digital Systems Design Lecture 10: Datapath Circuits Cristian Grecu grecuc@ece.ubc.ca Course web site: http://courses.ece.ubc.ca/353 Introduction to lecture 10 Large digital systems are more

More information

Constructing VHDL Models with CSA

Constructing VHDL Models with CSA Constructing VHDL Models with CSA List all components (e.g., gate) inclusive propagation delays. Identify input/output signals as input/output ports. All remaining signals are internal signals. Identify

More information

DIGITAL LOGIC DESIGN VHDL Coding for FPGAs Unit 6

DIGITAL LOGIC DESIGN VHDL Coding for FPGAs Unit 6 DIGITAL LOGIC DESIGN VHDL Coding for FPGAs Unit 6 FINITE STATE MACHINES (FSMs) Moore Machines Mealy Machines Algorithmic State Machine (ASM) charts FINITE STATE MACHINES (FSMs) Classification: Moore Machine:

More information

VHDL Testbench. Test Bench Syntax. VHDL Testbench Tutorial 1. Contents

VHDL Testbench. Test Bench Syntax. VHDL Testbench Tutorial 1. Contents VHDL Testbench Tutorial 1 Contents 1 VHDL Testbench 2 Test Bench Syntax 3 Testbench Example: VHDL Code for Up Down Binary Counter 4 VHDL Testbench code for up down binary counter 5 Testbench Waveform for

More information

Introduction to VHDL #3

Introduction to VHDL #3 ECE 322 Digital Design with VHDL Introduction to VHDL #3 Lecture 7 & 8 VHDL Modeling Styles VHDL Modeling Styles Dataflow Concurrent statements Structural Components and interconnects Behavioral (sequential)

More information

Hardware Description Language VHDL (1) Introduction

Hardware Description Language VHDL (1) Introduction Hardware Description Language VHDL (1) Introduction Digital Radiation Measurement and Spectroscopy NE/RHP 537 Introduction Hardware description language (HDL) Intended to describe circuits textually, for

More information

Design a 4 bit-adder. Then design a 4-7 decoder to show the outputs. Output Sum(4 bits) Adder. Output carry(1 bit)

Design a 4 bit-adder. Then design a 4-7 decoder to show the outputs. Output Sum(4 bits) Adder. Output carry(1 bit) Csc 343 Lab 2 Sep 28. 07 Objective: Design a 4 bit-adder. Then design a 4-7 decoder to show the outputs. Structure: Input A (4 bits) Input B (4 bit) Adder Output Sum(4 bits) Output carry(1 bit) input cin

More information

ELE306 FALL2003 LAB3

ELE306 FALL2003 LAB3 ELE306 FALL2003 LAB3 VGA and PS/2 --- reusing existing VHDL modules In this lab, the use of existing VHDL modules will be used to create designs. These modules will help interface the PS/2 keyboard and

More information

Design Problem 4 Solutions

Design Problem 4 Solutions CSE 260 Digital Computers: Organization and Logical Design Design Problem 4 Solutions Jon Turner The block diagram appears below. The controller includes a state machine with three states (normal, movecursor,

More information

CprE 583 Reconfigurable Computing

CprE 583 Reconfigurable Computing Recap 4:1 Multiplexer CprE / ComS 583 Reconfigurable Computing Prof. Joseph Zambreno Department of Electrical and Computer Engineering Iowa State University Lecture #18 VHDL for Synthesis I LIBRARY ieee

More information

EEE8076. Reconfigurable Hardware Design (coursework) Module Outline. Dr A. Bystrov Dr. E.G. Chester. Autumn

EEE8076. Reconfigurable Hardware Design (coursework) Module Outline. Dr A. Bystrov Dr. E.G. Chester. Autumn EEE8076 Reconfigurable Hardware Design (coursework) Module Outline Dr A. Bystrov Dr. E.G. Chester Autumn 2010 1 2 3 4 5 6 7 8 9 10 11 12 Altera UP2 development board, Flex EPF10K70 FPGA www.altera.com/literature/univ/upds.pdf

More information

Chapter 8 VHDL Code Examples

Chapter 8 VHDL Code Examples APPENDIX I Chapter 8 VHDL Code Examples I.1 Introduction Two example VHDL code designs are presented in Chapter 8, the first for controlling the AD7524 digital-to-analogue converter and the second for

More information

Abi Farsoni, Department of Nuclear Engineering and Radiation Health Physics, Oregon State University

Abi Farsoni, Department of Nuclear Engineering and Radiation Health Physics, Oregon State University Hardware description language (HDL) Intended to describe circuits textually, for a computer to read Evolved starting in the 1970s and 1980s Popular languages today include: VHDL Defined in 1980s by U.S.

More information

Design Problem 3 Solutions

Design Problem 3 Solutions CSE 260 Digital Computers: Organization and Logical Design Jon Turner Design Problem 3 Solutions In this problem, you are to design, simulate and implement a sequential pattern spotter, using VHDL. This

More information

Sign here to give permission for your test to be returned in class, where others might see your score:

Sign here to give permission for your test to be returned in class, where others might see your score: EEL 4712 Midterm 2 Spring 216 VERSION 1 Name: UFID: Sign here to give permission for your test to be returned in class, where others might see your score: IMPORTANT: Please be neat and write (or draw)

More information

Midterm Exam Thursday, October 24, :00--2:15PM (75 minutes)

Midterm Exam Thursday, October 24, :00--2:15PM (75 minutes) Last (family) name: Answer Key First (given) name: Student I.D. #: Department of Electrical and Computer Engineering University of Wisconsin - Madison ECE 551 Digital System Design and Synthesis Midterm

More information

Reconfigurable Hardware Design (coursework)

Reconfigurable Hardware Design (coursework) EEE8076 Reconfigurable Hardware Design (coursework) Dr A. Bystrov Dr. E.G. Chester Autumn 2010 Module Outline Teaching Staff Dr Alex Bystrov Dr Graeme Chester The contact details are in the EECE web page

More information

The University of Alabama in Huntsville ECE Department CPE Midterm Exam Solution March 2, 2006

The University of Alabama in Huntsville ECE Department CPE Midterm Exam Solution March 2, 2006 The University of Alabama in Huntsville ECE Department CPE 526 01 Midterm Exam Solution March 2, 2006 1. (15 points) A barrel shifter is a shift register in which the data can be shifted either by one

More information

Grading Summary for ECE 2031 Lab Reports

Grading Summary for ECE 2031 Lab Reports Grading Summary for ECE 2031 Lab Reports Summary of Lab Reports Lab reports for ECE 2031 are collections of images, tables, and code that were produced during the design, implementation, and test of digital

More information

VHDL in 1h. Martin Schöberl

VHDL in 1h. Martin Schöberl VHDL in 1h Martin Schöberl VHDL /= C, Java, Think in hardware All constructs run concurrent Different from software programming Forget the simulation explanation VHDL is complex We use only a small subset

More information

Summary of FPGA & VHDL

Summary of FPGA & VHDL FYS4220/9220 Summary of FPGA & VHDL Lecture #6 Jan Kenneth Bekkeng, University of Oslo - Department of Physics 16.11.2011 Curriculum (VHDL & FPGA part) Curriculum (Syllabus) defined by: Lectures Lecture6:

More information

Design Problem 5 Solutions

Design Problem 5 Solutions CS/EE 260 Digital Computers: Organization and Logical Design Design Problem 5 Solutions Jon Turner Due 5/4/04 1. (100 points) In this problem, you will implement a simple shared memory multiprocessor system

More information

Quartus Counter Example. Last updated 9/6/18

Quartus Counter Example. Last updated 9/6/18 Quartus Counter Example Last updated 9/6/18 Create a logic design from start to a DE10 implementation This example uses best design practices This example is not about creating HDL The HDL code will be

More information

Grading Summary for ECE 2031 Lab Reports

Grading Summary for ECE 2031 Lab Reports Grading Summary for ECE 2031 Lab Reports Summary of Lab Reports Lab reports for ECE 2031 are collections of images, tables, and code that were produced during the design, implementation, and test of digital

More information

CSE 260 Digital Computers: Organization and Logical Design. Exam 2. Jon Turner 3/28/2012

CSE 260 Digital Computers: Organization and Logical Design. Exam 2. Jon Turner 3/28/2012 CSE 260 Digital Computers: Organization and Logical Design Exam 2 Jon Turner 3/28/2012 1. (15 points). Draw a diagram for a circuit that implements the VHDL module shown below. Your diagram may include

More information

ECE 545 Lecture 12. Datapath vs. Controller. Structure of a Typical Digital System Data Inputs. Required reading. Design of Controllers

ECE 545 Lecture 12. Datapath vs. Controller. Structure of a Typical Digital System Data Inputs. Required reading. Design of Controllers ECE 545 Lecture 12 Design of Controllers Finite State Machines and Algorithmic State Machine (ASM) Charts Required reading P. Chu, using VHDL Chapter 1, Finite State Machine: Principle & Practice Chapter

More information

Digital Systems Design

Digital Systems Design Digital Systems Design Review of Combinatorial Circuit Building Blocks: VHDL for Combinational Circuits Dr. D. J. Jackson Lecture 2-1 Introduction to VHDL Designer writes a logic circuit description in

More information

Esempio FSM Description : library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_arith.all; use IEEE.std_logic_unsigned.all; entity esempiofsm is port ( clk: in STD_LOGIC; p: in STD_LOGIC; reset:

More information

Problem Set 5 Solutions

Problem Set 5 Solutions Problem Set 5 Solutions library ieee; use ieee.std_logic_1164.all; use work.std_arith.all; -- here is the declaration of entity entity la_rewarder is port (clk, go, SRAM_busy, SRAM_rdy: in std_logic; min:

More information

CS/EE Homework 7 Solutions

CS/EE Homework 7 Solutions CS/EE 260 - Homework 7 Solutions 4/2/2001 1. (20 points) A 4 bit twisted ring counter is a sequential circuit which produces the following sequence of output values: 0000, 1000, 1100, 1110, 1111, 0111,

More information

FSM Components. FSM Description. HDL Coding Methods. Chapter 7: HDL Coding Techniques

FSM Components. FSM Description. HDL Coding Methods. Chapter 7: HDL Coding Techniques FSM Components XST features: Specific inference capabilities for synchronous Finite State Machine (FSM) components. Built-in FSM encoding strategies to accommodate your optimization goals. You may also

More information

Hardware Description Languages. Modeling Complex Systems

Hardware Description Languages. Modeling Complex Systems Hardware Description Languages Modeling Complex Systems 1 Outline (Raising the Abstraction Level) The Process Statement if-then, if-then-else, if-then-elsif, case, while, for Sensitivity list Signals vs.

More information

Assignment. Last time. Last time. ECE 4514 Digital Design II. Back to the big picture. Back to the big picture

Assignment. Last time. Last time. ECE 4514 Digital Design II. Back to the big picture. Back to the big picture Assignment Last time Project 4: Using synthesis tools Synplify Pro and Webpack Due 11/11 ning of class Generics Used to parameterize models E.g., Delay, bit width Configurations Configuration specification

More information

Outline. CPE/EE 422/522 Advanced Logic Design L05. Review: General Model of Moore Sequential Machine. Review: Mealy Sequential Networks.

Outline. CPE/EE 422/522 Advanced Logic Design L05. Review: General Model of Moore Sequential Machine. Review: Mealy Sequential Networks. Outline CPE/EE 422/522 Advanced Logic Design L05 Electrical and Computer Engineering University of Alabama in Huntsville What we know Combinational Networks Sequential Networks: Basic Building Blocks,

More information

Timing in synchronous systems

Timing in synchronous systems BO 1 esign of sequential logic Outline Timing in synchronous networks Synchronous processes in VHL VHL-code that introduces latches andf flip-flops Initialization of registers Mealy- and Moore machines

More information

ECE 545 Lecture 6. Behavioral Modeling of Sequential-Circuit Building Blocks. George Mason University

ECE 545 Lecture 6. Behavioral Modeling of Sequential-Circuit Building Blocks. George Mason University ECE 545 Lecture 6 Behavioral Modeling of Sequential-Circuit Building Blocks George Mason University Required reading P. Chu, RTL Hardware Design using VHDL Chapter 5.1, VHDL Process Chapter 8, Sequential

More information

The University of Alabama in Huntsville ECE Department CPE Final Exam Solution Spring 2004

The University of Alabama in Huntsville ECE Department CPE Final Exam Solution Spring 2004 The University of Alabama in Huntsville ECE Department CPE 526 01 Final Exam Solution Spring 2004 1. (15 points) An old Thunderbird car has three left and three right tail lights, which flash in unique

More information

CCE 3202 Advanced Digital System Design

CCE 3202 Advanced Digital System Design CCE 3202 Advanced Digital System Design Lab Exercise #2 This lab exercise will show you how to create, synthesize, and test a 3-bit ripple counter. A ripple counter is simply a circuit that outputs the

More information

Modeling Complex Behavior

Modeling Complex Behavior Modeling Complex Behavior Sudhakar Yalamanchili, Georgia Institute of Technology, 2006 (1) Outline Abstraction and the Process Statement Concurrent processes and CSAs Process event behavior and signals

More information

Inferring Storage Elements

Inferring Storage Elements Inferring Storage Elements In our designs, we usually use flip-flops as our storage elements. Sometimes we use latches, but not often. Latches are smaller in size, but create special, often difficult situations

More information

Objective Design a 4*4 register file and test it on VSIM, QUARTUS, and UP3 board.

Objective Design a 4*4 register file and test it on VSIM, QUARTUS, and UP3 board. Csc343 LAB Register File Objective Design a 4*4 register file and test it on VSIM, QUARTUS, and UP3 board. What is a register file A register file is the central storage of a microprocessor. Most operations

More information

In our case Dr. Johnson is setting the best practices

In our case Dr. Johnson is setting the best practices VHDL Best Practices Best Practices??? Best practices are often defined by company, toolset or device In our case Dr. Johnson is setting the best practices These rules are for Class/Lab purposes. Industry

More information

ECEU530. Schedule. ECE U530 Digital Hardware Synthesis. Datapath for the Calculator (HW 5) HW 5 Datapath Entity

ECEU530. Schedule. ECE U530 Digital Hardware Synthesis. Datapath for the Calculator (HW 5) HW 5 Datapath Entity ECE U530 Digital Hardware Synthesis Prof. Miriam Leeser mel@coe.neu.edu November 6, 2006 Classes November 6 and 8 are in 429 Dana! Lecture 15: Homework 5: Datapath How to write a testbench for synchronous

More information

6.111 Lecture # 8. Topics for Today: (as time permits)

6.111 Lecture # 8. Topics for Today: (as time permits) 6.111 Lecture # 8 Topics for Today: (as time permits) 1. Memories 2. Assembling 'packages' for designs 3. Discussion of design procedure 4. Development of a design example using a finite state machine

More information

3e library declarations library IEEE; use IEEE.std_logic_1164.all;

3e library declarations library IEEE; use IEEE.std_logic_1164.all; 3e8.54 XSvhd.4Please see the VHDL program below or in the accompanying.zip file (if published by your instructor). This program was kindly written and contributed by Xilinx application engineering, but

More information

Very High Speed Integrated Circuit Har dware Description Language

Very High Speed Integrated Circuit Har dware Description Language Very High Speed Integrated Circuit Har dware Description Language Industry standard language to describe hardware Originated from work in 70 s & 80 s by the U.S. Departm ent of Defence Root : ADA Language

More information

Sequential Statement

Sequential Statement Sequential Statement Sequential Logic Output depends not only on current input values but also on previous input values. Are building blocks of; Counters Shift registers Memories Flip flops are basic sequential

More information

Problem Set 10 Solutions

Problem Set 10 Solutions CSE 260 Digital Computers: Organization and Logical Design Problem Set 10 Solutions Jon Turner thru 6.20 1. The diagram below shows a memory array containing 32 words of 2 bits each. Label each memory

More information

TSIU03, SYSTEM DESIGN LECTURE 2

TSIU03, SYSTEM DESIGN LECTURE 2 LINKÖPING UNIVERSITY Department of Electrical Engineering TSIU03, SYSTEM DESIGN LECTURE 2 Mario Garrido Gálvez mario.garrido.galvez@liu.se Linköping, 2018 1 From 1bit to several bits. TODAY - Review of

More information

Mid-Term Exam Solutions

Mid-Term Exam Solutions CS/EE 26 Digital Computers: Organization and Logical Design Mid-Term Eam Solutions Jon Turner 3/3/3. (6 points) List all the minterms for the epression (B + A)C + AC + BC. Epanding the epression gives

More information

Control and Datapath 8

Control and Datapath 8 Control and Datapath 8 Engineering attempts to develop design methods that break a problem up into separate steps to simplify the design and increase the likelihood of a correct solution. Digital system

More information

CS303 LOGIC DESIGN FINAL EXAM

CS303 LOGIC DESIGN FINAL EXAM JANUARY 2017. CS303 LOGIC DESIGN FINAL EXAM STUDENT NAME & ID: DATE: Instructions: Examination time: 100 min. Write your name and student number in the space provided above. This examination is closed

More information

Digital Systems Design

Digital Systems Design Digital Systems Design Memory Implementation on Altera CYCLONE V Devices Electrical & Computer Engineering Dr. D. J. Jackson Lecture 6-1 Embedded Memory 10 Kb M10K blocks blocks of dedicated memory resources

More information

Hello, World: A Simple Application for the Field Programmable Port Extender (FPX)

Hello, World: A Simple Application for the Field Programmable Port Extender (FPX) Hello, World: A Simple Application for the Field Programmable Port Extender (FPX) John Lockwood, David Lim WUCS-TM-00-12 July 11, 2000 Department of Computer Science Applied Research Lab Washington University

More information

ECE 448 Lecture 4. Sequential-Circuit Building Blocks. Mixing Description Styles

ECE 448 Lecture 4. Sequential-Circuit Building Blocks. Mixing Description Styles ECE 448 Lecture 4 Sequential-Circuit Building Blocks Mixing Description Styles George Mason University Reading Required P. Chu, FPGA Prototyping by VHDL Examples Chapter 4, Regular Sequential Circuit Recommended

More information

EEL 4712 Digital Design Test 2 Spring Semester 2008

EEL 4712 Digital Design Test 2 Spring Semester 2008 IMPORTANT: Please be neat and write (or draw) carefully. If we cannot read it with a reasonable effort, it is assumed wrong. As always, the best answer gets the most points. COVER SHEET: Problem: Points:

More information

Altera s Avalon Communication Fabric

Altera s Avalon Communication Fabric Altera s Avalon Communication Fabric p. 1/1 Altera s Avalon Communication Fabric Prof. Stephen A. Edwards sedwards@cs.columbia.edu Columbia University Spring 2007 Altera s Avalon Communication Fabric p.

More information

The block diagram representation is given below: The output equation of a 2x1 multiplexer is given below:

The block diagram representation is given below: The output equation of a 2x1 multiplexer is given below: Experiment-3: Write VHDL programs for the following circuits, check the wave forms and the hardware generated a. multiplexer b. De-Multiplexer Objective: i. To learn the VHDL coding for Multiplexer and

More information

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

IT T35 Digital system desigm y - ii /s - iii UNIT - V Introduction to Verilog Hardware Description Language Introduction HDL for combinational circuits Sequential circuits Registers and counters HDL description for binary multiplier. 5.1 INTRODUCTION

More information

8-1. Fig. 8-1 ASM Chart Elements 2001 Prentice Hall, Inc. M. Morris Mano & Charles R. Kime LOGIC AND COMPUTER DESIGN FUNDAMENTALS, 2e, Updated.

8-1. Fig. 8-1 ASM Chart Elements 2001 Prentice Hall, Inc. M. Morris Mano & Charles R. Kime LOGIC AND COMPUTER DESIGN FUNDAMENTALS, 2e, Updated. 8-1 Name Binary code IDLE 000 Register operation or output R 0 RUN 0 1 Condition (a) State box (b) Example of state box (c) Decision box IDLE R 0 From decision box 0 1 START Register operation or output

More information

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

Control Unit: Binary Multiplier. Arturo Díaz-Pérez Departamento de Computación Laboratorio de Tecnologías de Información CINVESTAV-IPN Control Unit: Binary Multiplier Arturo Díaz-Pérez Departamento de Computación Laboratorio de Tecnologías de Información CINVESTAV-IPN Example: Binary Multiplier Two versions Hardwired control Microprogrammed

More information

Lab 1: Verilog Synthesis and FSMs

Lab 1: Verilog Synthesis and FSMs Lab 1: Verilog Synthesis and FSMs Contents 0 Introduction... 1 1 Prelab... 1 2 Design Details... 2 Overview... 2 ButtonParse... 3 RotaryEncoder... 3 Lab2Counter... 4 Lab2Lock... 4 3 Analysis... 6 0 Introduction

More information

COVER SHEET: Total: Regrade Info: 5 (5 points) 2 (8 points) 6 (10 points) 7b (13 points) 7c (13 points) 7d (13 points)

COVER SHEET: Total: Regrade Info: 5 (5 points) 2 (8 points) 6 (10 points) 7b (13 points) 7c (13 points) 7d (13 points) EEL 4712 Midterm 2 Spring 2011 VERSION 1 Name: UFID: Sign your name here if you would like for your test to be returned in class: IMPORTANT: Please be neat and write (or draw) carefully. If we cannot read

More information

Lecture 7. Standard ICs FPGA (Field Programmable Gate Array) VHDL (Very-high-speed integrated circuits. Hardware Description Language)

Lecture 7. Standard ICs FPGA (Field Programmable Gate Array) VHDL (Very-high-speed integrated circuits. Hardware Description Language) Standard ICs FPGA (Field Programmable Gate Array) VHDL (Very-high-speed integrated circuits Hardware Description Language) 1 Standard ICs PLD: Programmable Logic Device CPLD: Complex PLD FPGA: Field Programmable

More information

Pollard s Tutorial on Clocked Stuff in VHDL

Pollard s Tutorial on Clocked Stuff in VHDL Pollard s Tutorial on Clocked Stuff in VHDL Welcome to a biased view of how to do register type of stuff in VHDL. The object of this short note is to identify one way to easily handle registered logic

More information

Experiment 8 Introduction to VHDL

Experiment 8 Introduction to VHDL Experiment 8 Introduction to VHDL Objectives: Upon completion of this laboratory exercise, you should be able to: Enter a simple combinational logic circuit in VHDL using the Quartus II Text Editor. Assign

More information

Review. LIBRARY list of library names; USE library.package.object; ENTITY entity_name IS generic declarations PORT ( signal_name(s): mode signal_type;

Review. LIBRARY list of library names; USE library.package.object; ENTITY entity_name IS generic declarations PORT ( signal_name(s): mode signal_type; LIBRARY list of library names; USE library.package.object; Review ENTITY entity_name IS generic declarations PORT ( signal_name(s): mode signal_type; signal_name(s) : mode signal_type); END ENTITY entity_name;

More information

Multiplication Simple Gradeschool Algorithm for 16 Bits (32 Bit Result)

Multiplication Simple Gradeschool Algorithm for 16 Bits (32 Bit Result) Multiplication Simple Gradeschool Algorithm for 16 Bits (32 Bit Result) Input Input Multiplier Multiplicand AND gates 16 Bit Adder 32 Bit Product Register Multiplication Simple Gradeschool Algorithm for

More information

CCE 3202 Advanced Digital System Design

CCE 3202 Advanced Digital System Design CCE 3202 Advanced Digital System Design Lab Exercise #2 Introduction You will use Xilinx Webpack v9.1 to allow the synthesis and creation of VHDLbased designs. This lab will outline the steps necessary

More information

VHDL Examples Mohamed Zaky

VHDL Examples Mohamed Zaky VHDL Examples By Mohamed Zaky (mz_rasmy@yahoo.co.uk) 1 Half Adder The Half Adder simply adds 2 input bits, to produce a sum & carry output. Here we want to add A + B to produce Sum (S) and carry (C). A

More information

ELCT 501: Digital System Design

ELCT 501: Digital System Design ELCT 501: Digital System Lecture 4: CAD tools (Continued) Dr. Mohamed Abd El Ghany, Basic VHDL Concept Via an Example Problem: write VHDL code for 1-bit adder 4-bit adder 2 1-bit adder Inputs: A (1 bit)

More information

Contents. Chapter 9 Datapaths Page 1 of 28

Contents. Chapter 9 Datapaths Page 1 of 28 Chapter 9 Datapaths Page of 2 Contents Contents... 9 Datapaths... 2 9. General Datapath... 3 9.2 Using a General Datapath... 5 9.3 Timing Issues... 7 9.4 A More Complex General Datapath... 9 9.5 VHDL for

More information

VHDL: Modeling RAM and Register Files. Textbook Chapters: 6.6.1, 8.7, 8.8, 9.5.2, 11.2

VHDL: Modeling RAM and Register Files. Textbook Chapters: 6.6.1, 8.7, 8.8, 9.5.2, 11.2 VHDL: Modeling RAM and Register Files Textbook Chapters: 6.6.1, 8.7, 8.8, 9.5.2, 11.2 Memory Synthesis Approaches: Random logic using flip-flops or latches Register files in datapaths RAM standard components

More information

Getting Started with VHDL

Getting Started with VHDL Getting Started with VHDL VHDL code is composed of a number of entities Entities describe the interface of the component Entities can be primitive objects or complex objects Architectures are associated

More information

FPGA.

FPGA. CMOS TTL Verilog VHDL mshora@yahoo.com 7400. NAND CMOS TTL 1 0 source sink datasheet bounce bounce debunce RS Latch debounce Typical Characteristics NO NC Semiconductor Material Wavelength Colour V F @

More information

EITF35 - Introduction to the Structured VLSI Design (Fall 2016) Interfacing Keyboard with FPGA Board. (FPGA Interfacing) Teacher: Dr.

EITF35 - Introduction to the Structured VLSI Design (Fall 2016) Interfacing Keyboard with FPGA Board. (FPGA Interfacing) Teacher: Dr. EITF35 - Introduction to the Structured VLSI Design (Fall 2016) Interfacing Keyboard with FPGA Board (FPGA Interfacing) Teacher: Dr. Liang Liu v.1.0.0 1 Abstract This document describes the basic behavior

More information

Introduction to VHDL #1

Introduction to VHDL #1 ECE 3220 Digital Design with VHDL Introduction to VHDL #1 Lecture 3 Introduction to VHDL The two Hardware Description Languages that are most often used in industry are: n VHDL n Verilog you will learn

More information

ECE Digital Design Laboratory. Lecture 3 Finite State Machines!

ECE Digital Design Laboratory. Lecture 3 Finite State Machines! ECE 4401 - Digital Design Laboratory Lecture 3 Finite State Machines! 1!!!! Synchronous Sequential Circuits!!! Synchronous sequential logic circuits are realized using combinational logic and storage elements

More information

5. VHDL - Introduction - 5. VHDL - Design flow - 5. VHDL - Entities and Architectures (1) - 5. VHDL - Entities and Architectures (2) -

5. VHDL - Introduction - 5. VHDL - Design flow - 5. VHDL - Entities and Architectures (1) - 5. VHDL - Entities and Architectures (2) - Sistemas Digitais I LESI - 2º ano Lesson 5 - VHDL Prof. João Miguel Fernandes (miguel@di.uminho.pt) Dept. Informática - Introduction - VHDL was developed, in the mid-1980s, by DoD and IEEE. VHDL stands

More information

Lab # 5. Subprograms. Introduction

Lab # 5. Subprograms. Introduction Lab # 5 Subprograms Introduction Subprograms consist of procedures and functions. A procedure can return more than one argument; a function always returns just one. In a function, all parameters are input

More information

Altera s Avalon Communication Fabric

Altera s Avalon Communication Fabric Altera s Avalon Communication Fabric Stephen A. Edwards Columbia University Spring 2012 Altera s Avalon Bus Something like PCI on a chip Described in Altera s Avalon Memory-Mapped Interface Specification

More information

Lecture 12 VHDL Synthesis

Lecture 12 VHDL Synthesis CPE 487: Digital System Design Spring 2018 Lecture 12 VHDL Synthesis Bryan Ackland Department of Electrical and Computer Engineering Stevens Institute of Technology Hoboken, NJ 07030 1 What is Synthesis?

More information

Converting Hardware Interface Layer (HIL) v1.x Projects to v2.0

Converting Hardware Interface Layer (HIL) v1.x Projects to v2.0 HUNT ENGINEERING Chestnut Court, Burton Row, Brent Knoll, Somerset, TA9 4BP, UK Tel: (+44) (0)1278 760188, Fax: (+44) (0)1278 760199, Email: sales@hunteng.co.uk www.hunteng.co.uk www.hunt-dsp.com Converting

More information

Example 15: Moving Sprites with Flash Background

Example 15: Moving Sprites with Flash Background Displaying an Image Read from Flash Memory 95 Listing 2.5 (cont.) vga_flash_n2_top.vhd clr

More information

EL 310 Hardware Description Languages Midterm

EL 310 Hardware Description Languages Midterm EL 3 Hardware Description Languages Midterm 2 3 4 5 Total Name: ID : Notes: ) Please answer the questions in the provided space after each question. 2) Duration is minutes 3) Closed books and closed notes.

More information

2/22/2018. Warmup 2/ሺ Don t turn your rotations into reflections. Rotations around OTHER points than the origin

2/22/2018. Warmup 2/ሺ Don t turn your rotations into reflections. Rotations around OTHER points than the origin Warmup 2/ሺ1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + Created by Mr. Lischwe 1) What sequence of transformations could map shape onto shape? e specific! 2) Draw a capital R like so: 3) Draw the R after a 90

More information

COVER SHEET: Total: Regrade Info: 5 (14 points) 7 (15 points) Midterm 1 Spring 2012 VERSION 1 UFID:

COVER SHEET: Total: Regrade Info: 5 (14 points) 7 (15 points) Midterm 1 Spring 2012 VERSION 1 UFID: EEL 4712 Midterm 1 Spring 2012 VERSION 1 Name: UFID: IMPORTANT: Please be neat and write (or draw) carefully. If we cannot read it with a reasonable effort, it is assumed wrong. As always, the best answer

More information