Digital Design Using Digilent FPGA Boards -- Verilog / Active-HDL Edition

Similar documents
Injntu.com Injntu.com Injntu.com R16

(ii) Simplify and implement the following SOP function using NOR gates:

SHRI ANGALAMMAN COLLEGE OF ENGINEERING. (An ISO 9001:2008 Certified Institution) SIRUGANOOR, TIRUCHIRAPPALLI

CONTENTS CHAPTER 1: NUMBER SYSTEM. Foreword...(vii) Preface... (ix) Acknowledgement... (xi) About the Author...(xxiii)

VALLIAMMAI ENGINEERING COLLEGE. SRM Nagar, Kattankulathur DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING EC6302 DIGITAL ELECTRONICS

HANSABA COLLEGE OF ENGINEERING & TECHNOLOGY (098) SUBJECT: DIGITAL ELECTRONICS ( ) Assignment

R a) Simplify the logic functions from binary to seven segment display code converter (8M) b) Simplify the following using Tabular method

R07. Code No: V0423. II B. Tech II Semester, Supplementary Examinations, April

COPYRIGHTED MATERIAL INDEX

R10. II B. Tech I Semester, Supplementary Examinations, May

DHANALAKSHMI SRINIVASAN COLLEGE OF ENGINEERING AND TECHNOLOGY

SUBJECT CODE: IT T35 DIGITAL SYSTEM DESIGN YEAR / SEM : 2 / 3

St.MARTIN S ENGINEERING COLLEGE Dhulapally, Secunderabad

UNIT I BOOLEAN ALGEBRA AND COMBINATIONAL CIRCUITS PART-A (2 MARKS)

CHAPTER - 2 : DESIGN OF ARITHMETIC CIRCUITS

Principles of Digital Techniques PDT (17320) Assignment No State advantages of digital system over analog system.

VALLIAMMAI ENGINEERING COLLEGE

VALLIAMMAI ENGINEERING COLLEGE

Digital System Design with SystemVerilog

BHARATHIDASAN ENGINEERING COLLEGE Degree / Branch : B.E./ECE Year / Sem : II/ III Sub.Code / Name : EC6302/DIGITAL ELECTRONICS

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING QUESTION BANK NAME OF THE SUBJECT: EE 2255 DIGITAL LOGIC CIRCUITS

KING FAHD UNIVERSITY OF PETROLEUM & MINERALS COMPUTER ENGINEERING DEPARTMENT

INSTITUTE OF AERONAUTICAL ENGINEERING Dundigal, Hyderabad ELECTRONICS AND COMMUNICATIONS ENGINEERING

PART B. 3. Minimize the following function using K-map and also verify through tabulation method. F (A, B, C, D) = +d (0, 3, 6, 10).

MLR Institute of Technology

END-TERM EXAMINATION


IA Digital Electronics - Supervision I

COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING QUESTION BANK SUBJECT CODE & NAME: EC 1312 DIGITAL LOGIC CIRCUITS UNIT I

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

Digital logic fundamentals. Question Bank. Unit I

EE178 Spring 2018 Lecture Module 1. Eric Crabill

Code No: R Set No. 1

R07

B.Tech II Year I Semester (R13) Regular Examinations December 2014 DIGITAL LOGIC DESIGN

UPY14602-DIGITAL ELECTRONICS AND MICROPROCESSORS Lesson Plan

Code No: R Set No. 1

ECE 341 Midterm Exam

Digital Design. Verilo. and. Fundamentals. fit HDL. Joseph Cavanagh. CRC Press Taylor & Francis Group Boca Raton London New York

TEACHING & EXAMINATION SCHEME For the Examination COMPUTER SCIENCE. B.Sc. Part-I

DIGITAL ELECTRONICS. Vayu Education of India

APPENDIX A SHORT QUESTIONS AND ANSWERS

3. The high voltage level of a digital signal in positive logic is : a) 1 b) 0 c) either 1 or 0

: : (91-44) (Office) (91-44) (Residence)

SIDDHARTH GROUP OF INSTITUTIONS :: PUTTUR Siddharth Nagar, Narayanavanam Road QUESTION BANK (DESCRIPTIVE)

