Counters Discussion 12.1 Example 33. Counters 3-Bit, Divide-by-8 Counter 3-Bit Behavioral Counter in Verilog Modulo-5 Counter An N-Bit Counter.

Slides:



Advertisements
Similar presentations
//HDL Example 8-2 // //RTL description of design example (Fig.8-9) module Example_RTL (S,CLK,Clr,E,F,A);
Advertisements

Counters Discussion D8.3.
Verilog in transistor level using Microwind
CDA 3100 Recitation Week 11.
Supplement on Verilog adder examples
Synchronous Sequential Logic
Multiplication and Division
Verilog Modules for Common Digital Functions
Table 7.1 Verilog Operators.
CSE 201 Computer Logic Design * * * * * * * Verilog Modeling
//HDL Example 5-1 // //Description of D latch (See Fig.5-6) module D_latch (Q,D,control); output Q; input.
Verilog. 2 Behavioral Description initial:  is executed once at the beginning. always:  is repeated until the end of simulation.
FSM Revisit Synchronous sequential circuit can be drawn like below  These are called FSMs  Super-important in digital circuit design FSM is composed.
//HDL Example 6-1 // //Behavioral description of //Universal shift register // Fig. 6-7 and Table 6-3 module shftreg.
How to get a Circuit in verilog converted to hspice, connected to the micron package models, and simulating in hspice and hsimplus.
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.
Latches and Flip-Flops Discussion D8.1 Section 13-9.
FSM examples.
Edge-Triggered D Flip-Flops
Pulse-Width Modulated DAC
OUTLINE Introduction Basics of the Verilog Language Gate-level modeling Data-flow modeling Behavioral modeling Task and function.
Flip-Flops Module M10.2 Section 7.1. D Latch Q !Q CLK D !S !R S R X 0 Q 0 !Q 0 D CLK Q !Q Note that Q follows D when the clock in high, and.
A/D Converter Control Discussion D8.6 Rev. B – 3/14/2006.
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.
A/D Converter Control Discussion D8.6. Analog-to-Digital Converters Converts analog signals to digital signals –8-bit: 0 – 255 –10-bit: 0 – 1023 –12-bit:
Verilog Sequential Circuits Ibrahim Korpeoglu. Verilog can be used to describe storage elements and sequential circuits as well. So far continuous assignment.
Logic Design Review – 3 Basic Sequential Circuits Lecture L14.3 Verilog.
Ring Counter Discussion 11.3 Example 32.
Arbitrary Waveform Discussion 12.2 Example 34. Recall Divide-by-8 Counter Use q2, q1, q0 as inputs to a combinational circuit to produce an arbitrary.
2-to-1 Multiplexer: if Statement Discussion D7.1 Example 4.
//HDL Example 3-3 // //Stimulus for simple circuit module stimcrct; reg A,B,C; wire x,y; circuit_with_delay swd(A,B,C,x,y);
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Senior Design I Lecture 4 - Verilog 2 (Sequential.
ELEN 468 Advanced Logic Design
Registers and Shift Registers Discussion D8.2. D Flip-Flop X 0 Q 0 ~Q 0 D CLK Q ~Q D gets latched to Q on the rising edge of the clock. Positive.
Generic Multiplexers: Parameters Discussion D7.5 Example 8.
D Flip-Flops in Verilog Discussion 10.3 Example 27.
Quad 2-to-1 Multiplexer Discussion D7.4 Example 7.
Digital Logic Review Discussion D8.7.
7-Segment Display DIO1 Board Verilog.
Sequential Logic in Verilog
Figure 7.1. Control of an alarm system. Memory element Alarm Sensor Reset Set OnOff 
Registers & Counters M. Önder Efe
Registers CPE 49 RMUTI KOTAT.
Week Four Design & Simulation Example slides. Agenda Review the tiny example (Minako “logic”)from last week – look at the detailed static timing report.
Figure A flip-flop with an enable input. D Q Q Q R Clock E 0 1.
Introduction Verilog is a HARDWARE DESCRIPTION LANGUAGE (HDL) A hardware description language is a language or means used to describe or model a digital.
Slide 1 6. VHDL/Verilog Behavioral Description. Slide 2 Verilog for Synthesis: Behavioral description Instead of instantiating components, describe them.
ECE/CS 352 Digital System Fundamentals© 2001 C. Kime 1 ECE/CS 352 Digital Systems Fundamentals Spring 2001 Chapters 3 and 4: Verilog – Part 2 Charles R.
1 CSE-308 Digital System Design (DSD) N-W.F.P. University of Engineering & Technology, Peshawar.
Traffic Lights Discussion D8.3a. Recall Divide-by-8 Counter Use Q2, Q1, Q0 as inputs to a combinational circuit to produce an arbitrary waveform. s0 0.
1 COMP541 Sequential Circuits Montek Singh Feb 1, 2012.
Final Project. System Overview Description of Inputs reset: When LOW, a power on reset is performed. mode: When LOW, NORMal mode selected When HIGH,
Motors Discussion D10.2 Chapter 15. Hans Christian Oersted (1777 – 1851) Ref:
Behavioral Modelling - 1. Verilog Behavioral Modelling Behavioral Models represent functionality of the digital hardware. It describes how the circuit.
Digital Electronics.
ECE/CS 352 Digital System Fundamentals© T. Kaminski & C. Kime 1 ECE/CS 352 Digital Systems Fundamentals Fall 2000 Chapter 5 – Part 2 Tom Kaminski & Charles.
SYEN 3330 Digital SystemsJung H. Kim 1 SYEN 3330 Digital Systems Chapter 7 – Part 2.
OUTLINE Introduction Basics of the Verilog Language Gate-level modeling Data-flow modeling Behavioral modeling Task and function.
Chapter 6: Hierarchical Structural Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 6-1 Chapter 6: Hierarchical.
SYEN 3330 Digital SystemsJung H. Kim Chapter SYEN 3330 Digital Systems Chapters 4 – Part4: Verilog – Part 2.
Lab5-1 張明峰 交大資工系 Lab 5: FSM and BCD counters Implement the vending machine of lab 2 A two-digit BCD counter –two BCD counters –can load data in parallel.
1 Modeling Synchronous Logic Circuits Debdeep Mukhopadhyay Associate Professor Dept of Computer Science and Engineering NYU Shanghai and IIT Kharagpur.
Figure Implementation of an FSM in a CPLD..
Supplement on Verilog FF circuit examples
Supplement on Verilog for Algorithm State Machine Chart
D Flip-Flop.
Pulse-Width Modulation (PWM)
FSM MODELING MOORE FSM MELAY FSM. Introduction to DIGITAL CIRCUITS MODELING & VERIFICATION using VERILOG [Part-2]
Verilog.
The Verilog Hardware Description Language
Presentation transcript:

Counters Discussion 12.1 Example 33

Counters 3-Bit, Divide-by-8 Counter 3-Bit Behavioral Counter in Verilog Modulo-5 Counter An N-Bit Counter

3-Bit, Divide-by-8 Counter

Divide-by-8 Counter s s s s s s s s State q2 q1 q0 D2 D1 D0 Present state Next state

Divide-by-8 Counter q2 q1 q D2 D2 = ~q2 & q1 & q0 | q2 & ~q1 | q2 & ~q0 s s s s s s s s State q2 q1 q0 D2 D1 D0 Present state Next state

Divide-by-8 Counter q2 q1 q D1 D1 = ~q1 & q0 | q1 & ~q0 s s s s s s s s State q2 q1 q0 D2 D1 D0 Present state Next state

Divide-by-8 Counter q2 q1 q D0 D0 = ~q0 s s s s s s s s State q2 q1 q0 D2 D1 D0 Present state Next state

Divide-by-8 Counter A Divide by 8 counter circuit using D Flip-flops

module count3a ( input wire clr, input wire clk, output reg [2:0] q ); wire [2:0] D ; assign D[2] = ~q[2] & q[1] & q[0] | q[2] & ~q[1] | q[2] & ~q[0]; assign D[1] = ~q[1] & q[0] | q[1] & ~q[0]; assign D[0] = ~q[0]; // Three D flip-flops clk or posedge clr) if(clr == 1) q <= 0; else q <= D; endmodule

count3a Simulation

Counters 3-Bit, Divide-by-8 Counter 3-Bit Behavioral Counter in Verilog Modulo-5 Counter An N-Bit Counter

3-Bit Counter clk or posedge clr) begin if(clr == 1) q <= 0; else q <= q + 1; end Behavior count3 clr clk Q[2:0]

module count3b ( input wire clr, input wire clk, output reg [2:0] q ); // 3-bit counter clk or posedge clr) begin if(clr == 1) q <= 0; else q <= q + 1; end endmodule count3b.v Asynchronous clear Output count increments on rising edge of clk

count3b Simulation

Counters 3-Bit, Divide-by-8 Counter 3-Bit Behavioral Counter in Verilog Modulo-5 Counter An N-Bit Counter

module mod5cnt ( input wire clr, input wire clk, output reg [2:0] q ); // modulo-5 counter clk or posedge clr) begin if(clr == 1) q <= 0; else if(q == 4) q <= 0; else q <= q + 1; end endmodule

mod5cnt Simulation

Counters 3-Bit, Divide-by-8 Counter 3-Bit Behavioral Counter in Verilog Modulo-5 Counter An N-Bit Counter

module counter #(parameter N = 8) (input wire clr, input wire clk, output reg [N-1:0] q ); // N-bit counter clk or posedge clr) begin if(clr == 1) q <= 0; else q <= q + 1; end endmodule defparam cnt16.N = 16; counter cnt16(.clr(clr),.clk(clk),.q(q));

counter Simulation N = 8