Sequential Statements

Slides:



Advertisements
Similar presentations
2/16/09 Lab 3 Jorge Crichigno. 2/16/09 Half-adder.
Advertisements

Lecture 6 Chap 8: Sequential VHDL Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
1 Lecture 13 VHDL 3/16/09. 2 VHDL VHDL is a hardware description language. The behavior of a digital system can be described (specified) by writing a.
1 VLSI DESIGN USING VHDL Part II A workshop by Dr. Junaid Ahmed Zubairi.
2-to-1 Multiplexer: if Statement Discussion D2.1 Example 4.
Mridula Allani Fall 2010 (Refer to the comments if required) ELEC Fall 2010, Nov 21(Adopted from Profs. Nelson and Stroud)
9/18/08 Lab 2 - Solution TA: Jorge. 9/18/08 Half-adder.
Introduction to VHDL VHDL Tutorial R. E. Haskell and D. M. Hanna T1: Combinational Logic Circuits.
Introduction to VHDL Multiplexers. Introduction to VHDL VHDL is an acronym for VHSIC (Very High Speed Integrated Circuit) Hardware Description Language.
Introduction to VHDL CSCE 496/896: Embedded Systems Witawas Srisa-an.
ELEN 468 Lecture 191 ELEN 468 Advanced Logic Design Lecture 19 VHDL.
VHDL Intro What does VHDL stand for? VHSIC Hardware Description Language VHSIC = Very High Speed Integrated Circuit Developed in 1982 by Govt. to standardize.
HDL-Based Digital Design Part I: Introduction to VHDL (I) Dr. Yingtao Jiang Department Electrical and Computer Engineering University of Nevada Las Vegas.
Programming in VHDL Using Processes. How Processes Run A process is either in suspend mode or is running. For a process to run, there has to be a change.
Introduction to VHDL By Mr. Fazrul Faiz Zakaria School of Computer and Communication Engineering UniMAP.
Introduction to VHDL (part 2)
1 Data Object Object Types A VHDL object consists of one of the following: –Signal, Which represents interconnection wires that connect component instantiation.
1 H ardware D escription L anguages Basic Language Concepts.
ECE 332 Digital Electronics and Logic Design Lab Lab 5 VHDL Design Styles Testbenches.
Data Flow Modeling of Combinational Logic Simple Testbenches
A.7 Concurrent Assignment Statements Used to assign a value to a signal in an architecture body. Four types of concurrent assignment statements –Simple.
VHDL TUTORIAL Preetha Thulasiraman ECE 223 Winter 2007.
Tutorial 1 Combinational Logic Synthesis. Introduction to VHDL VHDL = Very high speed Hardware Description Language VHDL and Verilog are the industry.
VHDL Introduction. V- VHSIC Very High Speed Integrated Circuit H- Hardware D- Description L- Language.
ENG241 Digital Design Week #4 Combinational Logic Design.
VHDL in 1h Martin Schöberl. AK: JVMHWVHDL2 VHDL /= C, Java,… Think in hardware All constructs run concurrent Different from software programming Forget.
ECE Advanced Digital Systems Design Lecture 4 – Combinational Circuits in VHDL Capt Michael Tanner Room 2F46A HQ U.S. Air Force Academy.
Copyright © 1997 Altera Corporation & 提供 What is VHDL Very high speed integrated Hardware Description Language (VHDL) –is.
IAY 0600 Digital Systems Design VHDL discussion Dataflow&Behavioral Styles Combinational Design Alexander Sudnitson Tallinn University of Technology.
VHDL for Combinational Circuits. VHDL We Know Simple assignment statements –f
1 ECE 545 – Introduction to VHDL Dataflow Modeling of Combinational Logic Simple Testbenches ECE 656. Lecture 2.
VHDL Very High Speed Integrated Circuit Hardware Description Language Shiraz University of shiraz spring 2011.
ECE 331 – Digital System Design Multiplexers and Demultiplexers (Lecture #13)
IAY 0600 Digital Systems Design VHDL discussion Dataflow Style Combinational Design Alexander Sudnitson Tallinn University of Technology.
Digital System Projects
1 Part III: VHDL CODING. 2 Design StructureData TypesOperators and AttributesConcurrent DesignSequential DesignSignals and VariablesState Machines A VHDL.
9/9/2006DSD,USIT,GGSIPU1 Concurrent vs Sequential Combinational vs Sequential logic –Combinational logic is that in which the output of the circuit depends.
CS/EE 3700 : Fundamentals of Digital System Design
04/26/20031 ECE 551: Digital System Design & Synthesis Lecture Set : Introduction to VHDL 12.2: VHDL versus Verilog (Separate File)
ACANEL VHDL 의 이해와 실습 2000 년 1 학기 Computer Architecture (classes links)
CEC 220 Digital Circuit Design VHDL in Sequential Logic Wednesday, March 25 CEC 220 Digital Circuit Design Slide 1 of 13.
Apr. 3, 2000Systems Architecture I1 Introduction to VHDL (CS 570) Jeremy R. Johnson Wed. Nov. 8, 2000.
May 9, 2001Systems Architecture I1 Systems Architecture I (CS ) Lab 5: Introduction to VHDL Jeremy R. Johnson May 9, 2001.
RTL Hardware Design Chapter Combinational versus sequential circuit 2. Simple signal assignment statement 3. Conditional signal assignment statement.
Lecture #10 Page 1 Lecture #10 Agenda 1.VHDL : Concurrent Signal Assignments 2.Decoders using Structural VHDL Announcements 1.HW #4 due 2.HW #5 assigned.
Data Flow and Behavioral Modeling in VHDL 1 MS EMBEDDED SYSTEMS.
1 Introduction to Engineering Spring 2007 Lecture 18: Digital Tools 2.
Fundamentals of Digital Signal Processing יהודה אפק, נתן אינטרטור אוניברסיטת תל אביב.
1 Introduction to Engineering Spring 2007 Lecture 19: Digital Tools 3.
Combinational logic circuit
Systems Architecture Lab: Introduction to VHDL
Describing Combinational Logic Using Processes
ENG2410 Digital Design “Combinational Logic Design”
Dataflow Style Combinational Design with VHDL
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
Sequential Statements (Lecture 2)
Combinational Circuits Using VHDL
CPE/EE 422/522 Advanced Logic Design L06
ECE 434 Advanced Digital System L08
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
VHDL (VHSIC Hardware Description Language)
Concurrent vs Sequential
CPE 528: Lecture #5 Department of Electrical and Computer Engineering University of Alabama in Huntsville.
ECE 331 – Digital System Design
Modeling of Circuits with a Regular Structure
4-Input Gates VHDL for Loops
디 지 털 시 스 템 설 계 UP2 Kit를 이용한 카운터 설계
EEL4712 Digital Design (VHDL Tutorial).
(Simple Testbenches & Arithmetic Operations)
Presentation transcript:

Sequential Statements Osman Hasan COEN 313

Outline VHDL process If statement Sequential signal assignment statement Variable assignment statement If statement

VHDL Process Group of Instructions that are executed sequentially Syntax process declarations; begin sequential statement; . . . end process; The whole process is a concurrent statement Safety critical system failure could cause human life. Commercial critical systems: great financial loss if the product is recalled or is found to contain bugs Examples of undetected errors – Ariane 5 rocket explosion, 1996 (exception occurred when converting 64-bit floating number to a 16-bit integer) – Pentium bug (multiplier table not fully verified) – many more …. Somehow make debugging happen earlier where it is cheaper 3 3

VHDL Process - Types With Sensitivity list Process (sensitivity list) declarations; begin sequential statement; . . . end process; A process is activated when a signal in the sensitivity list changes its value Example: 3 input AND gate signal a,b,c,y: std_logic; process(a,b,c) begin y <= a and b and c; end process; What happens if a is removed from the sensitivity list? Safety critical system failure could cause human life. Commercial critical systems: great financial loss if the product is recalled or is found to contain bugs Examples of undetected errors – Ariane 5 rocket explosion, 1996 (exception occurred when converting 64-bit floating number to a 16-bit integer) – Pentium bug (multiplier table not fully verified) – many more …. Somehow make debugging happen earlier where it is cheaper 4 4

VHDL Process - Types With Wait statement No sensitivity list declarations; begin sequential statement; wait on signals . . . end process; No sensitivity list Process continues the execution until a wait statement is reached and then suspended Example: 3 input AND gate process begin y <= a and b and c; wait on a, b, c; end process; Safety critical system failure could cause human life. Commercial critical systems: great financial loss if the product is recalled or is found to contain bugs Examples of undetected errors – Ariane 5 rocket explosion, 1996 (exception occurred when converting 64-bit floating number to a 16-bit integer) – Pentium bug (multiplier table not fully verified) – many more …. Somehow make debugging happen earlier where it is cheaper 5 5

Points to Remember A process may or may not be mapped to physical hardware For a combinational circuit, all inputs should be included in the sensitivity list Process with sensitivity list is preferred for synthesis Safety critical system failure could cause human life. Commercial critical systems: great financial loss if the product is recalled or is found to contain bugs Examples of undetected errors – Ariane 5 rocket explosion, 1996 (exception occurred when converting 64-bit floating number to a 16-bit integer) – Pentium bug (multiplier table not fully verified) – many more …. Somehow make debugging happen earlier where it is cheaper 6 6

Sequential signal assignment statement Identical to the simple concurrent signal assignment Syntax : signal_name <= value_expression; Inside a process, a signal can be assigned multiple times, but only the last assignment takes effect Example: process(a,b,c,d) begin -- yentry := y y <= a or c; -- yexit := a or c; y <= a and b; -- yexit := a and b; y <= c and d; -- yexit := c and d; end process; -- y <= yexit Example: process(a,b,c,d) begin y <= c and d; end process; Safety critical system failure could cause human life. Commercial critical systems: great financial loss if the product is recalled or is found to contain bugs Examples of undetected errors – Ariane 5 rocket explosion, 1996 (exception occurred when converting 64-bit floating number to a 16-bit integer) – Pentium bug (multiplier table not fully verified) – many more …. Somehow make debugging happen earlier where it is cheaper 7 7

Variable assignment statement Like variables in C/C++ Syntax : variable_name := value_expression; Assignment takes effect immediately What happens if := is replaced with <= Example: process(a,b,c) variable tmp: std_logic; begin tmp := '0'; tmp := tmp or a; tmp := tmp or b; y <= tmp; end process; Safety critical system failure could cause human life. Commercial critical systems: great financial loss if the product is recalled or is found to contain bugs Examples of undetected errors – Ariane 5 rocket explosion, 1996 (exception occurred when converting 64-bit floating number to a 16-bit integer) – Pentium bug (multiplier table not fully verified) – many more …. Somehow make debugging happen earlier where it is cheaper 8 8

Quiz 1 sum LIBRARY IEEE; USE IEEE.STD_LOGIC_1164.ALL; ENTITY sig_ass IS END ENTITY; ARCHITECTURE beh OF sig_ass IS SIGNAL sum1,sum2 : INTEGER := 0; BEGIN p0: PROCESS WAIT FOR 10 ns; sum1 <= sum1 + 1; sum2 <= sum1 + 1; END PROCESS; END beh; Time sum sum2 10 10 + 1 Δ 1 1 20 1 1 20 + 1 Δ 2 2 30 2 2 30 + 1 Δ 3 3 Safety critical system failure could cause human life. Commercial critical systems: great financial loss if the product is recalled or is found to contain bugs Examples of undetected errors – Ariane 5 rocket explosion, 1996 (exception occurred when converting 64-bit floating number to a 16-bit integer) – Pentium bug (multiplier table not fully verified) – many more …. Somehow make debugging happen earlier where it is cheaper 9 9

Quiz 2  ENTITY and_or IS PORT ( a,b,c,d : IN STD_LOGIC; output : OUT STD_ULOGIC); END ENTITY; ARCHITECTURE beh OF and_or IS SIGNAL x,y : STD_LOGIC; BEGIN my_process : PROCESS (a,b,c,d) x <= a OR b; y <= c OR d; output <= x AND y; END PROCESS; END beh; Signals are updated at the end of a process. If a process is reading the value of signal, it will read the old (non-updated) value! Safety critical system failure could cause human life. Commercial critical systems: great financial loss if the product is recalled or is found to contain bugs Examples of undetected errors – Ariane 5 rocket explosion, 1996 (exception occurred when converting 64-bit floating number to a 16-bit integer) – Pentium bug (multiplier table not fully verified) – many more …. Somehow make debugging happen earlier where it is cheaper How to Solve this Bug! 10 10

Outline VHDL process If statement Sequential signal assignment statement Variable assignment statement If statement 11 11

If Statement Sequential Conditional Statement in VHDL Syntax if boolean_expr_1 then sequential_statements; elsif boolean_expr_2 then elsif boolean_expr_3 then . . . else end if; Safety critical system failure could cause human life. Commercial critical systems: great financial loss if the product is recalled or is found to contain bugs Examples of undetected errors – Ariane 5 rocket explosion, 1996 (exception occurred when converting 64-bit floating number to a 16-bit integer) – Pentium bug (multiplier table not fully verified) – many more …. Somehow make debugging happen earlier where it is cheaper 12 12

Example: 4x1 Mux Safety critical system failure could cause human life. Commercial critical systems: great financial loss if the product is recalled or is found to contain bugs Examples of undetected errors – Ariane 5 rocket explosion, 1996 (exception occurred when converting 64-bit floating number to a 16-bit integer) – Pentium bug (multiplier table not fully verified) – many more …. Somehow make debugging happen earlier where it is cheaper 13 13

Example: 2x4 Binary Decoder Safety critical system failure could cause human life. Commercial critical systems: great financial loss if the product is recalled or is found to contain bugs Examples of undetected errors – Ariane 5 rocket explosion, 1996 (exception occurred when converting 64-bit floating number to a 16-bit integer) – Pentium bug (multiplier table not fully verified) – many more …. Somehow make debugging happen earlier where it is cheaper 14 14

Example: 4-to-4 Priority Encoder Safety critical system failure could cause human life. Commercial critical systems: great financial loss if the product is recalled or is found to contain bugs Examples of undetected errors – Ariane 5 rocket explosion, 1996 (exception occurred when converting 64-bit floating number to a 16-bit integer) – Pentium bug (multiplier table not fully verified) – many more …. Somehow make debugging happen earlier where it is cheaper 4-to-2 priority encoder 15 15

Last Quiz  LIBRARY IEEE; USE IEEE.STD_LOGIC_1164.ALL; ARCHITECTURE beh OF mystery IS BEGIN p0: PROCESS (data_in1, select_in) IF select_in = '0' THEN output <= data_in1; ELSE output <= data_in2; END IF; END PROCESS; END beh; Safety critical system failure could cause human life. Commercial critical systems: great financial loss if the product is recalled or is found to contain bugs Examples of undetected errors – Ariane 5 rocket explosion, 1996 (exception occurred when converting 64-bit floating number to a 16-bit integer) – Pentium bug (multiplier table not fully verified) – many more …. Somehow make debugging happen earlier where it is cheaper 16 16