if-then else : 2-1 mux mux: process (A, B, Select) begin if (select= 1 ) then Z <= A; else Z <= B; end if; end process;



Similar documents
ECE 3401 Lecture 7. Concurrent Statements & Sequential Statements (Process)

Digital Design with VHDL

VHDL GUIDELINES FOR SYNTHESIS

12. A B C A B C A B C 1 A B C A B C A B C JK-FF NETr

In this example the length of the vector is determined by D length and used for the index variable.

Using Xilinx ISE for VHDL Based Design

CNC FOR EDM MACHINE TOOL HARDWARE STRUCTURE. Ioan Lemeni

Lenguaje VHDL. Diseño de sistemas digitales secuenciales

An Example VHDL Application for the TM-4

Asynchronous & Synchronous Reset Design Techniques - Part Deux

State Machines in VHDL

Digital Design with Synthesizable VHDL

VHDL programmering H2

Lab 7: VHDL 16-Bit Shifter

VHDL Test Bench Tutorial

Step : Create Dependency Graph for Data Path Step b: 8-way Addition? So, the data operations are: 8 multiplications one 8-way addition Balanced binary

LAB #3 VHDL RECOGNITION AND GAL IC PROGRAMMING USING ALL-11 UNIVERSAL PROGRAMMER

CPE 462 VHDL: Simulation and Synthesis

Digital Design and Synthesis INTRODUCTION

Finite State Machine Design and VHDL Coding Techniques

RAPID PROTOTYPING OF DIGITAL SYSTEMS Second Edition

The Designer's Guide to VHDL

(1) D Flip-Flop with Asynchronous Reset. (2) 4:1 Multiplexor. CS/EE120A VHDL Lab Programming Reference

How To Fix A 3 Bit Error In Data From A Data Point To A Bit Code (Data Point) With A Power Source (Data Source) And A Power Cell (Power Source)

Implementation of Web-Server Using Altera DE2-70 FPGA Development Kit

More Verilog. 8-bit Register with Synchronous Reset. Shift Register Example. N-bit Register with Asynchronous Reset.

EE 42/100 Lecture 24: Latches and Flip Flops. Rev B 4/21/2010 (2:04 PM) Prof. Ali M. Niknejad

Modeling Latches and Flip-flops

A Verilog HDL Test Bench Primer Application Note

IE1204 Digital Design F12: Asynchronous Sequential Circuits (Part 1)

A CPLD VHDL Introduction

Sprites in Block ROM

Chapter 2 Ensuring RTL Intent

VGA video signal generation

Hardware Implementation of the Stone Metamorphic Cipher

Introduction. Jim Duckworth ECE Department, WPI. VHDL Short Course - Module 1

Modeling Sequential Elements with Verilog. Prof. Chien-Nan Liu TEL: ext: Sequential Circuit

Combinational-Circuit Building Blocks

EC313 - VHDL State Machine Example

FINITE STATE MACHINE: PRINCIPLE AND PRACTICE

Admin. ECE 550: Fundamentals of Computer Systems and Engineering. Last time. VHDL: Behavioral vs Structural. Memory Elements

Quartus II Introduction for VHDL Users

Digital Systems Design. VGA Video Display Generation

High-Level Synthesis for FPGA Designs

ETEC 2301 Programmable Logic Devices. Chapter 10 Counters. Shawnee State University Department of Industrial and Engineering Technologies

! " # # $ '"() * #! +, # / $0123$

VHDL Reference Manual

Sequential Circuit Design

Lecture-3 MEMORY: Development of Memory:

University of St. Thomas ENGR Digital Design 4 Credit Course Monday, Wednesday, Friday from 1:35 p.m. to 2:40 p.m. Lecture: Room OWS LL54

INTRODUCTION TO DIGITAL SYSTEMS. IMPLEMENTATION: MODULES (ICs) AND NETWORKS IMPLEMENTATION OF ALGORITHMS IN HARDWARE

HDL Simulation Framework

Discrete event modeling: VHDL

ECE232: Hardware Organization and Design. Part 3: Verilog Tutorial. Basic Verilog

Sequential Logic. (Materials taken from: Principles of Computer Hardware by Alan Clements )

Multiplexers Two Types + Verilog

AES (Rijndael) IP-Cores

Memory Elements. Combinational logic cannot remember

Understanding Verilog Blocking and Non-blocking Assignments

Register File, Finite State Machines & Hardware Control Language

From UML to HDL: a Model Driven Architectural Approach to Hardware-Software Co-Design

Manchester Encoder-Decoder for Xilinx CPLDs

Combinational Logic Design Process

Life Cycle of a Memory Request. Ring Example: 2 requests for lock 17

ECE 451 Verilog Exercises. Sept 14, James Barnes

Floating point package user s guide By David Bishop (dbishop@vhdl.org)

Digitale Signalverarbeitung mit FPGA (DSF) Soft Core Prozessor NIOS II Stand Mai Jens Onno Krah

Digital Logic Design. Basics Combinational Circuits Sequential Circuits. Pu-Jen Cheng

Two Binary Algorithms for Calculating the Jacobi Symbol and a Fast Systolic Implementation in Hardware

Topics of Chapter 5 Sequential Machines. Memory elements. Memory element terminology. Clock terminology

UNIVERSITY OF CALIFORNIA, DAVIS Department of Electrical and Computer Engineering. EEC180B Lab 7: MISP Processor Design Spring 1995

Lab 1: Introduction to Xilinx ISE Tutorial

Lecture 11: Sequential Circuit Design

Aims and Objectives. E 3.05 Digital System Design. Course Syllabus. Course Syllabus (1) Programmable Logic

Combining the ADS1202 with an FPGA Digital Filter for Current Measurement in Motor Control Applications

