FPGA BASED SYSTEM DESIGN. Dr. Tayab Din Memon Lecture 9 & 10 : Combinational and Sequential Logic

Similar documents
Islamic University Gaza Engineering Faculty Department of Computer Engineering ECOM 4111: Digital Systems Design Lab. Lab # 5. Concurrent Statements

ECE 545 Lecture 5. Data Flow Modeling in VHDL. George Mason University

ECE 448 Lecture 3. Combinational-Circuit Building Blocks. Data Flow Modeling of Combinational Logic

Digital Systems Design

INTRODUCTION TO VHDL. Lecture 5 & 6 Dr. Tayab Din Memon Assistant Professor Department of Electronic Engineering, MUET

ACS College of Engineering. Department of Biomedical Engineering. Logic Design Lab pre lab questions ( ) Cycle-1

VHDL for Synthesis. Course Description. Course Duration. Goals

VHDL for FPGA Design. by : Mohamed Samy

Introduction to VHDL #3

ECE 448 Lecture 3. Combinational-Circuit Building Blocks. Data Flow Modeling of Combinational Logic

Chapter 2 Basic Logic Circuits and VHDL Description

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

Introduction to VHDL #1

Hardware Description Language VHDL (1) Introduction

Lecture 12 VHDL Synthesis

VHDL 2 Combinational Logic Circuits. Reference: Roth/John Text: Chapter 2

EECE-4740/5740 Advanced VHDL and FPGA Design. Lecture 3 Concurrent and sequential statements

Lattice VHDL Training

ECE 545 Lecture 8. Data Flow Description of Combinational-Circuit Building Blocks. George Mason University

1 ST SUMMER SCHOOL: VHDL BOOTCAMP PISA, JULY 2013

COE 405 Design Methodology Based on VHDL

Abi Farsoni, Department of Nuclear Engineering and Radiation Health Physics, Oregon State University

C-Based Hardware Design

Chapter 6 Combinational-Circuit Building Blocks

ENGIN 241 Digital Systems with Lab

