14
STUDENT-CREATED LABORATORY EXERCISES FOR THE DIGITAL SYSTEMS DESIGN COURSE USING HDL AND PLDS Daniel D. McCarthy, Cameron H. G. Wright, Steven F. Barrett, and Jerry C. Hamann Department of Electrical and Computer Engineering University of Wyoming, WY Abstract The concepts presented in an introductory digital systems design lecture are often dicult for stu- dents to comprehend fully. In order to aid in this understanding, laboratory exercises are often as- signed in order to reinforce the concepts introduced in lecture. These lab exercises also expose stu- dents to hardware, software, and hardware descrip- tion languages used by industry professionals. We have been experimenting with a new paradigm for lab exercise creation, whereby previous students of a course are recruited to create new lab exercises for the course, a method we call “By Students, For Students” that we have tested with several dierent courses. This paper describes the result of apply- ing this paradigm to a four semester hour introduc- tory digital systems design course typically taken by sophomore electrical engineering and computer engineering majors. The lab exercises involve con- siderable use of programmable logic and the Ver- ilog hardware description language (HDL). Inter- estingly, the student-created lab exercises tended to be more challenging than the previous set of faculty-created lab exercises. Introduction The concepts presented in a digital systems de- sign lecture may be dicult for some undergradu- ate students to fully grasp. In order to aid in stu- dents’ understanding, laboratory exercises are of- ten used in conjunction with traditional lectures to present tough concepts in an electrical engineering courses like digital systems design [1–5]. We have been experimenting with a new paradigm for lab exercise creation, whereby pre- vious students of a course are recruited to create new lab exercises for the course, a method we call “By Students, For Students” that we have tested with several dierent courses. This paper describes the lab exercises that resulted from applying this paradigm to a four semester hour introductory digi- tal systems design course (EE2390) typically taken by sophomore electrical engineering and computer engineering majors. The course includes hands- on use of Xilinx’s professional-grade electronic de- sign automation (EDA) software, Xilinx CPLDs, Atmel PLDs, and even one lab exercise using dis- crete logic chips. Most lab exercises involve con- siderable use of the Verilog hardware description language (HDL). Interestingly, the student-created lab exercises for EE2390 tended to be more chal- lenging than the previous set of faculty-created lab exercises. Feedback from graduate student Teaching Assistants (TAs) who taught both ver- sions of the lab exercises conrms the ecacy of the student-created content. EE2390 is a four credit hour course oered during the Spring and Fall semesters at the University of Wyoming. It has a prerequisite of Calculus II and is designed to be taken during a student’s sophomore year. The course is taught using the fourth edition of Digital Design by M. M. Mano and M. D. Ciletti [6]. The core topics covered in this course are: binary logic, digital logic gates, reduction of Boolean expressions, combinational logic design, SSI, MSI, LSI combinational logic ICs, ip-ops, COMPUTERS IN EDUCATION JOURNAL 75

STUDENT-CREATED LABORATORY EXERCISES FOR THE …

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: STUDENT-CREATED LABORATORY EXERCISES FOR THE …

STUDENT-CREATED LABORATORY EXERCISES FOR THE DIGITALSYSTEMS DESIGN COURSE USING HDL AND PLDS

Daniel D. McCarthy, Cameron H. G. Wright, Steven F. Barrett, and Jerry C. HamannDepartment of Electrical and Computer Engineering

University of Wyoming, WY

Abstract

The concepts presented in an introductory digitalsystems design lecture are often difficult for stu-dents to comprehend fully. In order to aid in thisunderstanding, laboratory exercises are often as-signed in order to reinforce the concepts introducedin lecture. These lab exercises also expose stu-dents to hardware, software, and hardware descrip-tion languages used by industry professionals. Wehave been experimenting with a new paradigm forlab exercise creation, whereby previous students ofa course are recruited to create new lab exercisesfor the course, a method we call “By Students, ForStudents” that we have tested with several differentcourses. This paper describes the result of apply-ing this paradigm to a four semester hour introduc-tory digital systems design course typically takenby sophomore electrical engineering and computerengineering majors. The lab exercises involve con-siderable use of programmable logic and the Ver-ilog hardware description language (HDL). Inter-estingly, the student-created lab exercises tendedto be more challenging than the previous set offaculty-created lab exercises.

Introduction

The concepts presented in a digital systems de-sign lecture may be difficult for some undergradu-ate students to fully grasp. In order to aid in stu-dents’ understanding, laboratory exercises are of-ten used in conjunction with traditional lectures topresent tough concepts in an electrical engineeringcourses like digital systems design [1–5].

We have been experimenting with a newparadigm for lab exercise creation, whereby pre-

vious students of a course are recruited to createnew lab exercises for the course, a method we call“By Students, For Students” that we have testedwith several different courses. This paper describesthe lab exercises that resulted from applying thisparadigm to a four semester hour introductory digi-tal systems design course (EE2390) typically takenby sophomore electrical engineering and computerengineering majors. The course includes hands-on use of Xilinx’s professional-grade electronic de-sign automation (EDA) software, Xilinx CPLDs,Atmel PLDs, and even one lab exercise using dis-crete logic chips. Most lab exercises involve con-siderable use of the Verilog hardware descriptionlanguage (HDL). Interestingly, the student-createdlab exercises for EE2390 tended to be more chal-lenging than the previous set of faculty-createdlab exercises. Feedback from graduate studentTeaching Assistants (TAs) who taught both ver-sions of the lab exercises confirms the efficacy ofthe student-created content.

