CEC 220 Digital Circuit Design VHDL in Sequential Logic Wednesday, March 25 CEC 220 Digital Circuit Design Slide 1 of 13.

Slides:



Advertisements
Similar presentations
VHDL Lecture 1 Megan Peck EECS 443 Spring 08.
Advertisements

©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.
28/10/2007DSD,USIT,GGSIPU1 Latch & Register Inference.
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.
History TTL-logic PAL (Programmable Array Logic)
Arbitrary Waveform Discussion 5.5 Example 34.
1 VLSI DESIGN USING VHDL Part II A workshop by Dr. Junaid Ahmed Zubairi.
Ring Counter Discussion D5.3 Example 32. Ring Counter if rising_edge(CLK) then for i in 0 to 2 loop s(i)
Modeling & Simulating ASIC Designs with VHDL Reference: Smith text: Chapters 10 & 12.
VHDL ELEC 418 Advanced Digital Systems Dr. Ron Hayne Images Courtesy of Thomson Engineering.
Logic Design Fundamentals - 3 Discussion D3.2. Logic Design Fundamentals - 3 Basic Gates Basic Combinational Circuits Basic Sequential Circuits.
Introduction to VHDL VHDL Tutorial R. E. Haskell and D. M. Hanna T1: Combinational Logic Circuits.
Registers VHDL Tutorial R. E. Haskell and D. M. Hanna T2: Sequential Logic Circuits.
Simple Sequential Circuits in VHDL. Contents Sequential circuit examples: - SR latch in dataflow style - D flip-flop in behavioral style - shift register.
6/12/20151 Sequence Detectors Lecture Notes – Lab 4 Sequence detection is the act of recognizing a predefined series of inputs A sequence detector is a.
FPGAs and VHDL Lecture L12.1. FPGAs and VHDL Field Programmable Gate Arrays (FPGAs) VHDL –2 x 1 MUX –4 x 1 MUX –An Adder –Binary-to-BCD Converter –A 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.
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.
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)
Advanced FPGA Based System Design Lecture-9 & 10 VHDL Sequential Code By: Dr Imtiaz Hussain 1.
1 Part I: VHDL CODING. 2 Design StructureData TypesOperators and AttributesConcurrent DesignSequential DesignSignals and VariablesState Machines A VHDL.
CprE / ComS 583 Reconfigurable Computing Prof. Joseph Zambreno Department of Electrical and Computer Engineering Iowa State University Lecture #17 – Introduction.
VHDL Introduction. V- VHSIC Very High Speed Integrated Circuit H- Hardware D- Description L- Language.
1 Sequential Logic Lecture #7. 모바일컴퓨팅특강 2 강의순서 Latch FlipFlop Shift Register Counter.
VHDL in 1h Martin Schöberl. AK: JVMHWVHDL2 VHDL /= C, Java,… Think in hardware All constructs run concurrent Different from software programming Forget.
ENG2410 Digital Design LAB #6 LAB #6 Sequential Logic Design (Flip Flops)
Copyright © 1997 Altera Corporation & 提供 What is VHDL Very high speed integrated Hardware Description Language (VHDL) –is.
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.
CEC 220 Digital Circuit Design More VHDL Fri, February 27 CEC 220 Digital Circuit Design Slide 1 of 15.
1 Sequential Logic Lecture #9. Sequential Logic 2 강의순서  FlipFlop  Active-high Clock & asynchronous Clear  Active-low Clock & asynchronous Clear  Active-high.
 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.