A Second Undergraduate Course in Digital Logic Design: The Datapath+Controller-Based Approach

Lecture 10: Sequential Circuits

DDS. 16-bit Direct Digital Synthesizer / Periodic waveform generator Rev Key Design Features. Block Diagram. Generic Parameters.

Set-Reset (SR) Latch

An Integer Square Root Algorithm

Testing & Verification of Digital Circuits ECE/CS 5745/6745. Hardware Verification using Symbolic Computation

Sequential Circuits. Combinational Circuits Outputs depend on the current inputs

Understanding Logic Design

COMP 303 MIPS Processor Design Project 4: MIPS Processor Due Date: 11 December :59

Topics. Flip-flop-based sequential machines. Signals in flip-flop system. Flip-flop rules. Latch-based machines. Two-sided latch constraint

Lab #5: Design Example: Keypad Scanner and Encoder - Part 1 (120 pts)

VERIFICATION TECHNOLOGIES

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012

LAB #4 Sequential Logic, Latches, Flip-Flops, Shift Registers, and Counters

Sistemas Digitais I LESI - 2º ano

Verilog: Blocks

We r e going to play Final (exam) Jeopardy! "Answers:" "Questions:" - 1 -

Technical Note. Micron NAND Flash Controller via Xilinx Spartan -3 FPGA. Overview. TN-29-06: NAND Flash Controller on Spartan-3 Overview

Modeling a GPS Receiver Using SystemC

Design of Remote Laboratory dedicated to E2LP board for e-learning courses.

Digital Systems. Syllabus 8/18/2010 1

EXPERIMENT 8. Flip-Flops and Sequential Circuits

Transcription:

if-then else : 2-1 mux mux: process (A, B, Select) begin if (select= 1 ) then Z <= A; else Z <= B; end if; end process;

Conditional signal assignment 2-1 Mux Z <= A when (Select= 1 ) else B; Concurrent statement - I.e. outside process.

Case statement: 2-1 Mux mux: process begin case Select is when 0 => Z <= B; when 1 => Z <= A; when others => Z <= - ; -- cover all cases end case; end process;

Priority Encoder using if-thenelsif Z <= E; -- default if (SELECT_D = 1 ) then Z <= D; elsif (SELECT_C = 1 ) then Z <= C; elseif (SELECT_B = 1 ) then Z <= B; elseif (SELECT_A = 1 ) then Z <= A; end if;

Decoder using case statement case_value := A & B & C; -- concatenate bits CASE case_value IS WHEN 000 => Z <= 00000001 ; WHEN 001 => Z <= 00000010 ; WHEN others => Z <= 00000000 ; END CASE;

Case statements Truth table can be directly translated into CASE statement. (I.e. hex to 7-segment) State transition table can also be implemented using CASE statement. Synthesized as combinational logic (unless incompletely specified.)

Case vs. If-then-elsif Case statement generates hardware with more parallelism. If-then-elseif has built-in priority; Can require lots of logic for low-priority conditions. If conditions are mutually exclusive, use case statement to simplify logic.

Inferred Latch (undesirable!) process (A, Select) begin if (Select= 1 ) then Z <= A; end if; end process;

Preventing Latch Inference If-statements and case statements must be completely specified or VHDL compiler infers latches. A default assignment must be made so that an assignment occurs for all conditions. #1 synthesis problem for Xilinx - although simulation will work, the final hardware most likely will NOT work!

D-FF Simulation Model process (CLK) begin if CLK= 1 then Q <= D; end if; end process; Incomplete sensitivity list What will be synthesized??

D flip-flop DFF : process begin wait until clk event and clk= 1 ; Q <= D; end process;

D flip-flop with Asynch Reset process (clk, reset, D) begin if (reset= 1 ) then Q <= 0 ; elsif (clk event and clk= 1 ) then Q <= D; end if; end process;

D-FF with async reset and enable process (clk, reset, D, enable) begin if (reset= 1 ) then Q <= 0 ; elseif (clk event and clk= 1 ) then if (enable= 1 ) then Q <= D; end if; end if; end process;

D-FF with Synch Reset process begin wait until clk event and clk= 1 ; if (reset= 1 ) then Q <= 0 ; else Q <= D; end if; end process;

Synthesis Guidelines Avoid inferring latches. Don t specify time delays. Avoid incomplete sensitivity lists. Don t specify initial values in entity, signal or variable declarations. Use basic constructs and behavioral code. Use std_logic and std_logic_vector types.

Synthesis Guidelines (cont.) A process must have a sensitivity list or one or more wait statements. All paths through process code must be balanced. I.e. if one path has a wait statement, all paths must have a wait statement.

IEEE-1164 Standard Logic ( U, X, 0, 1, Z, W, L, H, - ) accurately models hardware. std_logic replaces type bit std_logic_vector replace bit_vector Recommended for simulation and synthesis Special operator overloading functions and resolution functions.

Using IEEE-1164 Library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_unsigned.all; Library source code available on our system. Can add std_logic vectors, model tri-state buffers, etc.

How will this code be synthesized? process begin wait until clk event and clk= 1 ; synch_in <= asynch_in; stage_out <= synch_in; end process;

Variables Local to a process. Instantaneously updated - no delta delay. Useful for algorithmic description which needs to generate/use intermediate values. (I.e. inside for loop) Contrast: signals are global to process only Signals are scheduled, not updated instantly.

Parity generator using variable process (WORD) -- bit_vector(0 to 4) variable ODD : bit; begin ODD := 0 ; for I in 0 to 4 loop ODD := ODD xor WORD(I); end loop; PARITY <= ODD; end process;

Summary Know how to use basic constructs to produce predictable, reliable synthesis results. Know how to avoid inferring latches! Signals are scheduled; Variables update instantly. Model state machines using separate processes for state registers and for next-state combinational logic.