Dept. of Info. & Comm. Eng. Prof. Jongbok Lee

Slides:



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

L18 – VHDL for other counters and controllers. Other counters  More examples Gray Code counter Controlled counters  Up down counter  Ref: text Unit.
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)
Generic Multiplexers: Parameters Discussion D2.5 Example 8.
Logic Design Fundamentals - 3 Discussion D3.2. Logic Design Fundamentals - 3 Basic Gates Basic Combinational Circuits Basic Sequential Circuits.
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.
Digilab 7-Segment Displays Lab 4. selyInstruction name “000”true if b = a false otherwise = “001”true if b /= a false otherwise “010”true if b < a.
Introduction to VHDL Multiplexers Discussion D1.1.
Introduction to Counter in VHDL
4-bit Shift Register. 2-bit Register Serial-in-serial-out Shift Register.
Copyright (c) 2003 by Valery Sklyarov and Iouliia Skliarova: DETUA, IEETA, Aveiro University, Portugal.
Design Verification VHDL ET062G & ET063G Lecture 5 Najeem Lawal 2012.
Graduate Computer Architecture I VHDL Structure and Testing Michael Sorensen.
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.
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.
Main Project : Simple Processor Mini-Project : 3-bit binary counter (using 7400 series) Memory By Oluwayomi B. Adamo.
George Mason University ECE 545 – Introduction to VHDL Variables, Functions, Memory, File I/O ECE 545 Lecture 7.
Copyright(c) 1996 W. B. Ligon III1 Getting Started with VHDL VHDL code is composed of a number of entities Entities describe the interface of the component.
ECE 448: Spring 11 Lab 3 Part 2 Finite State Machines.
15-Dec-15EE5141 Chapter 4 Sequential Statements ä Variable assignment statement ä Signal assignment statement ä If statement ä Case statement ä Loop statement.
Copyright (c) 2003 by Valery Sklyarov and Iouliia Skliarova: DETUA, IEETA, Aveiro University, Portugal.
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.
CEC 220 Digital Circuit Design VHDL in Sequential Logic Wednesday, March 25 CEC 220 Digital Circuit Design Slide 1 of 13.
Sequential Logic Design by VHDL
Copyright (c) 2003 by Valery Sklyarov and Iouliia Skliarova: DETUA, IEETA, Aveiro University, Portugal.
INF H131 Clock and Reset Unit (CRU) module library ieee; use ieee.std_logic_1164.all; entity cru is port ( arst : in std_logic; -- Asynch. reset.
George Mason University Behavioral Modeling of Sequential-Circuit Building Blocks ECE 545 Lecture 8.
Registers and Counters Discussion D8.1. Logic Design Fundamentals - 3 Registers Counters Shift Registers.
How to use ISE Dept. of Info & Comm. Eng. Prof. Jongbok Lee.
Dept. of Electronics. & Info. Eng. Prof. Jongbok Lee
Sequential statements (1) process
Main Project : Simple Processor Mini-Project : Vending Machine Memory
Registers and Counters
PCIe control interface for user logic.
Figure 7.1 Control of an alarm system
B e h a v i o r a l to R T L Coding
Part II A workshop by Dr. Junaid Ahmed Zubairi
Dept. of Electronics & Info. Eng. Prof. Jongbok Lee
Chapter 5. Code converter
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
Part IV: VHDL CODING.
ECE 4110–5110 Digital System Design
Sequential-Circuit Building Blocks
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
RTL Style در RTL مدار ترتيبي به دو بخش (تركيبي و عناصر حافظه) تقسيم مي شود. مي توان براي هر بخش يك پروسس نوشت يا براي هر دو فقط يك پروسس نوشت. مرتضي صاحب.
مدار های ترکیبی دیکدر لامپ های هفت قسمتی یکی از دیکدر هایی که اغلب به کار برده می شود،دیکدر 4 به 7 برای تبدیل کد bcd به کد هفت بیتی برای لامپ های seven.
Software Environment ISE 5.x Interaction with simple LCDs
Block Diagrams 1.
CPE 528: Lecture #5 Department of Electrical and Computer Engineering University of Alabama in Huntsville.
Fibonacci Sequence Lecture L4.1 Lab 3.
Behavioral Modeling of Sequential-Circuit Building Blocks
Sequntial-Circuit Building Blocks
Modeling of Circuits with a Regular Structure
Figure 8.1. The general form of a sequential circuit.
Fast, Asynchronous SRAM
Modeling of Circuits with Regular Structure
CprE / ComS 583 Reconfigurable Computing
Sequntial-Circuit Building Blocks
High-Low Guessing Game
디 지 털 시 스 템 설 계 UP2 Kit를 이용한 카운터 설계
(Sequential-Circuit Building Blocks)
Presentation transcript:

Dept. of Info. & Comm. Eng. Prof. Jongbok Lee Ch 10. Counter Dept. of Info. & Comm. Eng. Prof. Jongbok Lee

1.Asynchronous Reset Counters [1] Basic Synchronous Counter with asynchronous reset entity cnt8 is port (clk,reset : in std_logic; q : inout std_logic_vector(7 downto 0)); end cnt8; architecture behavioral of cnt8 is begin process(clk,reset,q) if (reset=‘1’) then q <= “00000000”; elsif (clk’event and clk=‘1’) then q <= q + 1; end if; end process; end behavioral; vcom cnt8.vhd vsim cnt8 view wave add wave * force clk 0 0ns,1 10ns -r 20ns force reset 1 run 40ns force reset 0 run 2000ns

[Counter for Emulation] library unisim; use unisim.vcomponents.all; entity bin_counter is port ( clk,reset : in std_logic: q : inout std_logic_vector(3 downto 0)); end bin_counter; architecture behaviroal of bin_counter is component ibuf port (i:in std_logic; o:out std_logic); end component; component bufg port (i:in std_logic; o:out std_logic); end component; signal tmp,rclk : std_logic; begin u1 : ibuf port map (i=>clk,o=>tmp); u2 : bufg port map (i=>tmp, o=>rclk); process(rclk,reset,q) if (reset=‘0’) then q<=“0000”; elsif (rclk’event and rclk=‘1’) then q <= q + 1; end if; end process; end behavioral;

Signal Pin No. Cable Connections clk H4 JP5.1 JP4.19 reset H3 JP5.2 q(0) A12 JP7.1 JP2.41 q(1) A14 JP7.2 JP2.42 q(2) B14 JP7.3 JP2.43 q(3) B13 JP7.4 JP2.44 G3 G4 H3 H4 P16 D9 C9 C12 B13 B14 A14 A12

#PACE: Start of Constraints generated by PACE #PACE: Start of PACE I/O Pin Assignments NET "clk" LOC = “H4" ; NET "clk" CLOCK_DEDICATED_ROUTE = FALSE; NET "reset" LOC = "M14" ; NET "q<0>" LOC = "A12" ; NET "q<1>" LOC = "A14" ; NET "q<2>" LOC = "B14" ; NET "q<3>" LOC = "B13" ; #PACE: Start of PACE Area Constraints #PACE: Start of PACE Prohibit Constraints #PACE: End of Constraints generated by PACE

2. Asynchronous Counter Async. counter using decimal counter Design a counter which counts from 0 to 9 If we use the output of above counter as the clock of next counter, 1/10 clock is generated, thus counter acts 10 times slower. ex : 1MHz clock=>100KHz clock=>10KHz clock advantage : simple dis-advantage : slow

[1] basic decimal counter entity count10 is Port ( clk_in : in std_logic; reset : in std_logic; q : inout std_logic_vector(3 downto 0); clk_out : out std_logic); end count10; architecture Behavioral of count10 is begin clk_out <= not q(3); process(clk_in,q,reset) if (reset='0') then q<="0000"; elsif (clk_in'event and clk_in='1') then if (q = 9) then q <= “0000”; else q <= q + 1; end if; end process; end Behavioral; vcom count10.vhd vsim count10 view wave add wave * force clk_in 0 0ns,1 10ns -r 20ns force reset 0 run 40ns force reset 1 run 100ns

3. Synchronous Counter synchronous counter principle : use a shared clock for all the counters. pros : fast cons : complicated circuit Frequency divider by M circuit using a synchronous counter : whenever counting from 0 to [M/2]-1, toggle the output clock, and then reset the counter.

[1] divide by 10 circuit entity sync_counter is port (reset : in std_logic; clk : in std_logic; clk_out : inout std_logic); end sync_counter; architecture behavioral of sync_counter is signal count : integer range 0 to 4; begin process(reset, clk) begin if (reset=‘0’) then count <= 0; clk_out <= ‘0’; elsif (clk’event and clk=‘1’) then if (count = 4) then count <= 0; clk_out <= not clk_out; else count <= count + 1; end if; end process; end behavioral; vcom sync_counter.vhd vsim sync_counter view wave add wave * force clk 0 0ns,1 10ns -r 20ns force reset 0 run 40ns force reset 1 run 200ns

[3] Divide by 100 circuit entity cnt100 is port (reset : in std_logic; clk : in std_logic; clk_out : inout std_logic); end cnt100; architecture behavioral of cnt100 is signal count : integer range 0 to 49; begin process(reset, clk) begin if (reset=‘0’) then count <= 0; clk_out <= ‘0’; elsif (clk’event and clk=‘1’) then if (count = 49) then count <= 0; clk_out <= not clk_out; else count <= count + 1; end if; end process; End behavioral; vcom cnt100.vhd vsim cnt100 view wave add wave * force clk 0 0ns,1 10ns -r 20ns force reset 0 run 40ns force reset 1 run 2000ns

% 실제 클럭을 입력보다 1억배 느린 클럭을 출력하는 동기회로