Beginning FPGA: Programming Metal TECHNOLOGY IN ACTION ™ Your brain on hardware — Aiken Pang Peter Membrey Beginning FPGA: Programming Metal Your brain on hardware Aiken Pang Peter Membrey Beginning FPGA: Programming Metal: Your Brain on Hardware Aiken Pang Peter Membrey Chelmsford, Massachusetts Lai Chi Kok, Kowloon, Hong Kong USA China ISBN-13 (pbk): 978-1-4302-6247-3 ISBN-13 (electronic): 978-1-4302-6248-0 DOI 10.1007/978-1-4302-6248-0 Library of Congress Control Number: 2016962137 Copyright © 2017 by Aiken Pang and Peter Membrey This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed. Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights. While the advice and information in this book are believed to be true and accurate at the date of publication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may be made. The publisher makes no warranty, express or implied, with respect to the material contained herein. Managing Director: Welmoed Spahr Lead Editor: Natalie Pao Technical Reviewer: Brendan Horan Editorial Board: Steve Anglin, Pramila Balan, Laura Berendson, Aaron Black, Louise Corrigan, Jonathan Gennick, Robert Hutchinson, Celestin Suresh John, Nikhil Karkal, James Markham, Susan McDermott, Matthew Moodie, Natalie Pao, Gwenan Spearing Coordinating Editor: Jessica Vakili Copy Editor: Lori Jacobs Compositor: SPi Global Indexer: SPi Global Artist: SPi Global Distributed to the book trade worldwide by Springer Science+Business Media New York, 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail [email protected] , or visit www.springeronline.com . Apress Media, LLC is a California LLC and the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation. For information on translations, please e-mail [email protected] , or visit www.apress.com . Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional use. eBook versions and licenses are also available for most titles. For more information, reference our Special Bulk Sales–eBook Licensing web page at www.apress.com/bulk-sales . Any source code or other supplementary materials referenced by the author in this text are available to readers at www.apress.com . For detailed information about how to locate your book’s source code, go to www.apress.com/source-code/ . Readers can also access source code at SpringerLink in the Supplementary Material section for each chapter. Printed on acid-free paper iii Contents at a Glance About the Authors �������������������������������������������������������������������������������������������������� xiii About the Technical Reviewer ��������������������������������������������������������������������������������� xv ■ Part I: Getting Started with FPGA ������������������������������������������������������� 1 ■ Chapter 1: What Is an FPGA and What Can It Do? ������������������������������������������������� 3 ■ Chapter 2: Our Weapon of Choice ����������������������������������������������������������������������� 13 ■ Chapter 3: Lock and Load ������������������������������������������������������������������������������������ 23 ■ Chapter 4: Hello World! ��������������������������������������������������������������������������������������� 47 ■ Part II: Time Out for Theory ������������������������������������������������������������ 105 ■ Chapter 5: FPGA Development Timeline ������������������������������������������������������������ 107 ■ Chapter 6: VHDL 101 ������������������������������������������������������������������������������������������ 117 ■ Chapter 7: Number Theory for FPGAs ���������������������������������������������������������������� 125 ■ Chapter 8: Telling the Truth: Boolean Algebra and Truth Tables ������������������������ 137 ■ Chapter 9: Simplifying Boolean Algebra for FPGA ��������������������������������������������� 159 ■ Chapter 10: Sequential Logic: IF This, THEN That ���������������������������������������������� 171 ■ Chapter 11: Combinatorial Logic: Putting It All Together on the FPGA �������������� 191 ■ Part III: Let’s Make Something! ������������������������������������������������������ 219 ■ Chapter 12: Light Sensors: Turning a Laser Pointer into a Hi-Tech Tripwire ���� 221 ■ Chapter 13: Temperature Sensors: Is It Hot in Here, or Is It Just Me? �������������� 267 ■ Chapter 14: How Fast Can You Run? Ask the Accelerometer! ��������������������������� 313 ■ Contents at a GlanCe iv ■ Part IV: Taking It Further: Talking to the Raspberry Pi and LED Displays ����������������������������������������������������������������������������������� 345 ■ Chapter 15: Two-Way Communications with Your Raspberry Pi: SPI ���������������� 347 ■ Chapter 16: Up in Lights: How to Drive LED Segment Displays ������������������������� 367 Index ��������������������������������������������������������������������������������������������������������������������� 381
Please Wait Your download Will Start in Seconds
Your DownLoad Will start automatically