Abstract— Hardware description language VHDL, Modern industry has created a demand for engineers with knowledge and experience in digital system design; therefore, digital design courses are mandatory in an undergraduate electrical engineering curriculum. However, many university programs are still based on outdated methods and technology and have not properly introduced modern topics such as FPGAs and Hardware description language VHDL. In this paper, a new approach taken to modernize a digital design course by integrating Hardware description language VHDL oriented to digital arithmetic is described. The resulting course provides an improved understanding of digital design and a more effective preparation for more elaborate digital designprojects.
Keywords—Hardware description language; FPGA; digital arithmetic; electrical engineering education
INTRODUCTION
It is well known that digital devices are essential to the modern world. Almost any electronic device used in entertainment, manufacturing, medical, military or telecommunication applications is either partly or completely digital; therefore, Digital Design is a fundamental course in undergraduate electrical engineering curricula. However, in many universities the syllabuses for digital design courses have remained almost the same since the 80’s; lab practices are still based on obsolete technology such as Transistor- Transistor Logic (TTL) chips wired on a breadboard. Modern electronic components such as Field Programmable Gate Arrays (FPGA) or Hardware Description Languages (HDL) such as Very-high-speed-integrated-circuit HDL (VHDL) have not been fully exploited as they should. Even though current course outlines may be adequate for teaching the basic fundamentals of digital electronics, it is inconceivable that they should leave out modern topics which are essential for designing high-performance digital circuits.
There are several educational articles that have stressed the importance of introducing an HDL in undergraduate curricula; there are publications [1]-[3] dating as far as 1993 in which several authors describe their first experiences of using VHDL in digital design and computer architecture courses. These documents have provided invaluable information that has been taken into account in recent investigations although they do not exploit the full potential of the technology. Furthermore, other investigations have restricted the application of VHDL only to combinational circuits [4], to limited-resource devices such as Complex Programmable Logic Devices (CPLD) [5] or simply have lowered the number [6] or complexity [7] of lab practices to a bare minimum, not allowing students to fully develop their capabilities.
In other cases [8]-[9], in order to take full advantage of HDLs and FPGAs, a new course was created to include more advanced VHDL topics and leave the basic theory to a beginners digital design course. Although this may seem to be a good option, it is not always possible to add new courses to an already full engineering curriculum; instead, adjustments should be made in order to bring a course up to date and give it a more practical and useful focus.
The goal of this paper is to describe a successful approach taken to restructure and modernize an undergraduate digital design course by including VHDL topics oriented to digital arithmetic operations in order to enable students to implement digital circuits with greater complexity and broader application. By doing so, students’ achievement level has confirmed an increase deffectiveness in VHDL and digital design training.
DIGITAL DESIGN COURSE
Original Course Description
DDE128 is a digital design course offered annually in the fifth semester of the Automation and Control Department at the Universidad Autónoma de Querétaro (UAQ), Querétaro, México. The course extends over a twenty-one week semester with six hours of class lectures and a two hour laboratory session per week. Course prerequisites are Analog Electronic Circuits and Advanced Computer Programming; these courses give the student the practical implementation skills and the programming logic required for an ideal performance in the digital design course. A description of the topics and lab practices originally covered in the digital design course are listed on Table I.
TABLEI. ORIGINAL COURSE OUTLINE FORDDE128
Lessons
I
Subject
Numbersystems
Content
Binary, hexadecimal, conversions, basic arithmetic
Lab Practice
II
Boolean algebra
Basic operations, logic gates, Boolean equations
III
Boolean algebra
Basic theorems and laws, Boolean manipulation
LAB1 – Combinational circuits
IV
Minimization
Minterms, Karnaugh maps
LAB2 – Algebraic minimization
V
Minimization
Maxterms, Karnaugh maps
LAB3 – Minterm minimization
VI
Combinational circuits
Encoder, decoder, magnitude comparator
LAB4 – Maxterm minimization
VII
Combinational circuits
Adder, substractor, multiplier
LAB5 – Adder & decoder
VIII
Combinational circuits
Multiplexor, demultiplexor
LAB6 – Multiplexor
IX
Sequential circuits
Latches and flip-flops
X
Sequential circuits
Shift registers
LAB7 – Shift register
XI
Sequential circuits
Asynchronous counters
LAB8 – Asynchronous counter
XII
Sequential circuits
Synchronous counters
LAB9 – Synchronous counter
XIII
Sequential circuits
Finite state machines
LAB10 – FSM
XIV
Memories
Memories (ROM, RAM, FLASH)
XV
Programmable logic
PLDs, CPLDs and FPGAs. VHDL dataflow description
SIM1 – Combinational simulation
XVI
Programmable logic
VHDL behavioral description
SIM2 – Sequential simulation
In the original course, a total of 10 lab practice circuits used to be implemented on breadboards using TTL integrated circuits and, towards the end of the course due to time limitations, only two VHDL simulations were carried out by using ALTERA Quartus II/Modelsim software. Although it covered the digital design basics required for the courses of Programmable Logic Controllers (PLC) and Microcontrollers, for elaborate projects or for students with a graduate degree in mind, the course was insufficient and outdated. Lab practices were inefficient and usually caused frustration since building and debugging the final circuit was time consuming. Moreover, once the course was passed, students would never use an FPGA again, even though they are a much better option for motor control projects [10] usually implemented towards the end of their career.
Therefore, since adding a new course was not an option due to curricular restrictions, an adjustment was made in order to modernize the course syllabus with enough VHDL content to allow students to use the FPGA for basic mathematical operations commonly required in complex control designs.
VHDL Hardware Description Language
Currently, VHDL is the most popular HDL used in universities for describing hardware on FPGA devices; this popularity is attributed to the fact that VHDL is a strongly typed, verbose and very deterministic HDL[11].
As its name implies, it is a language used to describe digital hardware on a reconfigurable device; this can be achieved in three different modeling styles, namely dataflow, behavioral and structural [12]. A dataflow style is commonly used to describe combinational circuits as a set of concurrent statements, whereas a behavioral style is most commonly used to describe sequential circuits as a list of statements that are executed sequentially. In the structural style of modeling, a digital circuit is described as a set of interconnected components. Of all three description styles, the behavioral style is usually preferred by students since its structure is very similar to conventional computer programming languages such as Java or C language. However, a structural style is more adequate for more complex designs because it makes them more stable and straightforward[13].
In the new DDE128 course all modeling styles are covered; the dataflow style is oriented to basic combinational circuits while the behavioral style is oriented to sequential circuits. The structural modeling style is used for more complex circuits and final projects.
New Course Outline
The new DDE128 course was first applied in 2011 and went through several adjustments in order to reach a precise balance between digital design content and VHDL language; the main goal being to select the most relevant topics of both contents and fit them in a 21 week semester.
The first lectures are focused on the basics needed for getting started with practical work and getting acquainted with the FPGA development board and the Electronic Design Automation (EDA) tools. The rest of the lectures are directed to combinational and sequential logic designs and lab practices which must be synthesized, simulated and tested on the FPGA development board. A description and order of the topics covered in the new digital design course are listed on Table II.
In order to make space for more VHDL content, the “memories” chapter was moved to a more relevant course (computer fundamentals). In addition, since all lab circuits are now implemented on an FPGA development kit, topics such
as gate minimization and sequential design based on flip-flops were reduced in time.
SuitableBooks
Nowadays, there is an immense source of information at anyone’s disposal concerning digital design and VHDL topics through the internet, although this sometimes may be counterproductive since it may not be clear to students where to begin.
In order to provide a good starting point for investigation, the most suitable textbooks had to be made available in the school library; a large number of textbooks was evaluated by professors and by students and, in order to suit the digital design course, the books needed to be well-organized, locally- available, low-cost, didactic, recent editions and should cover digital design and VHDL topics with code examples. Since they were not intended to be used in an advanced HDL course, they only needed to have the basics necessary for implementing a logic design in VHDL language. In addition, it was desirable that the books cover dataflow, behavioral and structural modeling styles as well as digital arithmetic.
The books that best suited the selection criteria were mainly two, for which a brief review is provided.
Reviewof“Electrónicadigitalylógicaprogramable”
by R. J. Romero Troncoso [13].
This book was the first choice as it covers all of the digital design content and it provides examples for each topic in VHDL in all modeling styles. It is printed in Mexico so it is locally available and is affordable. In addition, it includes a chapter on digital arithmetic and fixed-point operations and, at the end, it provides several project examples in VHDL with a structural modeling style; this is very desirable since it perfectly suits the main goal of the digital design course.
Review of “Sistemas digitales, principios y aplicaciones” by R. J. Tocci, N. S. Widmer and G. L. Moss [14].
This book was selected as a second choice since it also covers all the digital design content of the course and it provides examples of VHDL in all modeling styles. Since it is a translation of an American book, it is more expensive than the aforementioned; however, it is didactic, self-explanatory and, considered the best book by several students, it was decided to be a good acquisition for the library.
FPGA DevelopmentBoard
In order to get rid of all TTL components and breadboards needed for digital design circuits, it was necessary to choose an FPGA development board powerful enough not only for lab practices and course projects, but also for dissertationprojects.
Two are the main manufacturers of FPGA development boards, namely, ALTERA and XILINX; both have a solid reputation in the industry and provide fully-didactic products that could easily be used in a digital design course. Since it is a tool to be used mainly by students, the selection was left to them to make by comparing between a Spartan 3E from Xilinx and a DE2 Cyclone II from Altera. Several applications involving digital arithmetic were implemented and the board of preference resulted in the DE2 development and education board shown in Fig.1.
Even though the DE2 board is more expensive than the 3E board, the two main reasons students had for selecting the Altera board were the hardware and the documentation; the board has a powerful FPGA (Cyclone II with 35,000 logic elements) and a wide selection of hardware. The board includes toggle switches, push buttons, 7-segment displays, LED indicators, one LCD panel and several different kinds of input/output ports that can easily be used in any lab practice or
project. Moreover, all the documentation necessary for using the board can be found in a single user’s guide on a DVD included in the development kit box. There is no need to go online in search of the required documents or to download the EDA software; it is all there in a single package.
Students felt much more comfortable working with the Altera FPGA, especially when implementing arithmetic operations such as a square root or a division, since the board has enough toggle switches to enter an 18-bit binary value and observe a 26-bit result directly on the LED indicators.
Concerning the EDA software, Quartus II (Web edition) is used for Altera boards, whereas the ISE (WebPACK) software is used for Xilinx boards. Both software packages are free and can be downloaded directly from the internet or received in DVD format; both performed satisfactorily during the trial phase, therefore the software was not considered part of the selection criteria.
EvaluationMethodology
The DDE128 digital design course follows an Education Based on Competencies (EBC) methodology [15]; in other words, students are evaluated not only by what they know, but also by their abilities and the values demonstrated during the course. Thus, final grade is distributed as written exam (45%), participation (5%), homework & research (15%), lab practice (25%) and values (5%).
Lab practice sessions are only two hours long and it is not enough time for writing code, debugging, simulating, synthesizing, programming the board and testing; therefore, lab session is only used for presenting the final circuit. The rest of the process, from writing the code to synthesizing is assigned as homework. For this reason, students give a great deal of importance to lab practice because it actually counts as 45% of the final grade (participation+homework+lab practice). Following this methodology has proven beneficial since it gives enough time for professors to evaluate all circuits and for students to complete all assigned labpractices.
The final project is optional since there is not always enough time to implement the circuit due to its greater
complexity; the written examination is not required for those who successfully implement the project.
Lab PracticeDescription
It is in the laboratory sessions that students gain practical competency by putting into practice lessons learned in the classroom. In order to develop team skills, students work in pairs and, at the end of the session, either team member should be able to answer any question regarding thelab.
The VHDL code written to describe the circuits use the “numeric_std” library since arithmetic operations are implemented more easily this way. In addition, VHDL 2008 is used instead of VHDL 1993, as new features were added and some existing features were enhanced; a specific feature is entity instantiation which allows a more compact code in structural style designs by eliminating the need of including component declarations in the main module [16].
The following is an outline of the 10 lab practices implemented during the digital design course.
Lab1. Implementation of a small combinational circuit made up of 10 different logic gates and comparison of the truth table results to hand-calculated outputs. Inputs are entered using the toggle switches and outputs are viewed on the LED indicators. Dataflow style is used in thecode.
Lab2. Minimization of a Boolean equation using minterms and Karnaugh maps. The original and minimized equations are both implemented on the board to prove they are equivalent. Inputs are entered using the toggle switches and outputs are viewed on the LEDs. Dataflow style is used in thecode.
Lab3. Minimization of a Boolean equation using maxterms and Karnaugh maps. The original and minimized equations are both implemented on the board to prove they are equivalent. Inputs are entered using the toggle switches and outputs are viewed on the LEDs. Dataflow style is used in thecode.
Lab4. Implementation of a circuit which includes a 4 to 1 multiplexor, a decoder and a 1 to 4 demultiplexor; four BCD numbers entered on the toggle switches must be displayed on four 7-segment displays by using a single BCD to 7-segment decoder. A behavioral style is used in thecode.
Lab5. Implementation of a circuit that can execute arithmetic operations (+, -, x) of two 8-bit numbers; on the output there are “D” flip-flops that send the result to the LED indicators when a clock pulse is entered on a push-button. A behavioral style is used in thecode.
Lab6. Implementation of a 16-bit universal shift register which can load data serially or in parallel and shift left or right. Data is loaded using the toggle switches and the register content is displayed on the LED indicators. A behavioral and structural style is used in thecode.
Lab7. Implementation of a unipolar stepper motor controller which uses toggle switches for selecting the speed (high or low), the direction (clockwise or counter clockwise) or the number of turns (free or 0-99). The motor is connected to the DE2 board through an array of NPN transistors wired to the board expansion header. A behavioral and structural style is used in the code.
Lab8. Implementation of an FSM that controls a snack dispenser that allows three different coins. Coin entry is simulated by pressing three different push-buttons on the board. On the expansion header, there are two small solenoid valves which receive pulses from the board; one pushes the product while the other releases coins to give change. A behavioral and structural style is used in thecode.
Lab9. Implementation of a Multiply Accumulate (MAC) unit which takes two 8-bit numbers entered on the toggle switches and executes the MAC process as many times as specified. The MAC unit is controlled by an FSM and a binary counter. Once the process is ended, the result is displayed on the LED indicators. A behavioral and structural style is used in thecode.
Lab10. In this lab students use a modified MAC unit to implement a polynomial approximator that calculates a given function. The polynomial coefficients required are generated in MATLAB by means of the curve fitting tool (cftool) and placed in a look-up table. Once the calculation has ended, the result is displayed on the LED indicators. A behavioral and structural style is used in thecode.
FinalProjects
At the end of the course there are several optional projects from which students can pick; they have four weeks until the end of the semester to research the topics and present the final circuit.
The final project is intended for the application of digital
arithmetic and a behavioral/structural modeling style in circuits which may be used in future control projects. Digital circuits that have been implemented successfully are as follows:
FIR filter. A fourth-order low pass FIR filter composed of an FSM-controlled MAC unit is implemented on the DE2 board. By means of an external digital acquisition board, a sine-wave signal is fed to the DE2 board, filtered and converted back to analog to be displayed on an oscilloscope. The required filter coefficients are generated in MATLAB.
Fixed-point square root or division. A 16-bit fixed- point number is input using the toggle switches on the DE2 board; the square root or division is calculated by using a non-restoring method [17] and the result is displayed on the LEDindicators.
CORDIC algorithm: a 16-bit fixed-point number is input using the toggle switches on the DE2 board. A 10-level CORDIC calculator [18] made up of adders, substractors and shift registers, is used for calculating different mathematical operations and displays the result on the LEDindicators.
Basic digital voltmeter: an external serial A/D converter is wired to a DE2 board expansion header. An external voltage signal is converted and transferred serially (SPI protocol) to the board and the voltage value is displayed on the LCD panel. The entire process is controlled by anFSM.
Results and StudentFeedback
The new course outline has been used in digital design courses since 2011 and despite initial resistance to change to this new approach, students adapted quickly to work entirely on the development board.
There was no significant rise in grades; however this was never the goal of the course restructure as grades were already above average. Nonetheless, there was a noticeable change in
I enjoyed writing code in VHDL
3
5
22
36
34
I was able to learn digital design basics adequately by using VHDL
2
3
22
73
Learning VHDL was difficult
15
2
38
45
I would like to take an advanced VHDL course
15
30
1
30
24
The time assigned to lab practice was sufficient
4
2
5
21
68
I was able to implement all lab practices
5
10
3
24
58
The development board was adequate for all lab practices
1
4
12
83
I would prefer elaborating circuits on a breadboard
68
18
10
1
3
I like the idea that the final project is optional
9
1
5
20
65
VHDL and FPGAs have direct application to my career
8
4
8
10
70
participation since, even though the final project is optional, more than 75% of the students have preferred the project over the written exam, when previously participation in projects was less than 50%. In advanced semesters, students have started to use FPGA devices in more complex projects such as motor controllers and imageprocessing.
In order to have a quantifiable result of the course, anonymous surveys have been handed out to students and the results for two 30-student groups are presented on Table III.
In addition, when initially it was believed that 15 development boards might not be enough for the entire group, only 10 have been required on average; students can borrow the board only until the VHDL code has been verified on the simulator and the input and output hardware has been assigned to the FPGA pins. The usage of the board is usually less than 10 minutes per team.
It is also worth mentioning that there was a great response in doing lab practice for homework. With this new methodology, around 75% of the students usually require only one of the two-hour lab sessions. The rest of the students have to make minor corrections to the code but 2 hours have proven to be enough for the entire group to present lab results.
CONCLUSIONS
This paper describes the experience of integrating VHDL and digital arithmetic topics into an undergraduate course of digital design. Lab practice circuits changed from classic TTL- wired breadboards to full digital designs implemented completely on an FPGA-based development board. Feedback surveys show that the introduction of VHDL into the course was positively accepted by students resulting in an improved understanding of digital design, an increased level of practical achievement and a more effective preparation for major digital design projects.
ACKNOWLEDGMENT
The authors would like to thank CONACyT (Mexico) for grant 209261. In addition, thank you to the Universidad Autónoma de Querétaro and the Universidad Politécnica de Guanajuato for their invaluable support and facilities. Also, special thanks to ALTERA and XILINX for their kind donation of the FPGA development boards used in the trial phase described in this document.
REFERENCES
J.R. Armstrong and F.G. Gray, “Teaching VHDL at the undergraduate and graduate levels,” in Proc. VIUF Conference VHDL Boot Camp, San Jose, CA, pp. 213-216, October1993.
P.J. Ashenden, “Teaching computer architecture using VHDL,” in Proc. VIUF Conference VHDL Boot Camp, San Jose, CA, pp. 203-211, October1993.
P. Walsh, “Integrating VHDL into a first course in logic design,” in Proc. IEEE Canadian Conference on Electrical and Computer Engineering, Edmonton, Alberta, vol. 3, pp. 1531-1534, May1999.
A. Madanayake, C. Wijenayake, R.M. Joshi, J. Grover, J. Carletta, J. Adams, T. Hartley and T. Ogunfunmi, “Teaching freshmen VHDL- based digital design,” in Proc. 2012 IEEE Int. Symp. on Circuits and Systems, Akron, Ohio, pp. 2701-2704, May2012.
H.Z. Abidin, M. Kassim, K.A. Othman and M. Samad, “Incorporating VHDL in teaching combinational logic circuit,” 2ndInt. Cong. Eng. Educ., Kuala Lumpur, Malaysia, pp. 225-228, December2010.
J. Torresen, J. Norendal and K. Glette, “Establishing a new course in reconfigurable logic system design,” IEEE Design and Diagnostics of Electronic Circuits and Systems Conference, Oslo, Norway, pp. 1-4, April2007.
S. Areibi, “A first course in digital design using VHDL and programmable logic,” 31stAnnual ASEE/IEEE Frontiers in Education Conference, Reno, Nevada, vol. 1, pp. 19-23, October2001.
G.W. Greenwood, “Teaching hardware description languages to satisfy industry expectations,” Int. J. Elect. Enging. Educ., vol. 46, pp. 239-247, July2009.
F. Machado, S. Borromeo and N. Malpica, “Project based learning experience in VHDL digital electronic circuit design,” IEEE Int. Conf. on Microelectronic Systems Education, Madrid, Spain, pp. 49-52, July 2009.
P. Poure, F. Aubépart and F. Braun, “A design methodology for hardware prototyping of integrated AC drive control: application to direct toque control of an induction machine,” in Proc. of 11thInt. Workshop on Rapid System Prototyping, Paris, France, pp. 90-95, June 2000.
D.J. Smith, HDL chip design: a practical guide for designing, synthesizing and simulating ASICs and FPGAs using VHDL or Verilog. Madison, AL: Doone Publications,1998.
J. Bhasker, A VHDL primer. Upper Saddle River, NJ: Prentice Hall, 1999.
R.J. Romero-Troncoso, Electrónica digital y lógica programable. Guanajuato, Gto: Universidad de Guanajuato,2007.
R.J. Tocci, N.S. Widmer and G.L. Moss, Sistemas digitales, principios y aplicaciones, 10 ed. Naucalpan de Juarez, Edo. de Mexico: Pearson Educación,2007.
K. Rezgui, H. Mhiri and K. Ghedira, “Competency models: A review of initiatives,” 12thIEEE Int. Conf. on Advanced Learning Technologies, Tunis, Tunisia, pp. 141-142, July2012.
P.J. Ashenden and J. Lewis, VHDL-2008: Just the new stuff. Burlington, MA: Morgan Kaufmann Publishers,2008.
S. Samavi, A. Sadrabadi and A. Fanian, “Modular array structure for non-restoring square root circuit,” Journal of Systems Architecture, vol. 54, pp. 957-966, April2008.
S. Lachowicz and H.J. Pfleiderer, “Fast evaluation of the square root and other nonlinear functions in FPGA,” 4thIEEE Int. Symp. Electronic Design, Test & Applications, Hong Kong, pp. 474-477, January2008.
Post a Comment