CEC 220 Digital Circuit Design Latches and Flip-Flops Monday, March 03 CEC 220 Digital Circuit Design Slide 1 of 19.
04/26/20031 ECE 551: Digital System Design & Synthesis Lecture Set : Introduction to VHDL 12.2: VHDL versus Verilog (Separate File)
VHDL Hardware Description Language. GUIDELINES How to write HDL code: How to write HDL code:
Controllers ENGIN 341 – Advanced Digital Design University of Massachusetts Boston Department of Engineering Dr. Filip Cuckov.
CDA 4253 FPGA System Design Sequential Circuit Building Blocks Hao Zheng Dept of Comp Sci & Eng USF.
1 Sequential Logic Lecture #7. 모바일컴퓨팅특강 2 강의순서 Latch FlipFlop Active-high Clock & asynchronous Clear Active-low Clock & asynchronous Clear Active-high.
ECE DIGITAL LOGIC LECTURE 20: REGISTERS AND COUNTERS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 11/19/2015.
CEC 220 Digital Circuit Design Latches and Flip-Flops
George Mason University Behavioral Modeling of Sequential-Circuit Building Blocks ECE 545 Lecture 8.
Data Flow and Behavioral Modeling in VHDL 1 MS EMBEDDED SYSTEMS.
Registers and Counters Discussion D8.1. Logic Design Fundamentals - 3 Registers Counters Shift Registers.
Algorithmic State Machine (ASM) Charts: VHDL Code & Timing Diagrams
Sequential statements (1) process
Combinational logic circuit
LAB #6 Sequential Logic Design (Flip Flops, Shift Registers)
Main Project : Simple Processor Mini-Project : Vending Machine Memory
Describing Combinational Logic Using Processes
B e h a v i o r a l to R T L Coding
Part II A workshop by Dr. Junaid Ahmed Zubairi
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
Part IV: VHDL CODING.
Sequential-Circuit Building Blocks
Algorithmic State Machine (ASM) Charts: VHDL Code & Timing Diagrams
ECE 434 Advanced Digital System L08
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
VHDL VHSIC Hardware Description Language VHSIC
RTL Style در RTL مدار ترتيبي به دو بخش (تركيبي و عناصر حافظه) تقسيم مي شود. مي توان براي هر بخش يك پروسس نوشت يا براي هر دو فقط يك پروسس نوشت. مرتضي صاحب.
Behavioral Modeling of Sequential-Circuit Building Blocks
Sequntial-Circuit Building Blocks
CprE / ComS 583 Reconfigurable Computing
Sequntial-Circuit Building Blocks
4-Input Gates VHDL for Loops
(Sequential-Circuit Building Blocks)
EEL4712 Digital Design (Midterm 1 Review).
Presentation transcript:

CEC 220 Digital Circuit Design VHDL in Sequential Logic Wednesday, March 25 CEC 220 Digital Circuit Design Slide 1 of 13

Lecture Outline Wednesday, March 25 CEC 220 Digital Circuit Design Sequential Logic in VHDL Design of Registers & Counters in VHDL Slide 2 of 13

VHDL in Sequential Logic Wednesday, March 25 CEC 220 Digital Circuit Design Architecture Statements  All architecture statements execute concurrently Process Statements – Sequential execution  The Process statement executes when any signal in the sensitivity list changes architecture my_arc1 of my_box is signal sig1: bit; begin ?? <= ???; end my_arc1; process (CLK, …) begin ?? <= ???; end process; Slide 3 of 13 entity name

VHDL in Sequential Logic Wednesday, March 25 CEC 220 Digital Circuit Design Conditional Assignment Statements  Outside of process blocks (concurrent statements)  Inside process blocks (sequential statements) F <= IN0 when A = “00” else IN1 when A = “01” else IN2 when A = “10” else IN3; with A select F <= IN0 when A = “00”, IN1 when A = “01”, IN2 when A = “10”, IN3 when others; or if A = “00” then F <= IN0; elsif A = “01” then F <= IN1; elsif A = “10” then F <= IN2; else F <= IN3; end if; or case A is when “00” => F <= IN0; when “01” => F <= IN1; when “10” => F <= IN2; when others => F <= IN3; end case; Slide 4 of 13

VHDL in Sequential Logic Wednesday, March 25 CEC 220 Digital Circuit Design Modeling a Gated S-R LatchGated S-R Latch S Q G R process (G,S,R) begin if G=‘1’ then if S=‘1’ and R=‘0’ then Q<=‘1’; end if; if S=‘0’ and R=‘1’ then Q<=‘0’; end if; end if; end process; Gate lowHoldSetReset - Why is the S=0 & R=0 case not included? - What will Q be when S=1 & R=1 (from the code above)? Slide 5 of 13

