CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC

Slides:



Advertisements
Similar presentations
©2004 Brooks/Cole FIGURES FOR CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC Click the mouse to move to the next page. Use the ESC key to exit this chapter. This.
Advertisements

28/10/2007DSD,USIT,GGSIPU1 Latch & Register Inference.
Fundamentals of Digital Signal Processing יהודה אפק, נתן אינטרטור אוניברסיטת תל אביב.
Arbitrary Waveform Discussion 5.5 Example 34.
1 VLSI DESIGN USING VHDL Part II A workshop by Dr. Junaid Ahmed Zubairi.
VHDL ELEC 418 Advanced Digital Systems Dr. Ron Hayne Images Courtesy of Thomson Engineering.
Simple Sequential Circuits in VHDL. Contents Sequential circuit examples: - SR latch in dataflow style - D flip-flop in behavioral style - shift register.
Counters Discussion D5.3 Example 33. Counters 3-Bit, Divide-by-8 Counter 3-Bit Behavioral Counter in Verilog Modulo-5 Counter An N-Bit Counter.
ECE C03 Lecture 18ECE C03 Lecture 61 Lecture 18 VHDL Modeling of Sequential Machines Prith Banerjee ECE C03 Advanced Digital Design Spring 1998.
Kazi Fall 2006 EEGN 4941 EEGN-494 HDL Design Principles for VLSI/FPGAs Khurram Kazi Some of the slides were taken from K Gaj’s lecture slides from GMU’s.
HDL-Based Digital Design Part I: Introduction to VHDL (I) Dr. Yingtao Jiang Department Electrical and Computer Engineering University of Nevada Las Vegas.
VHDL And Synthesis Review. VHDL In Detail Things that we will look at: –Port and Types –Arithmetic Operators –Design styles for Synthesis.
4-bit Shift Register. 2-bit Register Serial-in-serial-out Shift Register.
Introduction to VHDL (part 2)
CprE / ComS 583 Reconfigurable Computing Prof. Joseph Zambreno Department of Electrical and Computer Engineering Iowa State University Lecture #17 – Introduction.
Chapter 10 State Machine Design. 2 State Machine Definitions State Machine: A synchronous sequential circuit consisting of a sequential logic section.
VHDL Introduction. V- VHSIC Very High Speed Integrated Circuit H- Hardware D- Description L- Language.
ELEC / Computer Architecture and Design Fall 2009 ELEC / Computer Architecture and Design Fall 2009 Modeling for Synthesis.
VHDL in 1h Martin Schöberl. AK: JVMHWVHDL2 VHDL /= C, Java,… Think in hardware All constructs run concurrent Different from software programming Forget.
ENG241 Digital Design Week #8 Registers and Counters.
VHDL for Combinational Circuits. VHDL We Know Simple assignment statements –f
Introduction to VHDL Simulation … Synthesis …. The digital design process… Initial specification Block diagram Final product Circuit equations Logic design.
15-Dec-15EE5141 Chapter 4 Sequential Statements ä Variable assignment statement ä Signal assignment statement ä If statement ä Case statement ä Loop statement.
VHDL Discussion Sequential Sytems. Memory Elements. Registers. Counters IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology.
 Seattle Pacific University EE Logic System DesignCounters-1 Shift Registers DQ clk DQ DQ ShiftIn Q3Q3 Q2Q2 DQ Q1Q1 Q0Q0 A shift register shifts.
1 Part III: VHDL CODING. 2 Design StructureData TypesOperators and AttributesConcurrent DesignSequential DesignSignals and VariablesState Machines A VHDL.
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)
CEC 220 Digital Circuit Design VHDL in Sequential Logic Wednesday, March 25 CEC 220 Digital Circuit Design Slide 1 of 13.
CDA 4253 FPGA System Design Sequential Circuit Building Blocks Hao Zheng Dept of Comp Sci & Eng USF.
ENG241 Digital Design Week #7 Sequential Circuits (Part B)
ECE DIGITAL LOGIC LECTURE 20: REGISTERS AND COUNTERS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 11/19/2015.
Unit 4 Structural Descriptions SYLLABUS Highlights of Structural descriptions Organization of the Structural descriptions Binding State Machines Generate(HDL),Generic(VHDL),
George Mason University Behavioral Modeling of Sequential-Circuit Building Blocks ECE 545 Lecture 8.
Joal 2006 HT:1 Em3 Digital Electronics Design 1 Lecture 3-4 Sequential VHDLChap 4.
Data Flow and Behavioral Modeling in VHDL 1 MS EMBEDDED SYSTEMS.
Fundamentals of Digital Signal Processing יהודה אפק, נתן אינטרטור אוניברסיטת תל אביב.
Sequential statements (1) process
Combinational logic circuit
LAB #6 Sequential Logic Design (Flip Flops, Shift Registers)
Week #7 Sequential Circuits (Part B)
Basic Language Concepts
Registers and Counters
ECE 448 Lecture 6 Finite State Machines State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts, and VHDL Code.
B e h a v i o r a l to R T L Coding
Part II A workshop by Dr. Junaid Ahmed Zubairi
Introduction Introduction to VHDL Entities Signals Data & Scalar Types
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
Part IV: VHDL CODING.
ECE 4110–5110 Digital System Design
VHDL 5 FINITE STATE MACHINES (FSM)
Sequential-Circuit Building Blocks
UNIT 2: Data Flow description
CPE/EE 422/522 Advanced Logic Design L06
ECE 434 Advanced Digital System L08
RTL Style در RTL مدار ترتيبي به دو بخش (تركيبي و عناصر حافظه) تقسيم مي شود. مي توان براي هر بخش يك پروسس نوشت يا براي هر دو فقط يك پروسس نوشت. مرتضي صاحب.
ELEC 5200/6200 Computer Architecture and Design Review of VHDL
VHDL (VHSIC Hardware Description Language)
Concurrent vs Sequential
CSE 370 – Winter Sequential Logic-2 - 1
CPE 528: Lecture #5 Department of Electrical and Computer Engineering University of Alabama in Huntsville.
Behavioral Modeling of Sequential-Circuit Building Blocks
Sequntial-Circuit Building Blocks
Figure 8.1. The general form of a sequential circuit.
ECE 448 Lecture 6 Finite State Machines State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts, and VHDL code ECE 448 – FPGA and ASIC Design.
CprE / ComS 583 Reconfigurable Computing
Sequntial-Circuit Building Blocks
(Sequential-Circuit Building Blocks)
EEL4712 Digital Design (Midterm 1 Review).
Presentation transcript:

CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC 17.1 Modeling Flip-Flops Using VHDL Processes 17.2 Modeling Registers and Counters Using VHDL Processes 17.3 Modeling Combinational Logic Using VHDL Processes 17.4 Modeling a Sequential Machine 17.5 Synthesis of VHDL Code 17.6 More About Processes and Sequential Statements

Objectives VHDL expression for F/F,Shift register,counter Sequential VHDL using process, if-else,case,wait.. 3. Combination logic using process 4. VHDL : Two processes, update F/F, ROM and F/F’s 5. Given VHDL, draw the corresponding logic 6. Compile, simulate, synthesize a circuit

17.1 modeling Flip-Flops Using VHDL Processes VHDL Code for a Simple D Flip-Flop VHDL Code for a Transparent Latch

17.1 modeling Flip-Flops Using VHDL Processes VHDL Code For a D Flip-flop with Asynchronous Clear process(sensitivity-list) Begin sequential-statements end process; A basic process has the following form:

17.1 modeling Flip-Flops Using VHDL Processes if condition then sequential statements1 else sequential statements2 end if; The basic if statement has the form if condition then sequential statements {elsif condition then --0 or more elsif clauses may be included [else sequential statements] end if; The most general form of the if statement is

17.1 modeling Flip-Flops Using VHDL Processes Equivalent Representations of a Flow Chart Using Nested Ifs and Elsifs

17.1 modeling Flip-Flops Using VHDL Processes entity JKFF is --- inputs port(SN,RN,J,K,CLK:in bit; Q,QN:out bit); end JKFF; architecture JKFF1 of JKFF is signal Qint:bit; --- internal value of Q begin Q<=Qint; QN<=not Qint; process(SN,RN,CLK) if RN=‘0’ then Qint<=‘0’ after 8ns; --- RN=‘0’ will clear the FF elsif SN=‘0’ then Qint<=‘1’ after 8ns; --- SN=‘0’ will set the FF elsif CLK’ event and CLK =‘0’ then --- falling edge of CLK Qint<=(J and not Qint) or (not K and Qint) after 10ns; end if; end process; end JKFF1; J-K Flip-Flop Model (Figure 17-6)

17.2 Modeling Registers and Counters Using VHDL Processes Cyclic Shift Register (Figure 17-7) If we omit the delay and replace the sequential statements with the operation is basically the same.

17.2 Modeling Registers and Counters Using VHDL Processes Register with Synchronous Clear and Load (Figure 17-8) Left-Shift Register With Synchronous Clear and Load (Figure 17-9)

17.2 Modeling Registers and Counters Using VHDL Processes VHDL Code for a Simple Synchronous Counter (Figure 17-10) Two 74163 Counter Cascaded To Form an 8-Bit Counter (Figure 17-11)

17.2 Modeling Registers and Counters Using VHDL Processes Operation of the counter is as follows: If ClrN=0, all flip-flops are set to 0 following the rising clock edge. If ClrN=1 and LdN=0, the D inputs are transferred in parallel to the flip-flops following the rising clock edge. If ClrN=LdN=1 and P=T=1, the count is enabled and the enabled and the counter state will be incremented by 1 following the rising clock edge. If T=1, the counter generates a carry( ) in state 15, so

17.2 Modeling Registers and Counters Using VHDL Processes Operation (Table 17-1)

17.2 Modeling Registers and Counters Using VHDL Processes (Figure 17-12) library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity c74163 is port(LdN.ClrN,P,T,CLK: in std_logic; D: in std_logic_vector(3 downto 0); Cout: out std_logic; Qot: out std_logic_vector(3 downto 0)); end c74163; architecture b74163 of c74163 is signal Q:std_logic_vector>(3 downto 0); --- Q is the counter register begin Qout <=Q; Cout <= Q(3) and Q(2) and Q(1) and Q(0) and T; process (Clk) if Clk’ event and Clk=‘1’ then --- change state on rising edge if ClrN=‘0’ then Q<=“000”; elsif LdN=‘0’ then Q<=D; elsif (P and T) = ‘1’ then Q<=Q+1; end if; end process; end b74163

17.2 Modeling Registers and Counters Using VHDL Processes VHDL for 8-Bit Counter (Figure 17-13) -- Test module for 74163 counter library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity c74163test is port(ClrN,LdN,P,T,CLK: in std_logic; Din1,Din2: in std_logic_vector (3 downto 0); Count: out integer range 0 to 255; Carry2: out std_logic); End c74163test; Architecture tester of c74163test is component c74163 port(LdN,ClrN,P,T,Clk:in std_logic; D: in std_logic_vector(3 downto 0); Cout: out std_logic; Qout: out std_logic_vector (3 downto 0)); end component; signal Carry1:std_logic; signal Qout1, Qout2:std_logic-vector (3 downto 0); begin ct1: c74163 port map (LdN,ClrN,P,T1,Clk,Din1, Carry1, Qout1); ct2: c74163 port map (LdN, ClrN, P, Carry1, Clk, Din2, Carry2, Qout2); Count<=Conv_integer(Qout2 & Qout1); end tester;

17.3 Modeling Combination Logic Using VHDL Processes VHDL Code for Gate Circuit (Figure 17-14) The following listing summarizes the operation:

17.3 Modeling Combination Logic Using VHDL Processes The 4-to-1 MUX of Figure 10-7 can be modeled as follows: signal sel: bit_vector(0 to 1); ----------------------------------- Sel<=A&B; -- a concurrent statement, outside of the process process (sel,I0, I1, I2, I3) begin case sel is -- a sequential statement in the process when “00” => F <= I0; when “01” => F <= I1; when “10” => F <= I2; when “11” => F <= I3; when others => null; -- require if sel is a std_logic_vector; -- omit if sel is a bit_vector end case; end process;

17.3 Modeling Combination Logic Using VHDL Processes The case statement has the general form: case expression is when choice1 => sequential statements1 when shoice2 => sequential statements2 … [when others => sequential statements] end case; If no action is specified for the other choices, the clause should be When other => null;

17.4 Modeling a Sequential Machine State Table for Code Converter (Table 17-2) General Model of Mealy Sequential Machine (Figure 17-15)

17.4 Modeling a Sequential Machine A typical sequence fo execution for the two process is as follows: X changes and the first process executes. New values of Z and NextState are computed. The clock falls, and the second process executes. Beause CLK=‘0’, nothing happens. The clock rises, and the second process executes again. Bcause CLK=‘1’,State is set equal to the Nextstate value. If State changes, the first process executes again. New values of Z and Nextstate are computed.

17.4 Modeling a Sequential Machine Behavioral model for Table 17-2 (Figure 17-16)

17.4 Modeling a Sequential Machine

17.4 Modeling a Sequential Machine Waveforms for figure 17-16 (Figure 17-17)

17.4 Modeling a Sequential Machine Sequential machine Model using Equations (Figure 17-18)

17.4 Modeling a Sequential Machine Structural Model of Sequential Machine (Figure 17-19)

17.4 Modeling a Sequential Machine Waveforms for Figure 16-4 (Figure 17-20)

17.4 Modeling a Sequential Machine using a ROM (Figure 17-21)

17.4 Modeling a Sequential Machine Partial VHDL Code for the Table of Figure 13-4 (Figure 17-22)

17.5 Synthesis of VHDL Code Synthesis of VHDL Code From Figure 17-9

17.5 Synthesis of VHDL Code VHDL Code and Synthesis Results for 4-Bit Adder with Accumulator (Figure 17-24)

17.6 More About Processes And Sequential Statements Process with wait statements may have the form process begin sequential-statements wait-statement … end process; Wait statements can be of three different forms: wait on sensitivity-list; wait for time-expression; wait until Boolean-expression;

17.6 More About Processes And Sequential Statements begin C<=A and B after 5ns; E<=C or D after 5ns; wait on A,B,C,D; end process; Therefore, the following process is equivalent to the one in Figure 17-14: process begin wait until clk’event and clk=‘1’; A<=E after 10ns; --(1) B<=F after 5ns; --(2) C<=G; --(3) D<=H after 5ns; --(4) end process; Consider the following example:

17.6 More About Processes And Sequential Statements If several VHDL statements in a process update the same signal at a given time, last value overrides. For example, process(CLK) begin if CLK’event and CLK = ‘0’ then Q<=A; Q<=B; Q<=C; end if; end process;