EE2390 is a four credit hour course offered duringthe Spring and Fall semesters at the University ofWyoming. It has a prerequisite of Calculus II and isdesigned to be taken during a student’s sophomoreyear. The course is taught using the fourth editionof Digital Design by M. M. Mano and M. D. Ciletti[6]. The core topics covered in this course are:

• binary logic,

• digital logic gates,

• reduction of Boolean expressions,

• combinational logic design,

• SSI, MSI, LSI combinational logic ICs,

• flip-flops,

COMPUTERS IN EDUCATION JOURNAL 75

Page 2: STUDENT-CREATED LABORATORY EXERCISES FOR THE …

• synchronous and asynchronous sequentialsystems,

• MSI and LSI sequential system ICs, and

• algorithmic state machines.

The lab exercises for EE2390 are used to sup-plement the various concepts covered in lecture.Throughout the semester, many of the core top-ics covered in lecture are also covered in lab toimprove the students’ comprehension. However,improved understanding of lecture concepts is notthe only purpose for the lab exercises in EE2390.These lab exercises also expose students to hard-ware, software and hardware description languagesused by industry professionals [6–8]. Some ofthese include:

• Verilog hardware description language,

• Xilinx electronic design automation (EDA)software,

• Xilinx 95108 CPLD,

• CUPL hardware description language,

• Atmel WinCUPL software, and

• Atmel ATF22V10 PLD.

The primary reason for creating a new set of labexercises for EE2390 was to “push” the students toa higher level of understanding. The previous ver-sion of the lab exercises was created when a pre-vious edition of the text book was used; in thatedition the coverage of Verilog was not as exten-sive nor were there as many examples as in the lat-est edition. With the new textbook edition and amore thorough coverage of using HDL with pro-grammable logic in class came the opportunity tochallenge the students a bit more. However, a stu-dent’s perspective about how much is too much ofa challenge can be invaluable. This is part of thebenefit of the “By Students, For Students” method.Previous students of some course, who are usuallyby now graduate students, are recruited to createnew lab exercises for that course using their stu-dent perspective as a form of insight that many

professors have long forgotten. We have success-fully used this approach with several undergraduatecourses.

Laboratory Setup

Each lab section for EE2390 takes place in thedigital lab at the University of Wyoming. Studentsattend one two hour lab section per week for 13weeks out of the semester. When completing labexercises, students work in groups of two. Al-though the students are working collaboratively tofinish the in-lab portion of the lab exercises, eachstudent is responsible for his/her own work andtheir own lab notebook.

Laboratory Equipment

The digital lab at the University of Wyomingis equipped with all the necessary lab equipment,hardware, and software for students to complete theassigned lab exercises. This includes:

• PCs running the Windows operating system,

• Elenco Model XK-550 (prototype board)Trainers,

• logic analyzers,

• oscilloscopes,

• multimeters,

• external power supplies,

• Xilinx’s 95108 CPLDs on custom PCBs,

• Atmel’s ATF22V10CQZ PLDs in DIP pack-aging,

• individual logic gate in DIP packaging,

• seven segment LEDs,

• ten segment bar graph LEDs,

• Xilinx ISE 10.1 software,

• ModelSim XE III/Starter 6.3c software, and

• Atmel WinCupl software.

76 COMPUTERS IN EDUCATION JOURNAL

Page 3: STUDENT-CREATED LABORATORY EXERCISES FOR THE …

Laboratory Manual

At the start of the semester each student is re-quired to purchase a lab manual for EE2390 [9].This lab manual consists of:

• laboratory notebook procedures,

• pre-lab instructions for each lab,

• in-lab instructions for each lab,

• instructions on how to use all required soft-ware,

• information on the custom PCBs that interfacewith the Xilinx 95108 CPLDs,

• a datasheet for the Atmel ATF22V10CQZPLD, and

• datasheets for all individual logic gate chips.

Laboratory Quizes

At the beginning of every lab section, students aregiven a quiz over the material covered in the previ-ous week’s lab. These quizzes are only a few ques-tions in length and designed to be completed in tenminutes or less.

Students’ Laboratory Notebook

At the beginning of the semester, each student isrequired to purchase a blank lab notebook. Thepurpose of these notebooks is to get the studentsinto the habit of keeping a valid lab notebookwhenever they are doing applicable engineeringwork. The requirements for these notebooks areset forth in the beginning of the lab manual alongwith some generic guidelines as to what the stu-dents should be including in their notebook. Thefirst couple of labs also instruct the students onexactly what should be placed into their lab note-books. However, during the later labs, the studentis responsible for including the proper informationin the lab notebook. At the beginning of each lab,students submit these notebooks to the lab TA forgrading. The TA grades the previous week’s lab as