DIRECTORATE OF TECHNICAL EDUCATION DIPLOMA IN ELECTRICAL AND ELECTRONICS ENGINEERING II YEAR M SCHEME IV SEMESTER.

II/IV B.Tech (Regular/Supplementary) DEGREE EXAMINATION. Answer ONE question from each unit.

ENEE 245 Lab 1 Report Rubrics

Computer Arithmetic andveriloghdl Fundamentals

Scheme G. Sample Test Paper-I

Lecture #1: Introduction

Hours / 100 Marks Seat No.

Verilog for High Performance

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

DE Solution Set QP Code : 00904

10EC33: DIGITAL ELECTRONICS QUESTION BANK

NADAR SARASWATHI COLLEGE OF ENGINEERING AND TECHNOLOGY Vadapudupatti, Theni

Lab Manual for COE 203: Digital Design Lab

D I G I T A L C I R C U I T S E E

PINE TRAINING ACADEMY

DIGITAL ELECTRONICS. P41l 3 HOURS

Code No: 07A3EC03 Set No. 1

EECS Components and Design Techniques for Digital Systems. Lec 07 PLAs and FSMs 9/ Big Idea: boolean functions <> gates.

UNIT - V MEMORY P.VIDYA SAGAR ( ASSOCIATE PROFESSOR) Department of Electronics and Communication Engineering, VBIT

CHAPTER 9 MULTIPLEXERS, DECODERS, AND PROGRAMMABLE LOGIC DEVICES

Microcomputers. Outline. Number Systems and Digital Logic Review

Introduction to Digital Design Using Digilent FPGA Boards Block Diagram / Verilog Examples

FSM-based Digital Design using Veriiog HDL

Chapter 4. Combinational Logic

MGU-BCA-205- Second Sem- Core VI- Fundamentals of Digital Systems- MCQ s. 2. Why the decimal number system is also called as positional number system?

CS6201-DIGITAL PRINCIPLE AND SYSTEM DESIGN I YEAR/II SEM PART-B UNIT-I BOOLEAN ALGEBRA AND LOGIC GATES.

Philadelphia University Student Name: Student Number:

SIR C.R.REDDY COLLEGE OF ENGINEERING, ELURU DEPARTMENT OF INFORMATION TECHNOLOGY LESSON PLAN

Digital Circuit Design and Language. Datapath Design. Chang, Ik Joon Kyunghee University

Code No: R Set No. 1

Digital Logic Design Exercises. Assignment 1

DIGITAL CIRCUIT LOGIC UNIT 9: MULTIPLEXERS, DECODERS, AND PROGRAMMABLE LOGIC DEVICES

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

Register Transfer Level in Verilog: Part I

Outline. EECS Components and Design Techniques for Digital Systems. Lec 11 Putting it all together Where are we now?

Logic design Ibn Al Haitham collage /Computer science Eng. Sameer

INDEX OF VERILOG MODULES

ECE 2030B 1:00pm Computer Engineering Spring problems, 5 pages Exam Two 10 March 2010

Digital Logic & Computer Design CS Professor Dan Moldovan Spring 2010


CS8803: Advanced Digital Design for Embedded Hardware

Field Programmable Gate Array

Course Batch Semester Subject Code Subject Name. B.E-Marine Engineering B.E- ME-16 III UBEE307 Integrated Circuits

Topics. Midterm Finish Chapter 7

Digital Logic Design Lab

This content has been downloaded from IOPscience. Please scroll down to see the full text.

V1 - VHDL Language. FPGA Programming with VHDL and Simulation (through the training Xilinx, Lattice or Actel FPGA are targeted) Objectives

Verilog HDL. Design Examples

Chapter 2 Basic Logic Circuits and VHDL Description

1. Draw general diagram of computer showing different logical components (3)

I 3 I 2. ! Language of logic design " Logic optimization, state, timing, CAD tools

Hardware Design Environments. Dr. Mahdi Abbasi Computer Engineering Department Bu-Ali Sina University

VHDL for Synthesis. Course Description. Course Duration. Goals

SKEE2263 Sistem Digit

Register Transfer Methodology II

Transcription:

