Newnes Digital Systems Design With FPGAs And CPLDs Mar 2008 ISBN 075068397X pdf

  Digital Systems Design with

FPGAs and CPLDs This page intentionally left blank

  Digital Systems Design with FPGAs and CPLDs Ian Grout

  AMSTERDAM • BOSTON • HEIDELBERG • LONDON NEW YORK • OXFORD • PARIS • SAN DIEGO SAN FRANCISCO • SINGAPORE • SYDNEY • TOKYO Newnes is an imprint of Elsevier Newnes is an imprint of Elsevier

  30 Corporate Drive, Suite 400, Burlington, MA 01803, USA Linacre House, Jordan Hill, Oxford OX2 8DP, UK Copyright 2008, Elsevier Ltd. All rights reserved.

Material in Chapter 6 is reprinted, with permission, from IEEE Std 1076–2002 for VHDL Language Reference Manual, by IEEE.

The IEEE disclaims any responsibility or liability resulting from placement and use in the manner described.

MATLAB and Simulink are trademarks of The MathWorks, Inc. and are used with permission. The MathWorks does not

warrant the accuracy of the text or exercises in this book. This book’s use or discussion of MATLAB and Simulink

software or related products does not constitute endorsement or sponsorship by The MathWorks of a particular pedagogical

approach or particular use of the MATLAB and Simulink software.

Figures based on or adapted from figures and text owned by Xilinx, Inc., courtesy of Xilinx, Inc. Copyright Xilinx, Inc.,

1995–2005. All rights reserved. Microsoft product screen shot(s) reprinted with permission from Microsoft Corporation.

No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means,

electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of the publisher. Permissions may be sought directly from Elsevier’s Science & Technology Rights Department in Oxford, UK:

phone: ( þ44) 1865 843830, fax: (þ44) 1865 853333, E-mail: permissions@elsevier.com. You may also complete your request