well as the pre-lab exercises for the current week.In addition to the weekly grading of the notebooks,a final grade is given to each student’s notebook atthe end of semester by the course professor.

Description of New Lab Exercises

Lab 1: Binary Arithmetic

Key Concepts

The key concepts addressed in this lab are:

• converting between the binary, hexadecimal,and decimal number systems;

• addition and subtraction of unsigned andsigned 2’s complement numbers along withoverflow detection;

• an introduction to the Xilinx and ModelSimsoftware packages; and

• the simulation of a design using Xilinx andModelSim software.

Pre-Lab Exercises

This pre-lab requires students to complete the ad-dition and subtraction exercises shown in Table 1.Students must use the binary number system in or-der to complete the operations and then convert theresult back to its hexadecimal representation. Stu-dents are also given the task of identifying whenoverflow occurred given that the result is going tobe stored using eight bits. Finally, students checktheir work by converting the given numbers to theirdecimal representation and verifying that the re-sults they obtained were in fact correct (if there wasno overflow).

In-Lab Exercises

The in-lab portion of this lab is very short anddoes not require much work by the student. Thereason for this is that during this first lab they arerequired to map appropriate network drives, map

COMPUTERS IN EDUCATION JOURNAL 77

Page 4: STUDENT-CREATED LABORATORY EXERCISES FOR THE …

Table 1: Arithmetic Operations

Unsigned Numbers Signed (2’s Complement) Numbers(1) 8’h23 + 8’hCF = ? (6) 8’hDD + 8’hEE = ?(2) 8’hA2 + 8’h61 = ? (7) 8’h71 + 8’h54 = ?(3) 8’h81 + 8’h7D = ? (8) 8’h9E + 8’hAC = ?(4) 8’hC0 - 8’hAF = ? (9) 8’h4E - 8’h1B = ?(5) 8’h59 - 8’h74 = ? (10) 8’h8A - 8’h5B = ?

the network printer, and become familiar with thelayout of the Xilinx software. Instructions for com-pleting these tasks are described in detail for thestudents in the lab manual.

After completing all of initial lab setup, studentssimulate an eight bit adder subtractor schematicusing the Xilinx and ModelSim software. Theschematic has already been entered into a Xilinxschematic for them. A test fixture that tests thearithmetic operations that they used in the pre-labhas also already been written. Students are onlyrequired to verify that the results returned by thesimulation are equivalent (including overflow de-tection) to the results they obtained in their pre-lab.

Lab 2: Introduction to Combinational Logic

Key Concepts

The key concepts addressed in this lab are:

• single bit parity generation and checking,

• DeMorgan’s theorem,

• the simulation of a design using Xilinx andModelSim software, and

• breadboarding using small IC packages of sin-gle logic gates.

Pre-Lab Exercises

The first pre-lab exercise for this lab requires stu-dents to generate odd parity for a given set of threebit words. Then, after examining three equivalent

circuits that verify odd parity for a three bit code-word and a single bit of parity, students must con-vert one of those circuits (shown in Figure 1) into acircuit that utilizes only NAND and inverter gates.Finally, students must provide the pin-out for thecircuit that they just converted using 74LS00 and74LS04 chips in type N packaging.

In-Lab Exercises

The first part of the in-lab portion of this lab re-quires students to simulate a completed Xilinx de-sign. The schematic in this design contains the cir-cuit that the students converted in the pre-lab alongwith two of the three other identical circuits pre-sented earlier in the lab. A completed test fixture isalso provided for the students in order to completethe simulation.

After successfully simulating their design, stu-dents are required to wire up their design on abreadboard using 74LS00 and 74LS04 chips andthe pin-outs that they provided in the pre-lab. Thiscircuit is then tested by the student to verify theirdesign.

Lab 3: Introduction to Combinational LogicDesign and CPLD Implementation

Key Concepts

The key concepts addressed in this lab are:

• excess-3 codes;

78 COMPUTERS IN EDUCATION JOURNAL

Page 5: STUDENT-CREATED LABORATORY EXERCISES FOR THE …

Figure 1: Odd Parity Error Detection Circuit

• an introduction to schematic design entry intothe Xilinx software;

• SOP and POS expressions;

• simplifying boolean expressions using Kar-naugh maps (optional); and

• the entry, simulation, and hardware imple-mentation of a design using Xilinx and Mod-elSim software.

Pre-Lab Exercises

Given a list of valid excess-3 codes, the student’sfirst task is to write a truth table for a signal that in-dicates an invalid codeword. Students must thenwrite the canonical sum-of-products (SOP) andproduct-of-sums (POS) expressions for their errorsignal. Optionally, students can also attempt to re-duce either of these expressions using Karnaughmaps. Finally, students must sketch circuit dia-grams for their SOP and POS expressions.

In-Lab Exercises

For this lab, a Xilinx skeleton project is providedto the students. This skeleton project contains anunfinished schematic with only inputs and outputsdrawn, a completed test fixture, and correct pinassignments for the 95108 CPLD. The first in-lab

