Ring Counter Discussion 11.3 Example 32.

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.
Synchronous Sequential Logic
EE 361 Fall 2003University of Hawaii1 Hardware Design Tips EE 361 University of Hawaii.
Shift Registers Module M11.1 Section 7.3.
Verilog Modules for Common Digital Functions
Table 7.1 Verilog Operators.
Case Study VLSI 系統設計與高階合成           + : delay : multiplier: adder … … + … … FIR Filter tap=4 IIR Case - Filter (1/8)
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.
//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.
Latches and Flip-Flops Discussion D8.1 Section 13-9.
FSM examples.
Arbitrary Waveform Discussion 5.5 Example 34.
Edge-Triggered D Flip-Flops
Registers VHDL Tutorial R. E. Haskell and D. M. Hanna T2: Sequential Logic Circuits.
Pulse-Width Modulated DAC
OUTLINE Introduction Basics of the Verilog Language Gate-level modeling Data-flow modeling Behavioral modeling Task and function.
A/D Converter Control Discussion D8.6 Rev. B – 3/14/2006.
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:
Logic Design Review – 3 Basic Sequential Circuits Lecture L14.3 Verilog.
Generate a clock pulse clk inp outp
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.
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.
2-to-1 Multiplexer: if Statement Discussion D7.1 Example 4.
Shift Registers Lecture L6.6 Section Bit Shift Register.
4-to-1 Multiplexer: Module Instantiation Discussion D7.2 Example 5.
CS 61C Discussion 10 (1) Jaein Jeong Fall input MUX °Out = in0 * select’ + in1 * select in0in1selectout
A/D Converter Datapaths Discussion D8.4. Analog-to-Digital Converters Converts analog signals to digital signals –8-bit: 0 – 255 –10-bit: 0 – 1023 –12-bit:
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.
FSMs in Verilog and other random things 9/27/02. FSM structure CLK STATE Next State Logic Inputs Output Logic Outputs.
Lessons from last lab: 1.Many had the “# skipping” problem 2.Most assumed there was something wrong with their code 3.How does one check their code? 4.SIMULATE!!
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.
Engineering 100 Section 250 Combinational Logic -- Examples 9/13/2010.
Registers & Counters M. Önder Efe
Verilog Intro: Part 2. Procedural Blocks There are two types of procedural blocks in Verilog. – initial for single-pass behavior: initial blocks execute.
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.
Introduction Verilog is a HARDWARE DESCRIPTION LANGUAGE (HDL) A hardware description language is a language or means used to describe or model a digital.
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.
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:
Why segregate blocking and non-blocking assignments to separate always blocks? always blocks start when triggered and scan their statements sequentially.
1 Arithmetic, ALUs Lecture 9 Digital Design and Computer Architecture Harris & Harris Morgan Kaufmann / Elsevier, 2007.
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.
1 Verilog: Function, Task Verilog: Functions A function call is an operand in an expression. It is called from within the expression and returns a value.
Registers and Counters Discussion D8.1. Logic Design Fundamentals - 3 Registers Counters Shift Registers.
Supplement on Verilog FF circuit examples
Supplement on Verilog for Algorithm State Machine Chart
Lecture L5.1 Mealy and Moore Machines
Registers and Counters
Pulse-Width Modulation (PWM)
Shift Registers Lecture L8.6 Section 8.3.
FSM MODELING MOORE FSM MELAY FSM. Introduction to DIGITAL CIRCUITS MODELING & VERIFICATION using VERILOG [Part-2]
Verilog.
ESE 437: Sensors and Instrumentation
Registers and Counters
6. Registers and Counters
The Verilog Hardware Description Language
Registers and Counters
Presentation transcript:

Ring Counter Discussion 11.3 Example 32

4-Bit Ring Counter

Note non-blocking assignment module ring4( input wire clk, input wire clr, output reg [3:0] q ); // 4-bit Ring Counter always @(posedge clk or posedge clr) begin if(clr == 1) q <= 1; else q[3] <= q[0]; q[2:0] <= q[3:1]; end endmodule Note non-blocking assignment

Aldec Active-HDL Simulation

Johnson Counter

johnson4.v module johnson4( input wire clk, input wire clr, output reg [3:0] q ); // 4-bit Johnson Counter always @(posedge clk or posedge clr) begin if(clr == 1) q <= 0; else q[3] <= ~q[0]; q[2:0] <= q[3:1]; end endmodule

Johnson Counter

A Random Number Generator

q3 q2 q1 q0 0 0 0 1 1 1 0 0 0 8 1 1 0 0 C 1 1 1 0 E 1 1 1 1 F 0 1 1 1 7 1 0 1 1 B 0 1 0 1 5 q3 q2 q1 q0 1 0 1 0 A 1 1 0 1 D 0 1 1 0 6 0 0 1 1 3 1 0 0 1 9 0 1 0 0 4 0 0 1 0 2 0 0 0 1 1

rand4.v module rand4( input wire clk, input wire clr, output reg [3:0] q ); // 4-bit Random number generator always @(posedge clk or posedge clr) begin if(clr == 1) q <= 1; else q[3] <= q[3] ^ q[0]; q[2:0] <= q[3:1]; end endmodule

A Random Number Generator

Clock Pulse clk inp Q2 Q0 Q1 outp

clk_pulse.v ); module clk_pulse( input wire clk; input wire clr; input wire inp; output wire outp; ); reg [2:0] Q; // clock pulse generator always @(posedge clk or posedge clr) begin if(clr == 1) Q <= 0; else Q[2] <= inp; Q[1:0] <= Q[2:1]; end assign outp = Q[2] & Q[1] & ~Q[0]; endmodule clk_pulse.v

clk inp Q2 Q0 Q1 outp