Multi-valued Logic. Standard Logic IEEE 1164 Type std_ulogic is ( U, uninitialized

Basic Language Concepts

[VARIABLE declaration] BEGIN. sequential statements

Computer-Aided Digital System Design VHDL

קורס VHDL for High Performance. VHDL

structure syntax different levels of abstraction

Here is a list of lecture objectives. They are provided for you to reflect on what you are supposed to learn, rather than an introduction to this

5. VHDL - Introduction - 5. VHDL - Design flow - 5. VHDL - Entities and Architectures (1) - 5. VHDL - Entities and Architectures (2) -

Introduction to VHDL Lecture D

Lecture 3. VHDL Design Units and Methods. Entity, Architecture, and Components Examples of Combinational Logic Hands-on in the Laboratory

CSCI Lab 3. VHDL Syntax. Due: Tuesday, week6 Submit to: \\fs2\csci250\lab-3\

Outline. CPE/EE 422/522 Advanced Logic Design L05. Review: General Model of Moore Sequential Machine. Review: Mealy Sequential Networks.

The block diagram representation is given below: The output equation of a 2x1 multiplexer is given below:

Concurrent Signal Assignment Statements (CSAs)

Department of Electronics & Communication Engineering Lab Manual E-CAD Lab

ECE 545 Lecture 6. Behavioral Modeling of Sequential-Circuit Building Blocks. George Mason University

Digital Systems Design

Lecture 4: Modeling in VHDL (Continued ) EE 3610 Digital Systems

ECE 448 Lecture 4. Sequential-Circuit Building Blocks. Mixing Description Styles

Date Performed: Marks Obtained: /10. Group Members (ID):. Experiment # 11. Introduction to Verilog II Sequential Circuits

VHDL Examples Mohamed Zaky

2/14/2016. Hardware Synthesis. Midia Reshadi. CE Department. Entities, Architectures, and Coding.

BASIC VHDL LANGUAGE ELEMENTS AND SEMANTICS. Lecture 7 & 8 Dr. Tayab Din Memon

IE1204 Digital Design L7: Combinational circuits, Introduction to VHDL

CprE 583 Reconfigurable Computing

SEQUENTIAL STATEMENTS

VHDL. Chapter 1 Introduction to VHDL. Course Objectives Affected. Outline

VHDL Basics. Mehdi Modarressi. Department of Electrical and Computer Engineering, University of Tehran. ECE381(CAD), Lecture 4:

Department of Technical Education DIPLOMA COURSE IN ELECTRONICS AND COMMUNICATION ENGINEERING. Fifth Semester. Subject: VHDL Programming

Experiment 8 Introduction to VHDL

Introduction to VHDL. Yvonne Avilés Colaboration: Irvin Ortiz Flores Rapid System Prototyping Laboratory (RASP) University of Puerto Rico at Mayaguez

CCE 3202 Advanced Digital System Design

VHDL: Concurrent Coding vs. Sequen7al Coding. 1

VHDL. Chapter 7. Behavioral Modeling. Outline. Behavioral Modeling. Process Statement

CS211 Digital Systems/Lab. Introduction to VHDL. Hyotaek Shim, Computer Architecture Laboratory

VHDL. ELEC 418 Advanced Digital Systems Dr. Ron Hayne. Images Courtesy of Cengage Learning

CMPT 250: Computer Architecture. Using LogicWorks 5. Tutorial Part 1. Somsubhra Sharangi

LAB 1: Combinational Logic: Designing and Simulation of Arithmetic Logic Unit ALU using VHDL

Lecture 1: VHDL Quick Start. Digital Systems Design. Fall 10, Dec 17 Lecture 1 1

Verilog for High Performance

Concurrent & Sequential Stmts. (Review)

Introduction to VHDL

CSC / EE Digital Systems Design. Summer Sample Project Proposal 01

VHDL VS VERILOG.

PACKAGE. Package syntax: PACKAGE identifier IS...item declaration... END PACKAGE [identifier]

VHDL: A Crash Course

1. What is y-chart? ans: The y- chart consists of three domains:- behavioral, structural and geometrical.

ECE U530 Digital Hardware Synthesis. Course Accounts and Tools

Digital Systems Design

VHDL Structural Modeling II

IT T35 Digital system desigm y - ii /s - iii

ECE 545 Lecture 4. Simple Testbenches. George Mason University

VHDL. Official Definition: VHSIC Hardware Description Language VHISC Very High Speed Integrated Circuit

Lecture 3. VHDL Design Units and Methods. Notes. Notes. Notes

ELCT 501: Digital System Design

VHDL Testbench. Test Bench Syntax. VHDL Testbench Tutorial 1. Contents

Lecture 4. VHDL Fundamentals. George Mason University

Logic and Computer Design Fundamentals VHDL. Part 1 Chapter 4 Basics and Constructs

EE 459/500 HDL Based Digital Design with Programmable Logic. Lecture 4 Introduction to VHDL

Very High Speed Integrated Circuit Har dware Description Language

Synthesis from VHDL. Krzysztof Kuchcinski Department of Computer Science Lund Institute of Technology Sweden

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

Control and Datapath 8

VHDL for Complex Designs

Lecture 3: Modeling in VHDL. EE 3610 Digital Systems

FPGA Design Challenge :Techkriti 14 Digital Design using Verilog Part 1

Modeling Sequential Circuits in Verilog

The VHDL Hardware Description Language

Outline. Concurrent Signal Assignment Statements. 2. Simple signal assignment statement. 1. Combinational vs. sequential circuit

Two HDLs used today VHDL. Why VHDL? Introduction to Structured VLSI Design

Luleå University of Technology Kurskod SMD152 Datum Skrivtid

VHDL Modeling Behavior from Synthesis Perspective -Part B - EL 310 Erkay Savaş Sabancı University

Lecture 3 Introduction to VHDL

DIGITAL LOGIC DESIGN VHDL Coding for FPGAs Unit 6

INSTITUTE OF AERONAUTICAL ENGINEERING Dundigal, Hyderabad ELECTRONICS AND COMMUNICATIONS ENGINEERING

Transcription:

FPGA BASED SYSTEM DESIGN Dr. Tayab Din Memon tayabuddin.memon@faculty.muet.edu.pk Lecture 9 & 10 : Combinational and Sequential Logic

Combinational vs Sequential Logic Combinational logic output depends upon the current input Memory less system Sequential logic output needs memory because it depends upon the previous states Storage elements connected in feedback loop with combinational logic

Concurrent vs Sequential Code Only statements placed inside the process the procedure or function are sequential but VHDL code is inherently concurrent (parallel) In other words, concurrent are Statements outside of a process Processes are evaluated concurrently Concurrent code is also called dataflow code In general combinational logic circuits are build with concurrent code

Concurrent Statements Concurrent statements include: Boolean equations conditional assignments (when/else, with/select) instantiation

Using Operators Easiest and basic way of creating concurrent code Complex circuits are easier to deal with sequential code comparatively, infact

Example I: Multiplexer Fig: MUX Block Fig: MUX

When Statement Example: When/ Else or with/ Select / When When/ Else or with/ Select / When Syntax

Example 2: Solution with WHEN/ELSE Fig: MUX Example - II If x is an integer i.e., x : in integer range 0 to 3;

Solution 2: with WITH/SELECT/WHEN

Example 3: Tri-State Buffer ena x(3:0) Y(3:0) A Fig: Tri-State Buffer Fig: Vector Waveform

Encoder 8by3 (i.e., n=8, m=3) When-Else Fig: Encoder Block Fig: Simulation Results

Encoder 8by3 (i.e., n=8, m=3) With-Select-When

GENERATE Statement It is another concurrent statement. It allows a section of code to be repeated a number of times, thus creating several instances of the same assignment. An irregular form of GENERATE statement is IF/GENERATE, syntax given below:

How to use GENERATE Statement? Example: input as variable GENERATE Syntax I Example: outcome as single driven Example: outcome as multiple driven

GENERATE Shifter Example Fig: VHDL Code and Vector Waveform Output

Home Work

PART-II: SEQUENTIAL CODE

Sequential Code VHDL is inherently concurrent IF, WAIT, CASE, and LOOP are executed inside the PROCESSES, FUNCTIONS, and PROCEDURES that are sequentially processed. Variable is not global, should be declared inside the process Signal can be used globally

Sequential statements: The Process A VHDL construct used for grouping sequential statements Statements are processed sequentially during simulation Can be either active or inactive during simulation A Process typically has a SENSITIVITY LIST except when WAIT is used PROCESS (sensitivity list) -- optional variable declarations BEGIN sequential statements END PROCESS ;

The Process Sensitivity List A Process is invoked when one or more of the signals within the sensitivity list change, e.g. ARCHITECTURE archlist OF list IS BEGIN nand0: PROCESS (a,b) BEGIN c <= NOT (a AND b); END PROCESS nand; END archlist; if either a or b changes in any way, the process is invoked

Fig: D Flip Flop Symbol Fig: DFF Vector Waveform

Signal Assignment in Processes s LIBRARY ieee; USE ieee.std_logic_1164.all; ENTITY mux2ltch IS PORT ( a, b: IN std_logic; s, en: IN std_logic; x: BUFFER std_logic); END mux2ltch; a b en c x

Signal Assignment in Processes: Incorrect Solution ARCHITECTURE archmux2ltch OF mux2ltch IS SIGNAL c: std_logic; BEGIN a mux: PROCESS (a,b,s,en) BEGIN IF s = '0' THEN c <= a; b ELSE c <= b; END IF; en x <= (x AND (NOT en)) OR (c AND en); END PROCESS mux; -- c is updated here! END archmux2ltch; s c x

PROCESS: A correct solution ARCHITECTURE archmux2ltch OF mux2ltch IS SIGNAL c: std_logic; BEGIN mux: PROCESS (a, b, s) BEGIN IF s = '0' THEN c <= a; ELSE c <= b; END IF; END PROCESS mux; -- c is updated here! x <= (x AND (NOT en)) OR (c AND en); END archmux2ltch;

IF Statement Counter Example Code Fig: Counter Vector Waveform

WAIT No sensitivity list required WAIT UNTIL accepts one signal, WAIT ON accepts multiple, Wait For is only for simulation purpose Do yourself develop DFF code using wait on instead of IF only, and simulate it in Quartus-II, verify the functionality and observe the area-performance differences.

CASE DFF with CASE Statement CASE statement has resemblance with WHEN Unlike WHEN, CASE allows multiple assignments

LOOP: FOR and WHILE

Sample Example Codes

CASE Versus IF and WHEN CASE and IF allows selection of one sequence of statements for execution form a number of alternative sequences CASE vs WHEN CASE is sequential, while WHEN is concurrent CASE can only be used inside the process, FUNCTIONS, or PROCEDURES while WHEN outside is reverse All permutations can be tested by both WHEN can have any number of assignments per test, while CASE is limited to only one NULL is the keyword for no-action in CASE, Unaffected is used in WHEN for no-action (shown previously in examples)

END OF THE LECTURE Lecture 9 & 10