task is for the students to enter either their SOP orPOS circuits into the Xilinx schematic editor. Sincethis is the first time that the students will actuallyuse the schematic editor, a short introduction to thisportion of the Xilinx software is provided. Af-ter successfully entering their schematic, studentsmust simulate their design using the provided testfixture. Finally, they synthesize their design anddownload it to a CPLD where they can test theirdesign in hardware.

Lab 4: Multiple Output Combinational LogicDesign with PLD Implementation

Key Concepts

The key concepts addressed in this lab are:

• an introduction to the CUPL hardware de-scription language,

• Gray code,

• simplifying boolean expressions using Kar-naugh maps,

• the entry and hardware implementation of adesign using Atmel’s WinCUPL software.

COMPUTERS IN EDUCATION JOURNAL 79

Page 6: STUDENT-CREATED LABORATORY EXERCISES FOR THE …

Pre-Lab Exercises

The first task for the pre-lab is to complete atruth table which converts a BCD codeword to aGray code codeword. Students then have to re-duce each of the output expressions (one for eachbit of the Gray code) using Karnaugh maps. Af-ter a brief introduction to CUPL, students are alsotasked with writing two CUPL source files that de-scribe the BCD to Gray code converter. One of thesource files uses reduced Boolean expressions andthe other uses a truth table approach. It should alsobe noted that sample CUPL files are provided thatimplement the solution to Lab 3 (but not this Lab4 exercise) using reduced Boolean expressions andthe truth table approach.

The CUPL language, along with the AtmelATF22V10 PLD, are introduced in this lab in or-der to show students an alternative to the largerand more expensive CPLDs and FPGAs. In somecases, the “higher end” programmable logic de-vices such as CPLDs and FPGAs may be needed toobtain a working design, but sometimes a smallerand cheaper solution is appropriate. This lab ex-plains this to students and gives them some experi-ence using the smaller and cheaper 22V10 PLD.

In-Lab Exercises

The first in-lab task for the students is to properlyset up a WinCUPL project. After completing this,students copy their source code file into the projectand compile it. They then load their design onto theATF22V10CQZ PLD using a dedicated computerin the lab. This design is then tested for correctoperation.

Lab 5: Multiple Output Combinational LogicDesign with Verilog Implementation

Key Concepts

The key concepts addressed in this lab are:

• an introduction to programming paradigms ofVerilog (gate level, dataflow, and behavioral);

• the use of a seven-segment LED displays;

• simplifying boolean expressions using Kar-naugh maps; and

• the entry, simulation, and hardware imple-mentation of a design using Xilinx and Mod-elSim software.

Pre-Lab Exercises

After being given a brief introduction to the threestyles of Verilog coding (which is in addition tosimilar coverage in lecture), the students completea truth table describing the active low Booleanfunctions for driving all the segments of a seven-segment display in the manner shown in Figure 2.The input for this truth table is a single four-bitcodeword. Students are then tasked to reduce eachof the segment driver expressions using Karnaughmaps. Finally, students write a Verilog module thatimplements their seven-segment driver logic.

Figure 2: Desired Hexadecimal Digit Encodingsfor Seven-Segment Displays

In-Lab Exercises

The first thing students do when they get to lab isto enter their Verilog module into a skeleton projectthat has been preconfigured with a test fixture (thatwill test the students’ seven-segment driver logic),correct pin assignments, and a top-level schematic.Students then simulate their design using the pro-vided test fixture, synthesize it, and download it tothe CPLD for hardware testing.

80 COMPUTERS IN EDUCATION JOURNAL

Page 7: STUDENT-CREATED LABORATORY EXERCISES FOR THE …

Lab 6: Combinational Logic Design with aDecoder

Key Concepts

The key concepts addressed in this lab are:

• incorporating previously defined logic circuitsinto a larger design;

• the use of a ten-segment LED bar graph; and

• the entry, simulation, and hardware imple-mentation of a design using Xilinx and Mod-elSim software.

Pre-Lab Exercises

First, students are provided with the truth tablefor driving a ten-segment bar graph (shown in Fig-ure 3) using a four-bit codeword. Then, studentsare instructed to incorporate a 3-to-8 decoder intoa combinational logic design that satisfies the truthtable. Because the decoder only has eight outputs,students also have to come up with additional logicto generate the other two outputs.

����� �����

Figure 3: Ten-Segment LED Bar-Graph

In-Lab Exercises

As was the case with the previous labs, a skeletonproject with a test fixture (for testing the studentsten-segment bar graph), correct pin assignments,and a top-level schematic is provided for the stu-dents to use. Thus, their first task is to enter theirbar graph design into the provided schematic file.Students then simulate their design using the pro-vided test fixture, synthesize it, and download it tothe CPLD for hardware testing.

Lab 7: Hierarchical Combinational LogicDesign

Key Concepts

The key concepts addressed in this lab are:

• hierarchical design techniques;

• the reuse of previous design modules; and

• the entry, simulation, and hardware imple-mentation of a design using Xilinx and Mod-elSim software.

Pre-Lab Exercises

