28/10/2007DSD,USIT,GGSIPU1 Latch & Register Inference.

Slides:



Advertisements
Similar presentations
Registers and Counters. Register Register is built with gates, but has memory. The only type of flip-flop required in this class – the D flip-flop – Has.
Advertisements

Flip-Flops, Registers, Counters, and a Simple Processor
1 Sequential Circuits Dr. Pang. 2 Outline Introduction to sequential circuits Basic latch Gated SR latch and gated D latch D flip-flop, T flip-flop, JK.
L18 – VHDL for other counters and controllers. Other counters  More examples Gray Code counter Controlled counters  Up down counter  Ref: text Unit.
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)
Logic Design Fundamentals - 3 Discussion D3.2. Logic Design Fundamentals - 3 Basic Gates Basic Combinational Circuits Basic Sequential 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/27/20061 Sequence Detectors Lecture Notes – Lab 5 Sequence detection is the act of recognizing a predefined series of inputs A sequence detector is a.
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.
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.
CSCI 660 EEGN-CSCI 660 Introduction to VLSI Design Lecture 3 Khurram Kazi Some of the slides were taken from K Gaj ’ s lecture slides from GMU ’ s VHDL.
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.
Sequencing and Control Mano and Kime Sections 8-1 – 8-7.
Shift Registers Discussion D5.2 Example Bit Shift Register qs(3) qs(2) qs(1) qs(0) if rising_edge(CLK) then for i in 0 to 2 loop s(i) := s(i+1);
Registers and Counters
ECE 301 – Digital Electronics Flip-Flops and Registers (Lecture #15)
4-bit Shift Register. 2-bit Register Serial-in-serial-out Shift Register.
System Arch 2008 (Fire Tom Wada) /10/9 Field Programmable Gate Array.
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.
1 Sequential Logic Lecture #7. 모바일컴퓨팅특강 2 강의순서 Latch FlipFlop Shift Register Counter.
ENG2410 Digital Design LAB #6 LAB #6 Sequential Logic Design (Flip Flops)
ENG241 Digital Design Week #8 Registers and Counters.
Main Project : Simple Processor Mini-Project : 3-bit binary counter (using 7400 series) Memory By Oluwayomi B. Adamo.
15-Dec-15EE5141 Chapter 4 Sequential Statements ä Variable assignment statement ä Signal assignment statement ä If statement ä Case statement ä Loop statement.
2/10/07DSD,USIT,GGSIPU1 BCD adder KB3B2B1B0CD3D2D1D
VHDL Discussion Sequential Sytems. Memory Elements. Registers. Counters IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
 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 VHDL in Sequential Logic Wednesday, March 25 CEC 220 Digital Circuit Design Slide 1 of 13.
Digital System Design using VHDL
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.
George Mason University Behavioral Modeling of Sequential-Circuit Building Blocks ECE 545 Lecture 8.
Counters and registers Eng.Maha Alqubali. Registers Registers are groups of flip-flops, where each flip- flop is capable of storing one bit of information.
Registers and Counters Discussion D8.1. Logic Design Fundamentals - 3 Registers Counters Shift Registers.
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
Registers and Counters
Figure 7.1 Control of an alarm system
Part II A workshop by Dr. Junaid Ahmed Zubairi
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
Part IV: VHDL CODING.
ECE 4110–5110 Digital System Design
ECE 4110–5110 Digital System Design
Latches, Flip-Flops and Registers
Sequential-Circuit Building Blocks
Field Programmable Gate Array
Field Programmable Gate Array
Field Programmable Gate Array
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
RTL Style در RTL مدار ترتيبي به دو بخش (تركيبي و عناصر حافظه) تقسيم مي شود. مي توان براي هر بخش يك پروسس نوشت يا براي هر دو فقط يك پروسس نوشت. مرتضي صاحب.
VHDL (VHSIC Hardware Description Language)
Concurrent vs Sequential
Behavioral Modeling of Sequential-Circuit Building Blocks
Sequntial-Circuit Building Blocks
Figure 8.1. The general form of a sequential circuit.
1) Latched, initial state Q =1
Single bit comparator Single bit comparator 4/10/2007 DSD,USIT,GGSIPU
CprE / ComS 583 Reconfigurable Computing
Sequntial-Circuit Building Blocks
(Sequential-Circuit Building Blocks)
Presentation transcript:

28/10/2007DSD,USIT,GGSIPU1 Latch & Register Inference

28/10/2007DSD,USIT,GGSIPU2 Latch Inference In non-clocked processes, incompletely specified if and case statements cause synthesizers to infer latches for the variables and signals being assigned.