Digital Design Using Digilent FPGA Boards -- Verilog / Active-HDL Edition Table of Contents 1. Introduction to Digital Logic 1 1.1 Background 1 1.2 Digital Logic 5 1.3 Verilog 8 2. Basic Logic Gates 9 2.1 Truth Tables and Logic Equations 9 The Three Basic Gates 9 Four New Gates 11 2.2 Positive and Negative Logic: De Morgan s Theorem 13 2.3 Sum of Products Design 16 2.4 Product of Sums Design 15 Verilog Examples 18 Example 1 2-Input Gates 18 Example 2 Multiple-Input Gates 21 Problems 24 3. Boolean Algebra and Logic Equations 28 3.1 Boolean Theorems 28 One-Variable Theorems 29 Two- and Three-Variable Theorems 29 3.2 Karnaugh Maps 34 Two-Variable K-Maps 34 Three-Variable K-Maps 36 Four-Variable K-Maps 38 3.3 Computer Mimimization Techniques 40 Tabular Representations 40 Prime Implicants 41 Essential Prime Implicants 43 Verilog Examples 45 Example 3 Majority Circuit 45 Example 4 2-Bit Comparator 47 Problems 50 4. Implementing Digital Circuits 52 4.1 Implementing Gates 52 4.2 Transistor-Transistor Logic (TTL) 54 4.3 Programmable Logic Devices (PLDs and CPLDs) 56 A 2-Input, 1-Output PLD 56

The GAL 16V8 58 CPLDs 60 4.4 Field Programmable Gate Arrays (FPGAs) 60 Verilog Examples 62 Example 5 Map Report 62 Problems 63 5. Combinational Logic 64 5.1 Multiplexers 64 2-to-1 Multiplexer 64 4-to-1 Multiplexer 65 Quad 2-to-1 Multiplexer 66 Verilog Examples 67 Example 6 2-to-1 Multiplexer: if Statement 67 Example 7 4-to-1 Multiplexer: Module Instantiation 70 Example 8 4-to-1 Multiplexer: case Statement 74 Example 9 A Quad 2-to-1 Multiplexer 75 Example 10 Generic Multiplexer: Parameters 77 Example 11 Glitches 79 5.2 7-Segment Displays 82 Verilog Examples 83 Example 12 7-Segment Decoder: Logic Equations 83 Example 13 7-Segment Decoder: case Statement 85 Example 14 Multiplexing 7-Segment Displays 87 Example 15 7-Segment Displays: x7seg and x7segb 89 5.3 Comparators 94 Cascading Comparators 94 TTL Comparators 95 Verilog Examples 96 Example 16 4-Bit Comparator Using a Verilog Task 96 Example 17 N-Bit Comparator Using Relational Operators 98 5.4 Decoders and Encoders 100 Decoders 100 TTL Decoders 101 Encoders 101 Priority Encoders 102 TTL Encoders 102 Verilog Examples 103 Example 18 3-to-8 Decoder: Logic Equations 103 Example 19 3-to-8 Decoder: for Loops 104 Example 20 8-to-3 Encoder: Logic Equations 105 Example 21 8-to-3 Encoder: for Loops 107 Example 22 8-to-3 Priority Encoder 107 5.5. Code Converters 109 Binary-to-BCD Converters 109 Shift and Add 3 Algorithm 110

Gray Code Converters 111 Verilog Examples 112 Example 23 4-Bit Binary-to-BCD Converter: Logic Equations 112 Example 24 8-Bit Binary-to-BCD Converter: for Loops 113 Example 25 4-Bit Binary to Gray Code Converter 115 Example 26 4-Bit Gray Code to Binary Converter 116 Problems 117 6. Arithmetic Circuits 120 6.1 Adders 120 Half Adder 120 Full Adder 120 Carry and Overflow 123 TTL Adder 125 Verilog Examples 125 Example 27 4-Bit Adder: Logic Equations 125 Example 28 4-Bit Adder: Behavioral Statements 128 Example 29 N-Bit Adder: Behavioral Statements 129 6.2 Subtractors 129 Half Subtractor 129 Full Subtractor 130 An Adder/Subtractor Circuit 131 Verilog Examples 133 Example 30 4-Bit Adder/Subtractor: Logic Equations 133 Example 31 N-Bit Subtractor: Behavioral Statements 134 6.3 Shifters 135 Verilog Examples 136 Example 32 4-Bit Shifter 136 6.4 Multiplication 137 Binary Multiplication 137 Signed Multiplication 139 Verilog Examples 140 Example 33 Multiplying by a Constant 140 Example 34 A 4-Bit Multiplier 141 6.5 Division 143 Binary Division 143 Verilog Examples 144 Example 35 An 8-Bit Divider using a Task 144 6.6 Arithmetic Logic Unit (ALU) 146 Verilog Examples 147 Example 36 4-Bit ALU 147 Problems 149 7. Sequential Logic 151 7.1 Latches and Flip-Flops 151 SR Latch 151