The design for this lab displays two numbers onseven segment displays, adds or subtracts them us-ing unsigned addition or subtraction, and displaysthe result on a ten segment bar graph. Students aregiven the block diagram shown in Figure 4 alongwith a similar top-level schematic to help them vi-sualize the hierarchial design. The pre-lab exer-cises for this lab require students to complete theseven-segment display module, the adder subtrac-tor module, and the bar-graph display module usingthe provided skeleton modules.

Figure 4: Block Diagram of BCD Adder

In-Lab Exercises

A skeleton project for this lab is available for thestudents to use when they are ready to enter their

COMPUTERS IN EDUCATION JOURNAL 81

Page 8: STUDENT-CREATED LABORATORY EXERCISES FOR THE …

design. This skeleton project contains the skeletonVerilog source files and schematics used in the pre-lab, a completed top-level schematic, completedtest fixtures for all four modules (the three the stu-dent created and the given top-level module), andthe correct pin assignments. After entering theirdesign into the project, students must simulate eachmodule of their design using the test fixtures pro-vided. After testing all of the modules, studentssynthesize their design and download it to a CPLDfor hardware testing.

Lab 8: Introduction to Sequential Logic CircuitElements

Key Concepts

The key concepts addressed in this lab are:

• operation of D, JK, and T flip-flops;

• post-fit simulation of a design;

• full schematic entry using Xilinx software;

• behavioral and post-fit simulation using Xil-inx and Modelsim software; and

• hardware implementation of a design usingXilinx software.

Pre-Lab Exercises

The pre-lab portion of this lab requires studentsto provide timing diagrams for a positive edge trig-gered D flip-flop with active high output, a posi-tive edge triggered JK flip-flp with active high out-put, and a cascade of three positive edge triggeredT flip-flops with active high outputs (the inputs toall of the T flip-flops are tied to a logic high andthe clocks are tied to the output of the previousT flip-flop). Students are provided with the inputsto these flip-flop configurations and are required tocomplete the resulting timing diagram.

In-Lab Exercises

A skeleton project with an empty schematic file,a test fixture, and correct pin assignments is pro-vided to the students. Their first in-lab task is toenter each of three flip-flop configurations into thesingle schematic file. This is the first time that stu-dents are working without a skeleton schematic.After entering the schematic, students use the pro-vided test fixture to do a behavioral simulation onthe flip-flops as well as a post-fit simulation. Aftercompleting these two simulations, students synthe-size their design and download it to a CPLD forhardware testing.

Lab 9: Clocked Synchronous State MachineAnalysis

Key Concepts

The key concepts addressed in this lab are:

• clocked synchronous state machine analysis;

• pseudo-noise (PN) sequence generators;

• state diagrams;

• state transition/output tables; and

• the entry, simulation, and hardware imple-mentation of a design using Xilinx and Mod-elSim software.

Pre-Lab Exercises

After receiving a little bit of background on PNgenerators, students are required to provide a sin-gle gate that self corrects the three stage PN gen-erator shown in Figure 5 if it should ever go intoan all zero state. After adding this gate studentsmust provide a transition output table and state di-agram for the PN generator. Next, students mustidentify whether the outputs of the PN generatorin Figure 5 are Mealy or Moore outputs. Finally,students must provide a mathematical equation de-scribing the maximum length output sequence fora PN generator with n different stages.

82 COMPUTERS IN EDUCATION JOURNAL

Page 9: STUDENT-CREATED LABORATORY EXERCISES FOR THE …

Figure 5: Three Stage PN Generator Schematic

In-Lab Exercises

A skeleton project with the schematic shown inFigure 5, a LED driver module that allows the out-puts of the schematic to be displayed on a sevensegment display and one segment of the bar graph,a top-level module, a test fixture, and the correctpin assignments are provided for the students. Thisis the last time that a skeleton project will be pro-vided. After this lab students will be responsiblefor creating their own projects. The first in-lab taskis for the students to complete the schematic of thePN generator using the gate they came up with inthe pre-lab. After completing the schematic stu-dents simulate their design using the provided testfixture. This is also the final time that a test fix-ture will be provided for the students. After simu-lation is complete students synthesize their designand download it to a CPLD for hardware testing.

Lab 10: Synchronous State Machine Design andSimulation

Key Concepts

The key concepts addressed in this lab are:

• synchronous state machine design;

• test fixture design;

• state diagrams;

• state transition/output tables; and

• the design, entry, simulation, and hardwareimplementation of a design using Xilinx andModelSim software.

Pre-Lab Exercises

This lab requires students to complete a designsimilar to one that was presented in class. Thisdesign was for a vending machine that accepteddimes and nickels, dispensed a $0.15 product, anddispensed change when appropriate. In the lectureportion of the class, this design was completed us-ing a one-hot state machine design. The design thatis required for this lab is exactly the same as the onedescribed in class except that it uses binary codedstates instead of one-hot states.

The first pre-lab exercise is for the students tocreate a transition/output table along with a statediagram for this design. The next task is to com-plete a Verilog module for the vending machine.Then, students must complete a LED driver mod-ule which displays the current state of the vendingmachine (on a seven-segment display) and whetheror not the product and or change was dispensed(using two of the ten bars on the ten-segment bargraph). Finally, students must complete a test fix-