VHDL in Sequential Logic Wednesday, March 25 CEC 220 Digital Circuit Design Modeling a Gated D LatchGated D Latch D Q G process (D, G) begin if G =‘1’ then Q <= D; end if; end process; Gate low Slide 6 of 13 Gate highGate low - Why is the G = ‘0’ case not included?

VHDL in Sequential Logic Wednesday, March 25 CEC 220 Digital Circuit Design Modeling a JK Flip-Flop with Async. Set & ResetJK Flip-Flop entity JKFF is port( J, K, SetN, RstN, CLK : in bit; -- inputs Q, QN: out bit); -- Q and QN are the outputs end JKFF; architecture JKFF_eqns of JKFF is signal Qint: bit; -- Internal value of Q begin Q <= Qint; QN <= not Qint; process(SetN, RstN, CLK) -- Asyncronous Set and Reset begin if RstN='0' then Qint <='0' after 5 ns; elsif SetN='0' then Qint <='1' after 5 ns; elsif CLK'event and CLK = '0' then -- falling edge of CLK Qint <= (J and not Qint) or (not K and Qint) after 10 ns; end if; end process; end JKFF_eqns ; Slide 7 of 13 - What will happen if RstN = ‘0’ & SetN = ‘0’ ? - Why are J & K not in the sensitivity list ?

VHDL in Sequential Logic Wednesday, March 25 CEC 220 Digital Circuit Design Modeling a JK Flip-Flop with Set & ResetJK Flip-Flop  A simulation example Slide 8 of 13 HoldSetToggleRNResetHoldSNToggle

VHDL in Sequential Logic Wednesday, March 25 CEC 220 Digital Circuit Design Modeling a 3-bit Rotating RegisterRotating Register entity DFF is port ( D, CLK : in bit; Q: out bit); end DFF; entity ROTATER is port ( clk: in bit; Qout: out bit_vector(0 to 2) :="100"); end ROTATER; architecture DFF_eqns of DFF is begin process(CLK) begin if CLK'event and CLK = '0' then Q <= D; end if; end process; end DFF_eqns; signal Q0, Q1, Q2: bit; begin FF0: DFF port map(Q2, CLK, Q0); FF1: DFF port map(Q0, CLK, Q1); FF2: DFF port map(Q1, CLK, Q2); Qout <= Q0 & Q1 & Q2; end ROTATING_REG; architecture ROTATING_REG of ROTATER is component DFF port ( D, CLK: in bit; Q: out bit); end component; CLK Initialization Slide 9 of 13

VHDL in Sequential Logic Wednesday, March 25 CEC 220 Digital Circuit Design Simulation results  Q 0 Q 1 Q 2 was initialized to be “100” Slide 10 of

VHDL in Sequential Logic Using the IEEE Library Wednesday, March 25 CEC 220 Digital Circuit Design A 16-bit Up-Counter16-bit Up-Counter 16 Registers + 1 rstclk q library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity counter is port ( clk, rst: in std_logic; q: out std_logic_vector(15 downto 0)); end counter; architecture my_logic of counter is signal q_tmp: std_logic_vector(15 downto 0); begin process(clk, rst) begin if rst = '0' then q_tmp <= " "; elsif rising_edge(clk) then q_tmp <= q_tmp + 1; end if; end process; q <= q_tmp; end my_logic; The ‘+’ operator causes the generation of a 16-bit adder in hardware!! The “rising_edge” and “falling_edge” functions are defined in the IEEE Library Slide 11 of 13

VHDL in Sequential Logic Using the IEEE Library Wednesday, March 25 CEC 220 Digital Circuit Design A 16-bit Up-Counter16-bit Up-Counter 16 Registers + 1 rstclk q Slide 12 of 13

Next Lecture Wednesday, March 25 CEC 220 Digital Circuit Design Mealy and Moore State Machines Slide 13 of 13