28/10/2007DSD,USIT,GGSIPU3 Example --data_out is a latch Process(somesignal) Begin if (somesignal=‘1’) then data_out<= data_in; end if; End process; Process (somesignal) Begin case somesignal is when ‘0’ => data_out<= data_in; End case; End process; A latch is inferred for the signal data_out because is not assigned under all possible conditions. If the tested condition fails then data_out must hold the previous value.

28/10/2007DSD,USIT,GGSIPU4 Definition Basic Latch is a feedback connection of two NOR gates or two NAND gates, which can store one bit of information. It can be set to 1 using the S input and reset to 0 using the R input. Gated Latch is a basic latch that includes input gating and a control input signal. The latch retains its existing state when the control input equals to 0. Its state may be changed when the control signal is equal to 1.

28/10/2007DSD,USIT,GGSIPU5 Definition (cont..) Flip Flop: A flip flop is a storage element based on the gated latch principle, which can have its output state changed only on the edge of the controlling clock signal. Two types of FF: –Edge Triggered FF –Level triggered FF

28/10/2007DSD,USIT,GGSIPU6 VHDL code for gated D-FF entity dff is Port ( d : in std_logic; clk : in std_logic; reset: in std_logic; q : out std_logic); end dff; architecture Behavioral of dff is begin process(clk,reset) begin if (reset ='1') then q <= '0'; elsif (clk'event and clk='1') then q <= d;end if; end process; end Behavioral;

28/10/2007DSD,USIT,GGSIPU7 Waveform of D-ff

28/10/2007DSD,USIT,GGSIPU8 Register A flip-flop stores one bit of information. When a set of n flip-flops is used to store n bits of information, such as an n-bit number, it is called Register. A common clock is used for each flip-flop in a register.

28/10/2007DSD,USIT,GGSIPU9 A simple shift register

28/10/2007DSD,USIT,GGSIPU10 Shift Left Register entity shifleft is Port ( newdata : in std_logic; datain : in std_logic_vector(3 downto 0); dataout : out std_logic_vector(3 downto 0); clk : in std_logic; reset : in std_logic); end shifleft; architecture Behavioral of shifleft is begin process (clk,reset,newdata) begin if (reset='1') thendataout <= "0000"; elsif (clk'event and clk='0') then dataout <= datain(2 downto 0) & newdata; end if; end process; end Behavioral;

28/10/2007DSD,USIT,GGSIPU11 Waveform of Shift Left

28/10/2007DSD,USIT,GGSIPU12 VHDL code for Right Shift Register entity shiftReg is Port ( datain : in std_logic_vector(3 downto 0); newdata : in std_logic; dataout : out std_logic_vector(3 downto 0); clk : in std_logic; reset : in std_logic); end shiftReg; architecture Behavioral of shiftReg is begin process(clk,reset) begin if (reset ='1') thendataout <= "0000"; elsif (clk'event and clk='0') then dataout <= newdata & datain(3 downto 1); end if; end process; end Behavioral;

28/10/2007DSD,USIT,GGSIPU13 Waveform of shift Right register

28/10/2007DSD,USIT,GGSIPU14 VHDL code for shift register entity shiftRegester is Port ( reset,clk,w : in std_logic; q : out std_logic_vector(3 downto 0)); end shiftRegester; architecture Behavioral of shiftRegester is signal temp : std_logic_vector(3 downto 0); begin process(clk,reset) beginif (reset ='0') then q '0'); elsif (clk'event and clk='1') then genbits: for i in 3 downto 1 loop temp(i) <= temp(i-1); end loop; temp(0) <= w; end if; q <= temp; end process; end Behavioral;

28/10/2007DSD,USIT,GGSIPU15 Waveform of shift register

28/10/2007DSD,USIT,GGSIPU16 Serial-in Serial-out Shift Register

28/10/2007DSD,USIT,GGSIPU17 Serial in Parallel out

28/10/2007DSD,USIT,GGSIPU18 counter entity counterUP is Port ( clk : in std_logic; load: in std_logic; d : in std_logic_vector(3 downto 0); reset : in std_logic; e : in std_logic; q : out std_logic_vector(3 downto 0)); end counterUP;

28/10/2007DSD,USIT,GGSIPU19 architecture Behavioral of counterUP is signal count: std_logic_vector(3 downto 0); begin process(clk,reset,load,d) begin if (load='1') then count <= d;-- loadable counter elsif (reset='0') then count <= "0000"; elsif (clk'event and clk='0') then if (count="1001") then-- decade counter count <= "0000" ; elsif (e ='1') then count <= count + 1; else count <= count - 1; end if; end process;q <= count; end Behavioral;

28/10/2007DSD,USIT,GGSIPU20 Waveform of counter design