COMPUTERS IN EDUCATION JOURNAL 83

Page 10: STUDENT-CREATED LABORATORY EXERCISES FOR THE …

ture to test their vending machine module. Studentsmay also optionally write a test fixture to test theirLED driver circuit. Very sparse skeleton code filesare provided to help the students in these tasks.

In-Lab Exercises

This is the first lab in which students are not givenany skeleton project. This means that studentswill first have to create a new Xilinx project inwhich to enter their design. After creating this newproject, students add their three completed files tothe project. Then, they create a top-level modulethat connects the LED driver module to the vend-ing machine module. Once this has been completedstudents simulate their design using their own testfixtures. If the design simulates correctly, studentssynthesize their design and download it to a CPLDfor hardware testing using the pin assignments de-scribed in the lab manual.

Lab 11: Clocked Synchronous State MachineDesign

Key Concepts

The key concepts addressed in this lab are:

• synchronous state machine design;

• open ended design;

• ASM and ASMD charts;

• state transition tables; and

• the design, entry, simulation, and hardwareimplementation of a design using Xilinx andModelSim software.

Pre-Lab Exercises

In this lab students are required to design aclocked synchronous state machine which drives aseven segment display in the fashion depicted inFigure 6. In this design, the state machine idlesat zero until the Go input is asserted (with a logic

1). When this happens the state machine will eithercount up or down depending on the state of the Upinput. The Go input is ignored in all states exceptfor the idle state. On the other hand, the Up in-put is never ignored. There is also an active highasynchronous clear input that immediately takesthe state machine back to the idle state.

The first pre-lab task for the students is for themto complete a state table and an ASM or ASMDchart (their choice) describing the required statemachine. Next students must design the state ma-chine as well as a LED driver circuit. Students maychoose either a schematic or Verilog approach foreither of these modules. Students must also providetest fixtures for the state machine, the LED drivercircuit, and for a top-level module.

In-Lab Exercises

Once students arrive in lab, they create a new Xil-inx project. Their state machine, called LED driver,and test fixtures are then added to this design. Stu-dents also must create a top-level schematic for thisproject which interfaces the state machine designto the LED driver design. Once this is done, stu-dents simulate their three design modules using thethree test fixtures that they wrote in the pre-lab.If all design modules simulate correctly, studentssynthesize their design and download it to a CPLDfor hardware testing using the pin assignments de-scribed in the lab manual.

Lab 12: Final Project - State Machine Design fora Stoplight Controller

Key Concepts

The key concepts addressed in this lab are:

• synchronous state machine design;

• large open ended design;

• ASM and ASMD charts;

• state transition tables; and

84 COMPUTERS IN EDUCATION JOURNAL

Page 11: STUDENT-CREATED LABORATORY EXERCISES FOR THE …

Sequence for Sequence forUp=0 Up=1

7-Seg Display Description 7-Seg DisplayIdle state, dis-played as shown.Return here afterninth step as wellas when Clear=1is detected.

First step afterGo=1 sensed;displayed asshown.

Second step afterGo=1 sensed; dis-played as shown.

Third step afterGo=1 sensed; dis-played as shown.

Fourth step afterGo=1 sensed; dis-played as shown.

Fifth step afterGo=1 sensed;displayed asshown.

Sixth step afterGo=1 sensed; dis-played as shown.

Seventh step afterGo=1 sensed; dis-played as shown.

Eighth step afterGo=1 sensed; dis-played as shown.

Ninth step afterGo=1 sensed; dis-played as shown.Return to idlestate at next tickof clock.

Figure 6: Desired “light” Signal Pattern Sequence

• the design, entry, simulation, and hardwareimplementation of a design using Xilinx andModelSim software.

Pre-Lab Exercises

As the final lab exercise for EE2390, it is de-signed to take two weeks to complete. There arealso four acceptable levels of completion. Levels 1-4 correspond to maximum possible grades of 75%,85%, 100%, and 110% respectively. Students areencouraged to start at level one and work their wayup to level four, saving their work as they go. Theyare not required to go beyond level 1, but essen-tially all students do. Pre-lab exercises are not begraded at the beginning of this lab exercise, as thestudents are told they should by now be responsiblefor coming to lab fully prepared. It is up to the stu-dent to make sure that their design is documentedto the given specifications.

In this lab exercise, students are required to con-trol a simulated highway intersection depicted inFigure 7. To complete level 1, students must sim-ply control lights X and Z using the provided tim-ing characteristics. To complete level 2, studentsmust also add a crosswalk timer for both lights.The crosswalk is very similar to the design com-pleted in lab 11. To complete level 3, students mustalso modify their control sequence to only turn theX lights green after a car has activated sensor C orsensor A. To complete level 4, students must alsouse sensors B and D to detect when a car has run ared light (light X) on the north south side street. Ifthis happens, camera U (for sensor D) or camera V(for sensor B) should be activated in order to takea picture of the licence plate of the offender. Thecrosswalk timers are displayed on seven-segmentdisplays whereas all of the rest of the output sig-nals are displayed using the ten-segment bar graph.