Clocked SR Latch 153 D Latch 153 Edge-Triggered D Flip-Flop 154 Verilog Examples 156 Example 37 Edge-Triggered D Flip-Flop 156 Example 38 Edge-Triggered D Flip-Flop with Set and Clear 157 Example 39 D Flip-Flops in Verilog 158 Example 40 D Flip-Flop with Asynchronous Set and Clear 159 Example 41 Divide-by-2 Counter 160 7.2 Registers 161 Verilog Examples 163 Example 42 1-Bit Register 163 Example 43 4-Bit Register 164 Example 44 N-Bit Register 165 7.3 Shift Registers 166 4-Bit Ring Counter 167 Verilog Examples 167 Example 45 Shift Registers 167 Example 46 Ring Counter 168 Example 47 Debounce Pushbuttons 169 Example 48 Clock Pulse 171 7.4 Counters 173 Arbitrary Waveform 174 Verilog Examples 175 Example 49 3-Bit Counter 175 Example 50 Modulo-5 Counter 177 Example 51 N-Bit Counter 178 Example 52 Clock Divider: Modulo-10K Counter 180 Example 53 Arbitrary Waveform 184 7.5 Pulse-Width Modulation (PWM) 185 Controlling the Speed of a DC Motor using PWM 186 Controlling the Position of a Servo using PWM 187 Verilog Examples 188 Example 54 Pulse-Width Modulation (PWM) 188 Example 55 PWM Signal for Controlling Servos 190 7.6 BASYS/Nexys-2 Board Examples 191 Verilog Examples 191 Example 56 Loading Switch Data into a Register 191 Example 57 Shifting Data into a Shift Register 193 Example 58 Scrolling the 7-Segment Display 195 Example 59 Fibonacci Sequence 200 Problems 203 8. State Machines 206 8.1 Mealy and Moore State Machines 206 8.2 A Moore Machine Sequence Detector 207

8.3 Mealy Machine Sequence Detector 209 Verilog Examples 210 Example 60 Sequence Detector 210 Example 61 Door Lock Code 215 Example 62 Traffic Lights 219 Problems 224 9. Datapaths and Control Units 225 9.1 Verilog while Statement 225 Example 63 GCD Algorithm Part 1 225 9.2 Datapaths and Control Units 227 Example 64 GCD Algorithm Part 2 229 Example 65 An Integer Square Root Algorithm 237 10. Integrating the Datapath and Control Unit 247 Example 66 GCD Algorithm Part 3 249 Example 67 Integer Square Root Part 2 253 11. Memory 257 Example 68 A Verilog ROM 257 Example 69 Distributed RAM/ROM 262 Example 70 Block RAM/ROM 267 12. VGA Controller 271 Example 71 VGA-Stripes 275 Example 72 VGA-PROM 281 Example 73 Sprites in Block ROM 286 Example 74 Screen Saver 292 13. PS/2 Port 297 Example 75 Keyboard 300 Example 76 Mouse 307 Appendix A Aldec Active-HDL Tutorial 316 Part 1: Project Setup 316 Part 2: Design Entry 320 Part 3: Simulation 323 Part 4: Creating a Top-level Design 327 Part 5: Synthesis and Implementation 329 Part 6: Program FPGA Board 333 Appendix B Number Systems 334 B.1 Counting in Binary and Hexadecimal 334 B.2 Positional Notation 338 B.3 Fractional Numbers 339 B.4 Number System Conversions 339

B.5 Negative Numbers 343 Appendix C Making a Turnkey System 347 Appendix D Digilent FPGA Boards Comparison Chart 349 Appendix E Installing the Xilinx ISE/WebPACK, Aldec Active-HDL, and Digilent Adept2 Software 350 Appendix F Verilog Quick Reference Guide 352