online via the Elsevier homepage (http://elsevier.com), by selecting ‘‘Support & Contact’’ then ‘‘Copyright and Permission’’

and then ‘‘Obtaining Permissions.’’

Recognizing the importance of preserving what has been written, Elsevier prints its books on acid-free paper whenever possible.

Library of Congress Cataloging-in-Publication Data Grout, Ian.

  Digital systems design with FPGAs and CPLDs / Ian Grout. p. cm. Includes bibliographical references and index.

  ISBN-13: 978-0-7506-8397-5 (alk. paper) 1. Digital electronics.

  2. Digital circuits — Design and construction.

3. Field programmable gate arrays.

  4. Programmable logic devices.

  I. Title. TK7868.D5.G76 2008 621.381—dc22

  2007044907 British Library Cataloguing-in-Publication Data A catalogue record for this book is available from the British Library. For information on all Newnes publications visit our Web site at www.books.elsevier.com Printed in the United States of America

  08

  09

  10

  11

  12

  13

  10

  9

  8

  7

  6

  5

  4

  3

  2

  1 Working together to grow libraries in developing countries www.elsevier.com | www.bookaid.org | www.sabre.org To my family, but especially to my parents and to Jane .

  This page intentionally left blank

  Table of Contents

Preface .....................................................................................................xvii

Abbreviations ...........................................................................................xxiii

Chapter 1: Introduction to Programmable Logic ............................................... 1

  1.1 Introduction to the Book ............................................................................1

  1.2 Electronic Circuits: Analogue and Digital ................................................10

  1.2.1 Introduction ....................................................................................10

  1.2.2 Continuous Time versus Discrete Time...........................................10

  1.2.3 Analogue versus Digital ..................................................................12

  1.3 History of Digital Logic ............................................................................14

  1.4 Programmable Logic versus Discrete Logic ..............................................17

  1.5 Programmable Logic versus Processors ....................................................21

  1.6 Types of Programmable Logic ..................................................................24

  1.6.1 Simple Programmable Logic Device (SPLD) ..................................24

  1.6.2 Complex Programmable Logic Device (CPLD) ..............................27

  1.6.3 Field Programmable Gate Array (FPGA).......................................28

  1.7 PLD Configuration Technologies .............................................................29

  1.8 Programmable Logic Vendors...................................................................32

  1.9 Programmable Logic Design Methods and Tools.....................................33

  1.9.1 Introduction ....................................................................................33

  1.9.2 Typical PLD Design Flow...............................................................35

  1.10 Technology Trends ....................................................................................36 References .................................................................................................38 Student Exercises ......................................................................................40

  

Chapter 2: Electronic Systems Design ........................................................... 43

  2.1 Introduction ..............................................................................................43

  2.2 Sequential Product Development Process versus Concurrent Engineering Process...................................................................................52

  2.2.1 Introduction ....................................................................................52

  2.22 Intellectual Property ................................................................................ 115

  2.15 System Reset............................................................................................ 102

  2.16 System Clock ........................................................................................... 105

  2.17 Power Supplies ........................................................................................ 107

  2.18 Power Management................................................................................. 109

  2.19 Printed Circuit Boards and Multichip Modules ...................................... 110

  2.20 System on a Chip and System in a Package............................................ 112

  2.21 Mechatronic Systems............................................................................... 113

  2.23 CE and FCC Markings ........................................................................... 116 References................................................................................................ 118 Student Exercises ..................................................................................... 121

  2.14.2 Parallel I/O ....................................................................................95

  

Chapter 3: PCB Design ............................................................................. 123

  3.1 Introduction ............................................................................................ 123

  3.2 What Is a PCB? ....................................................................................... 125

  3.2.1 Definition ...................................................................................... 125

  3.2.2 Structure of the PCB ..................................................................... 127

  3.2.3 Typical Components...................................................................... 139

  3.3 Design, Manufacture, and Testing .......................................................... 144

  2.14.3 Serial I/O .......................................................................................97

  2.14.1 Introduction...................................................................................89

  2.2.2 Sequential Product Development Process .......................................53

  2.9 Electronic System-Level Design ................................................................67

  2.2.3 Concurrent Engineering Process......................................................54

  2.3 Flowcharts.................................................................................................56

  2.4 Block Diagrams.........................................................................................58

  2.5 Gajski-Kuhn Chart ...................................................................................61

  2.6 Hardware-Software Co-Design .................................................................62

  2.7 Formal Verification...................................................................................65

  2.8 Embedded Systems and Real-Time Operating Systems ............................66

  2.10 Creating a Design Specification.................................................................68

  2.14 Parallel and Serial Interfacing ...................................................................89

  2.11 Unified Modeling Language......................................................................70

  2.12 Reading a Component Data Sheet ............................................................72

  2.13 Digital Input/Output .................................................................................75

  2.13.1 Introduction...................................................................................75

  2.13.2 Logic-Level Definitions .................................................................79

  2.13.3 Noise Margin.................................................................................81

  2.13.4 Interfacing Logic Families .............................................................83

  3.3.1 PCB Design ................................................................................... 144 viii Table of Contents

  Table of Contents ix

  3.3.2 PCB Manufacture.......................................................................... 150

  3.3.3 PCB Testing................................................................................... 151

  3.4 Environmental Issues .............................................................................. 152

  3.4.1 Introduction .................................................................................. 152

  3.4.2 WEEE Directive ............................................................................ 153

  3.4.3 RoHS Directive ............................................................................. 153

  3.4.4 Lead-Free Solder ........................................................................... 154

  3.4.5 Electromagnetic Compatibility ...................................................... 154

  3.5 Case Study PCB Designs......................................................................... 155

  3.5.1 Introduction .................................................................................. 155

  3.5.2 System Overview ........................................................................... 157

  3.5.3 CPLD Development Board ........................................................... 158

  3.5.4 LCD and Hex Keypad Board ....................................................... 160

  3.5.5 PC Interface Board........................................................................ 163

  3.5.6 Digital I/O Board .......................................................................... 166

  3.5.7 Analogue I/O Board...................................................................... 168

  3.6 Technology Trends.................................................................................. 171 References ............................................................................................... 173 Student Exercises .................................................................................... 175

  

Chapter 4: Design Languages..................................................................... 177

  4.1 Introduction ............................................................................................ 177

  4.2 Software Programming Languages ......................................................... 177

  4.2.1 Introduction .................................................................................. 177

  4.2.2 C .................................................................................................... 179

  4.2.3 C þþ .............................................................................................. 181

  TM

  4.2.4 JAVA ........................................................................................ 183

  TM

  4.2.5 Visual Basic ............................................................................... 186

  4.2.6 Scripting Languages ...................................................................... 189

  4.2.7 PHP ............................................................................................... 191

  4.3 Hardware Description Languages ........................................................... 193

  4.3.1 Introduction .................................................................................. 193

  4.3.2 VHDL ........................................................................................... 194

  4.3.3 Verilog -HDL ............................................................................... 196

  4.3.4 Verilog -A..................................................................................... 199

  4.3.5 VHDL-AMS.................................................................................. 202

  4.3.6 Verilog -AMS ............................................................................... 205

  4.4 SPICE...................................................................................................... 205

  4.5 SystemC ................................................................................................ 208

  4.6 SystemVerilog.......................................................................................... 209

  4.7 Mathematical Modeling Tools ................................................................ 210 References ............................................................................................... 214 Student Exercises ..................................................................................... 216

  x Table of Contents

  

Chapter 5: Introduction to Digital Logic Design ........................................... 217

  5.1 Introduction ............................................................................................ 217

  5.2 Number Systems...................................................................................... 222

  5.2.1 Introduction .................................................................................. 222

  5.2.2 Decimal–Unsigned Binary Conversion.......................................... 224

  5.2.3 Signed Binary Numbers................................................................. 226

  5.2.4 Gray Code ..................................................................................... 231

  5.2.5 Binary Coded Decimal .................................................................. 232

  5.2.6 Octal-Binary Conversion ............................................................... 233

  5.2.7 Hexadecimal-Binary Conversion ................................................... 235

  5.3 Binary Data Manipulation ...................................................................... 240

  5.3.1 Introduction .................................................................................. 240

  5.3.2 Logical Operations ........................................................................ 241

  5.3.3 Boolean Algebra ............................................................................ 242

  5.3.4 Combinational Logic Gates .......................................................... 246

  5.3.5 Truth Tables .................................................................................. 248

  5.4 Combinational Logic Design .................................................................. 256

  5.4.1 Introduction .................................................................................. 256

  5.4.2 NAND and NOR logic ................................................................. 269

  5.4.3 Karnaugh Maps ............................................................................ 271

  5.4.4 Don’t Care Conditions................................................................... 277

  5.5 Sequential Logic Design.......................................................................... 277

  5.5.1 Introduction .................................................................................. 277

  5.5.2 Level Sensitive Latches and Edge-Triggered Flip-Flops ...................................................................................... 282

  5.5.3 The D Latch and D-Type Flip-Flop ............................................. 283

  5.5.4 Counter Design.............................................................................. 288

  5.5.5 State Machine Design.................................................................... 305

  5.5.6 Moore versus Mealy State Machines ............................................ 316

  5.5.7 Shift Registers................................................................................ 317

  5.5.8 Digital Scan Path........................................................................... 319

  5.6 Memory................................................................................................... 322

  5.6.1 Introduction .................................................................................. 322

  5.6.2 Random Access Memory .............................................................. 324

  5.6.3 Read-Only Memory....................................................................... 325 References................................................................................................ 327 Student Exercises ..................................................................................... 328

  

Chapter 6: Introduction to Digital Logic Design with VHDL .......................... 333

  6.1 Introduction ............................................................................................ 333

  6.2 Designing with HDLs ............................................................................. 334

  Table of Contents xi

  6.3 Design Entry Methods ............................................................................ 338

  6.3.1 Introduction .................................................................................. 338

  6.3.2 Schematic Capture......................................................................... 338

  6.3.3 HDL Design Entry ........................................................................ 339

  6.4 Logic Synthesis........................................................................................ 341

  6.5 Entities, Architectures, Packages, and Configurations............................ 344

  6.5.1 Introduction .................................................................................. 344

  6.5.2 AND Gate Example ...................................................................... 346

  6.5.3 Commenting the Code................................................................... 353

  6.6 A First Design ......................................................................................... 355

  6.6.1 Introduction .................................................................................. 355

  6.6.2 Dataflow Description Example ..................................................... 356

  6.6.3 Behavioral Description Example ................................................... 357

  6.6.4 Structural Description Example .................................................... 359

  6.7 Signals versus Variables .......................................................................... 366

  6.7.1 Introduction .................................................................................. 366

  6.7.2 Example: Architecture with Internal Signals ................................. 368

  6.7.3 Example: Architecture with Internal Variables ............................. 372

  6.8 Generics................................................................................................... 374

  6.9 Reserved Words ...................................................................................... 380

  6.10 Data Types .............................................................................................. 380

  6.11 Concurrent versus Sequential Statements................................................ 383

  6.12 Loops and Program Control ................................................................... 383

  6.13 Coding Styles for VHDL......................................................................... 385

  6.14 Combinational Logic Design................................................................... 387

  6.14.1 Introduction................................................................................. 387

  6.14.2 Complex Logic Gates .................................................................. 388

  6.14.3 One-Bit Half-Adder ..................................................................... 388

  6.14.4 Four-to-One Multiplexer ............................................................. 389

  6.14.5 Thermometer-to-Binary Encoder................................................. 397

  6.14.6 Seven-Segment Display Driver .................................................... 398

  6.14.7 Tristate Buffer ............................................................................. 409

  6.15 Sequential Logic Design .......................................................................... 414

  6.15.1 Introduction................................................................................. 414

  6.15.2 Latches and Flip-Flops................................................................ 416

  6.15.3 Counter Design............................................................................ 422

  6.15.4 State Machine Design.................................................................. 426

  6.16 Memories................................................................................................. 440

  6.16.1 Introduction................................................................................. 440

  6.16.2 Random Access Memory............................................................. 441

  6.16.3 Read-Only Memory..................................................................... 444

  6.17 Unsigned versus Signed Arithmetic ......................................................... 447

  6.17.1 Introduction................................................................................. 447

  xii Table of Contents

  6.17.2 Adder Example............................................................................ 448

  6.17.3 Multiplier Example...................................................................... 449

  6.18 Testing the Design: The VHDL Test Bench............................................ 453

  6.19 File I/O for Test Bench Development ..................................................... 459 References................................................................................................ 471 Student Exercises..................................................................................... 472

  

Chapter 7: Introduction to Digital Signal Processing ..................................... 475

  7.1 Introduction ............................................................................................ 475

  7.2 Z-Transform............................................................................................ 496

  7.3 Digital Control ........................................................................................ 509

  7.4 Digital Filtering....................................................................................... 524

  7.4.1 Introduction .................................................................................. 524

  7.4.2 Infinite Impulse Response Filters .................................................. 532

  7.4.3 Finite Impulse Response Filters .................................................... 534 References................................................................................................ 535 Student Exercises..................................................................................... 536

  Chapter 8: Interfacing Digital Logic to the Real World: A/D Conversion, D/A Conversion, and Power Electronics ...................................................... 537

  8.1 Introduction ............................................................................................ 537

  8.2 Digital-to-Analogue Conversion ............................................................. 543

  8.2.1 Introduction .................................................................................. 543

  8.2.2 DAC Characteristics...................................................................... 548

  8.2.3 Types of DAC ............................................................................... 555

  8.2.4 DAC Control Example.................................................................. 559

  8.3 Analogue-to-Digital Conversion ............................................................. 565

  8.3.1 Introduction .................................................................................. 565

  8.3.2 ADC Characteristics...................................................................... 568

  8.3.3 Types of ADC ............................................................................... 572

  8.3.4 Aliasing.......................................................................................... 577

  8.4 Power Electronics .................................................................................... 580

  8.4.1 Introduction .................................................................................. 580

  8.4.2 Diodes ........................................................................................... 581

  8.4.3 Power Transistors.......................................................................... 585

  8.4.4 Thyristors ...................................................................................... 593

  8.4.5 Gate Turn-Off Thyristors .............................................................. 603

  8.4.6 Asymmetric Thyristors .................................................................. 604

  8.4.7 Triacs ............................................................................................. 604

  8.5 Heat Dissipation and Heatsinks.............................................................. 606

  8.6 Operational Amplifier Circuits................................................................ 610

  Table of Contents xiii References................................................................................................ 612 Student Exercises..................................................................................... 613

  

Chapter 9: Testing the Electronic System .................................................... 615

  9.1 Introduction ............................................................................................ 615

  9.2 Integrated Circuit Testing ....................................................................... 621

  9.2.1 Introduction .................................................................................. 621

  9.2.2 Digital IC Testing.......................................................................... 624

  9.2.3 Analogue IC Testing ..................................................................... 629

  9.2.4 Mixed-Signal IC Testing................................................................ 633

  9.3 Printed Circuit Board Testing ................................................................. 633

  9.4 Boundary Scan Testing ........................................................................... 636

  9.5 Software Testing...................................................................................... 642 References................................................................................................ 645 Student Exercises..................................................................................... 646

  

Chapter 10: System-Level Design ............................................................... 647

  10.1 Introduction ............................................................................................ 647

  10.2 Electronic System-Level Design .............................................................. 654

  10.3 Case Study 1: DC Motor Control ........................................................... 661

  10.3.1 Introduction................................................................................. 661

  10.3.2 Motor Control System Overview................................................. 662

  10.3.3 MATLAB /Simulink Model Creation and Simulation ............................................................................ 665

  10.3.4 Translating the Design to VHDL ................................................ 666

  10.3.5 Concluding Remarks ................................................................... 674

  10.4 Case Study 2: Digital Filter Design......................................................... 686

  10.4.1 Introduction................................................................................. 686

  10.4.2 Filter Overview ............................................................................ 688

  10.4.3 MATLAB /Simulink Model Creation and Simulation ............................................................................ 690

  10.4.4 Translating the Design to VHDL ................................................ 692

  10.4.5 Concluding Remarks ................................................................... 698

  10.5 Automating the Translation .................................................................... 702

  10.6 Future Directions .................................................................................... 703 References .................................................................................................. 704 Student Exercises ..................................................................................... 705

  

Additional References ............................................................................... 707

Index ...................................................................................................... 717

  This page intentionally left blank system

  • noun 1 A set of things working together as parts of a mechanism or an interconnecting network.

  Oxford Dictionary of English This page intentionally left blank

  Preface In days gone by, life for the electronic circuit designer seems to have been easier.

  Designs were smaller, ran at a slower speed, and could easily fit onto a single small printed circuit board. An individual designer could work on a problem and designs could be specified and developed using paper and pen only. The circuit schematic diagrams that were required could be rapidly drawn on the back of an envelope.

  Struck by the success of the early circuit designs, customers started to ask for smaller, faster, and more complex circuits—and at a lower cost. The designers started to work on solving such problems, which has led to the rapidly expanding electronics industry that we have today. Driven by the demand from the customer, new materials and fabrication processes have been developed, new circuit design methodologies and design architectures have taken over many of the early traditional design approaches, and new markets for the circuits have evolved. So how is the design problem tackled today? This is not an easy question to answer, and there is more than one way to develop an electronic circuit solution to any given problem. However, the design process is no longer the activity of a single individual. Rather, a team of engineers is involved in the key engineering activities of design, fabrication (manufacture), and test. All activities now involve the extensive use of computing resources, requiring the efficient use of software tools to aid design (electronic design automation, EDA and computer aided design, CAD), fabrication (Computer Aided Manufacture, CAM), and test (Computer Aided Test, CAT). The circuit is no longer a unique and isolated entity. Rather, it is part of a larger system. Increasingly, much of the design work is undertaken at the system level . . . at a suitably high level of design abstraction required to reduce design time and increase the designer efficiency. However, when it comes to the design detail, the correctly specified system must also work at the basic electric voltage and current level. How to go from an xviii Preface effective system-level specification to an efficient and working circuit implementation requires the skills of good designers who are aided by good design tools. For the electronic circuit designer at an early stage in the design process, whether to implement the required circuit functionality using analogue circuit techniques or digital circuit techniques must be decided. However, sometimes the choice will have already been made, and increasingly a digital solution is the preferred choice. The wide use of digital signal processing (DSP) techniques facilitates complex operations that can provide superior performance to an analogue circuit equivalent; indeed some cannot be performed in analogue. Traditionally, DSP functions have been implemented using software programs written to operate on a target processor. The microprocessor (mP), microcontroller (mC), and digital signal processor provide the necessary digital circuits, in integrated circuit (IC) form, to implement the required functions. In fact, these processors are to be found in many everyday embedded electronics that we take for granted. This book could not have been written without the aid of an electronic system incorporating a microprocessor running a software operating system that in turn runs the word processor software. Increasingly, the functions that have been traditionally implemented in software running on a processor-based digital system in the DSP world and many control applications are being evaluated in terms of performance that can be achieved in software. In many cases, the software solution will be slower than is desired, and the basic nature of the software programmed system means that this speed limitation cannot be overcome. The way to overcome the speed limitation is to perform the required operations in hardware designed for a particular application. However, custom hardware solutions will be expensive to acquire. If there were a way to obtain the power of programmability with the power of hardware speed, then this would be provide a significant way forward. Fortunately, programmable logic provides the power of programmability with the power of hardware speed by providing an IC with built-in digital electronic circuitry that is configured by the user for a particular application. Many devices can be reconfigured for different applications. Today, two main types of programmable logic

  ICs are commonly used: the field programmable gate array (FPGA) and complex programmable logic device (CPLD). Therefore, it is possible to implement a complex digital system that can be developed and the functionality changed or enhanced using either a processor running a software program or programmable logic with a specific hardware configuration.

  Preface xix For an end-user, the functionality of both types of system will be the same—the design details are irrelevant to the end-user as long as the functionality of the unit is correct. In this book, to provide consistency and to differentiate between the processor and programmable logic, the following terminology will be used:

  A processor (microprocessor, mP; microcontroller, mC; or digital signal

  • processor, DSP) will be programmed for a particular application using a software programming language (SPL). Programmable logic (field programmable gate array, FPGA; simple
  • programmable logic device, SPLD; or complex programmable logic device, CPLD) will be configured using a hardware description language (HDL).

  The aim of this book is to provide a reference source with worked examples in the area of electronic circuit design using programmable logic. In particular, field programmable gate arrays and complex programmable logic devices will be presented and examples of such devices provided.

  The choice whether to use a software-programmed processor or hardware-configured programmable logic device is not a simple one, and many decisions figure into evaluating the pros and cons of a particular implementation prior to making a final decision. This book will provide an insight into the design capabilities and aspects relating to the design decisions for programmable logic so that an informed decision can be made. The book is structured as follows:

  Chapter 1 will introduce the types of programmable logic device that are available today, their differing architectures, and their use within electronic system design. Additionally, the terminology used in this area will be presented with the aim of demystifying the jargon that has evolved. Chapter 2 will provide a background into the area of electronic systems design, the types of solutions that may be developed, and the decisions that will need to be made in order to identify the right technology choice for the design implementation. Typical design flows will be introduced and discussed for the different technologies.

  Chapter 3 will introduce the design of printed circuit boards (PCBs). These provide the mechanical and electrical base onto which the electronic components will be mounted. The correct design of the PCB is essential to ensure that the electronic circuit can be realized (implemented) to operate to the correct specification (power supply voltage, thermal [heat] dissipation, digital clock frequency, analogue and digital circuit elements, etc.) and to xx Preface ensure that the different electronic circuit components interact with each other correctly and do not provide unwanted effects. A correctly designed PCB will allow the circuit to perform as intended. A badly designed PCB will prevent the circuit from working altogether.

  Chapter 4 will discuss the different programming languages that are used to develop digital designs for implementation in either a processor (software-programmed microprocessor, microcontroller, or digital signal processor) or in programmable logic (hardware-configured FPGA or CPLD). The main languages used will be introduced and examples provided. For programmable logic, the main hardware description languages used are Verilog -HDL and VHDL (VHSIC Hardware Description Language). These are IEEE (Institute of Electrical and Electronics Engineers) standards, universally used in both education and industry.

  Chapter 5 will introduce digital logic design principles. A basic understanding of the principles of digital circuit design, such as Boolean Logic, Karnaugh maps, and counter/state machine design will be expected. However, a review of these principles will be provided for designs in schematic diagram form and presented such that the design functionality may be mapped over a VHDL description in Chapter 6.

  Chapter 6 will introduce VHDL as one of the IEEE standard hardware description languages available to describe digital circuit and system designs in an ASCII text-based format. This description can be simulated and synthesized. (Simulation will validate the design operation, and synthesis will translate the text-based description into a circuit design in terms of logic gates and the interconnections between the basic logic gates. The gates and gate connections are commonly referred to as the netlist.) The design examples provided in schematic diagram form in Chapter 5 will be revisited and modeled in VHDL.

  Chapter 7 will introduce the development of digital signal processing algorithms in VHDL and the synthesis of the VHDL descriptions to target programmable logic (both FPGA and CPLD). Such algorithms include digital filters (low-pass, high-pass, and band-pass), digital PID (proportional plus integral plus derivative) control algorithms, and the FFT (fast Fourier transform, an efficient implementation of the discrete Fourier transform, DFT).

  Chapter 8 will discuss the interfacing of programmable logic to what is commonly referred to as the real world. This is the analogue world that we live in, and such interfacing requires both the acquisition (capture) and the generation of analogue

  Preface xxi signals. To enable this, the digital programmable logic device will require an interface to the analogue world. For analogue signals to be captured and analyzed in digital, an analogue-to-digital converter (ADC) will be required. For analogue signals to be generated from the digital, a digital-to-analogue converter (DAC) will be required. In this book, the convention used for the word analogue will use the -ue at the end of the word, unless a particular name already in use is referred to spelled as analog.

  Chapter 9 will introduce the testing of the electronic system. In this, failure mechanisms in hardware and software will be introduced, and the need for efficient and cost-effective test programs from the prototyping phase of the design through high-volume manufacture and in-system testing.

  Chapter 10 will introduce the increasing need to develop programmable logic–based designs at a high level of abstraction using behavioral descriptions of the system functionality, and the increasing requirements to enable the synthesis of these high-level designs into logic. With reference to a design flow taking a digital design developed in MATLAB or Simulink through a VHDL code equivalent for implementation in FPGA or CPLD technology, the synthesis of digital control system algorithms modeled and simulated in Simulink will be translated into VHDL for implementation in programmable logic.

  Throughout the book, the HDL examples provided and evaluated can be implemented within programmable logic–based circuits that may be designed by the user in addition to the PCB design examples that are provided. These examples have been developed to form the basis of laboratory experiments that can be used to accompany the text.

  With the broad range of subject material and examples, a feature of the book is its potential for use in a range of learning and teaching scenarios. For example:

  1. As an introduction to design of electronic circuits and systems using programmable logic. This would allow for the design approaches, programmable logic architectures, simulation, synthesis, and the final configuration of an FPGA or CPLD to be undertaken. It would also allow for investigation into the most appropriate HDL coding styles and device implementation constraints to be undertaken.

  2. As an introduction to hardware description languages, in particular VHDL, allowing for case study designs to be developed and implemented within programmable logic. This would allow for VHDL code developers to see the code working on real devices and to enable additional testing of the electronic circuit with such equipment as oscilloscopes and spectrum analyzers.