The actual pre-lab exercises are left to the stu-dents for this lab. ASM or ASMD charts, state tran-sition tables, next-state equations, and Boolean ex-pressions for combinational logic are all suggestedas possible design tools. Students are also encour-

COMPUTERS IN EDUCATION JOURNAL 85

Page 12: STUDENT-CREATED LABORATORY EXERCISES FOR THE …

� �

�����

����

�����

����

Figure 7: Intersection Used for Lab 12

aged to use these tools at every level of their work.Finally, students are warned that if they expect toreceive help from a TA or professor with their de-sign, then they must have it properly documentedusing the tools mentioned above.

In-Lab Exercises

The in-lab portion of this lab is exactly the sameas many of the other labs that students have com-pleted throughout the semester. Students are re-sponsible for simulating their design to verify func-tionality at all levels, synthesizing it, and down-loading it to a CPLD where they can test it in hard-ware. In order to ensure that all students use thesame LEDs, pin assignments are provided in thelab manual for this lab.

Conclusion

The set of EE2390 laboratory exercises describedabove was created by a former EE2390 studentwho is now a graduate student. This is an exam-ple of our “By Students, For Students” method,which leverages a student’s relatively recent mem-

ory of what what were some of the biggest hurdlesfor a particular course. Feedback from EE2390TAs who taught both the previous version of thelab and this new version was interesting. Overall,the new lab exercises appeared to be “harder” andmost of the individual lab grades were thus lower.However, on the final lab exercise in which the stu-dents are given an open-ended realistic design chal-lenge, the results were much better. Thus we tenta-tively conclude that the more difficult lab exercisesprepared the students better for open-ended designproblems.

After analyzing the topic coverage of these labexercises along with the content of related higher-level elective courses (such as Verilog HDL andComputer Architecture) that are being offered at theUniversity of Wyoming, we also believe that a newcourse in design verification techniques would bea useful addition to the curriculum. This coursewould teach various verification techniques, testplanning, code coverage, and other similar con-cepts that are used by engineers in industry today.

We encourage educators to give the “By Students,For Students” method a try; we have found it to be

86 COMPUTERS IN EDUCATION JOURNAL

Page 13: STUDENT-CREATED LABORATORY EXERCISES FOR THE …

both successful from a pedagogical standpoint butalso immensely popular with students.

References

1. M. A. Yoder, J. H. McClellan, and R. W.Schafer, “Experiences in teaching DSP first inthe ECE curriculum,” in Proceedings of the1997 ASEE Annual Conference, Jun. 1997, pa-per 1220-06.

2. R. G. Jacquot, J. C. Hamann, J. W. Pierre, andR. F. Kubichek, “Teaching digital filter designusing symbolic and numeric features of Mat-lab,” ASEE Comput. Educ. J., vol. VII, no. 1,pp. 8–11, January–March 1997.

3. C. H. G. Wright and T. B. Welch, “Teach-ing DSP concepts using Matlab and theTMS320C31 DSK,” in Proceedings of the IEEEInternational Conference on Acoustics, Speech,and Signal Processing, Mar. 1999, paper 1778.

4. J. W. Pierre, F. K. Tuffner, J. R. Anderson, D. L.Whitman, A. H. M. S. Ula, R. F. Kubichek,C. H. G. Wright, S. F. Barrett, J. J. Cupal,and J. C. Hamann, “A one-credit hour hands-onintroductory course in electrical and computerengineering using a variety of topic modules,”IEEE Trans. Educ., vol. 52, May 2009, in press.

5. S. F. Barrett, D. Whitman, R. Kubichek,J. Pierre, S. Muknahallipatna, and C. H. G.Wright, “Embedded systems design: respond-ing to the challenge,” in Proceedings of the 2009ASEE Annual Conference, Austin, TX, June2009.

6. M. M. Mano and M. D. Ciletti, Digital Design,4th ed. Prentice Hall, 2007.

7. K. Morris, “Tilting at tech market wind-mills,” FPGA and Programmable Logic Jour-nal, March 2004.

8. ——, “Who’s winning in FPGAs II,” FPGA andStructured ASIC Journal, November 2008.

9. C. H. G. Wright, J. C. Hamann, and D. D. Mc-Carthy, EE/COSC 2390 Digital Systems Design

Laboratory Manual, University of Wyoming,Laramie, WY 82071, April 2009.

Biographical Information

Daniel D. McCarthy, M.S.E.E., was a graduatestudent in the Department of Electrical and Com-puter Engineering at the University of Wyoming,Laramie, WY, when he performed the work relatedto this article. He received the B.S. in ComputerEngineering (magna cum laude) in 2008 and theM.S. in Electrical Engineering in 2009, both fromthe University of Wyoming. He is a member of TauBeta Pi and Mortar Board. Daniel is currently astaff engineer with General Dynamics C4 Systemsin Scottsdale, AZ.

Cameron H. G. Wright, Ph.D, P.E., is an As-sociate Professor with the Department of Electri-cal and Computer Engineering at the Universityof Wyoming, Laramie, WY. He was previouslyProfessor and Deputy Department Head in the De-partment of Electrical Engineering at the UnitedStates Air Force Academy, and served as an R&Dengineering officer in the U.S. Air Force for over20 years. He received the B.S.E.E. (summa cumlaude) from Louisiana Tech University in 1983,the M.S.E.E. from Purdue University in 1988,and the Ph.D. from the University of Texas atAustin in 1996. Cam’s research interests includesignal/image processing, real-time embedded sys-tems, biomedical instrumentation, and engineeringeducation. He holds FCC licenses for commer-cial radio/television broadcasting, and amateur ra-dio. He is a member of ASEE, IEEE, SPIE, BMES,NSPE, Tau Beta Pi, and Eta Kappa Nu. His teach-ing awards include the IEEE Student Branch’s Out-standing Professor of the Year (2005 and 2008), theMortar Board “Top Prof” award (2005 and 2007),the Outstanding Teaching Award from the ASEERocky Mountain Section (2007), and the BrigadierGeneral R. E. Thomas Award for outstanding con-tribution to cadet education (both 1992 and 1993)at the U.S. Air Force Academy. Cam currentlyserves as Associate Department Head, Departmentof Electrical and Computer Engineering.

COMPUTERS IN EDUCATION JOURNAL 87

Page 14: STUDENT-CREATED LABORATORY EXERCISES FOR THE …

Steven F. Barrett, Ph.D., P.E. received the B.S.in Electronic Engineering Technology from theUniversity of Nebraska at Omaha in 1979, theM.E.E.E. from the University of Idaho at Moscowin 1986, and the Ph.D. from The University ofTexas at Austin in 1993. He was formally an ac-tive duty faculty member at the United States AirForce Academy, Colorado and is now an Asso-ciate Professor of Electrical and Computer Engi-neering, University of Wyoming. He is a memberof IEEE (senior) and Tau Beta Pi (chief faculty ad-visor). His research interests include digital andanalog image processing, computer-assisted lasersurgery, and embedded controller systems. He is aregistered Professional Engineer in Wyoming andColorado. He co-wrote with Dr. Daniel Packseven textbooks on microcontrollers and embeddedsystems. In 2004, Barrett was named “WyomingProfessor of the Year” by the Carnegie Founda-tion for the Advancement of Teaching and in 2008was the recipient of the National Society of Profes-sional Engineers (NSPE) Professional Engineersin Higher Education, Engineering Education Ex-cellence Award. He currently serves as AssociateDean of Academic Programs, College of Engineer-ing and Applied Science, University of Wyoming.

������������� ���� ��������� �������� ��� �

�!�"#�$��������%�������#%&��'!��������&��''#%&����(#"#�%")*����+$#%�,���)�-.�/�--�

�������'�%��#���%�#%��&��$�!�����(�����'�+��%��+�"��#�%�$�!���+#&'��%+���%�"�����)�"�'!�%�%���(������""��+#���#�%�!��"���*���!#���#���"�%���$���$�.�#��#��(��0��%�$)����#&%�+�����%��%"#$$��)�+��)����(�"�$�)�'�'1����2�������1��)�2#����������"�#3#�#����%+�$�"4�(��'�$����#%#%&�#%�!�+�&�&#"�$�������'�%�*����������$#"#�#%&���1'#��#�%��(����%��!"�'#%&��!�"#�$�#�����"�%"��%#%&����$�.���"�%#0�����%+�"�������+#���(���������#%&�"�'!�����!��&��''#%&��+�"��#�%*������������ ����$���!��#����%+���%�$$���#�!'�#��.� %#��+����������3�$��"�+�').��%%�!�$#�.��*��#��"��0����#�%�������!��#��5��%�*�+�����!#�!'�#�5��%�*�+�*������������� ��6'�#$���1'#��#�%������+6!�15"����$#%4*%��*��7��'��,����2��+.��#%&$��"�$�'%.�-/�!��(�%�*����������� �������� �������������'�%�.����%+��+#8#%&�������'�%����+�$�.�������#%&�������"���"�#3#�#��.���3�$�������'�%�����$�.������#�$������������+)���!�����%�����#��#"�$�������'�%�������+�$�&#��.�#3������!!���"��������'!��#%&��+�"��#�%.����#�#�%���!���*�

Jerry C. Hamann, Ph.D. received the B.S. in Elec-trical Engineering with a Bioengineering Optionfrom the University of Wyoming in 1984. He thenworked for the Loveland Instrument Division ofHewlett-Packard before returning to the Universityof Wyoming to complete the M.S. in Electrical En-gineering in 1988. Sharing time as a lecturer andNational Science Foundation Graduate Fellow, hecompleted the Ph.D. in Electrical Engineering atthe University of Wisconsin in 1993. As a fac-ulty member at the University of Wyoming since1993, Jerry has pursued research interests in ap-plied robotics and control, signal processing, andhigher education teaching and learning. He di-rected the University of Wyoming Hewlett Foun-dation Engineering Schools of the West Initiativeuntil 2008, which is focused upon enhancing therecruitment, retention and quality of undergraduateengineering students. He now serves as Head, De-partment of Computer Science.

88 COMPUTERS IN EDUCATION JOURNAL