Registers and Shift Registers Discussion D8.2. D Flip-Flop 0 0 1 1 1 0 X 0 Q 0 ~Q 0 D CLK Q ~Q D gets latched to Q on the rising edge of the clock. Positive.

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.
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
Logic Design Fundamentals - 3 Discussion D3.2. Logic Design Fundamentals - 3 Basic Gates Basic Combinational Circuits Basic Sequential 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
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.
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.
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:
ELEN 468 Advanced Logic Design
COE 202 Introduction to Verilog Computer Engineering Department College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals.
Advanced Verilog EECS 270 v10/23/06.
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.
CS 140L Lecture 4 Professor CK Cheng 10/22/02. 1)F-F 2)Shift register 3)Counter (Asynchronous) 4)Counter (Synchronous)
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.
Digital Design Lectures 11 & 12 Shift Registers and Counters.
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.
4-Bit Universal Shift Register Behavioral Vs. Structural Description Behavioral Description – Behavior model of a shift register Describe the operation.
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.
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.
Registers and Counters Discussion D8.1. Logic Design Fundamentals - 3 Registers Counters Shift Registers.
1 Modeling Synchronous Logic Circuits Debdeep Mukhopadhyay Associate Professor Dept of Computer Science and Engineering NYU Shanghai and IIT Kharagpur.
1 Lecture 3: Modeling Sequential Logic in Verilog HDL.
Supplement on Verilog FF circuit examples
Supplement on Verilog for Algorithm State Machine Chart
INTRODUCTION Overview of Shift Registers
D Flip-Flop.
Pulse-Width Modulation (PWM)
Shift Registers Lecture L8.6 Section 8.3.
Verilog.
ESE 437: Sensors and Instrumentation
Registers and Counters
Principles & Applications
Register-Transfer Level Components in Verilog
The Verilog Hardware Description Language
Presentation transcript:

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 edge triggered

A 1-Bit Register

If LOAD = 1, then INP0 gets latched to Q0 on the rising edge of the clock, CLK

A 4-Bit Register

Implementing Registers in Verilog //A 4-bit register with asynchronous clear and load module reg4(Clk,Clear,Load,D,Q); input [3:0] D; input Clk,Clear,Load; output [3:0] Q; reg [3:0] Q; Clk or posedge Clear) if(Clear == 1) Q <= 0; else if(Load) Q <= D; endmodule

4-Bit Shift Register

shift4.v module ShiftReg(clk,clr,data_in,Q); input clk; input clr; input data_in; output [3:0] Q; reg [3:0] Q; // 4-bit Shift Register clk or posedge clr) begin if(clr == 1) Q <= 0; else begin Q[3] <= data_in; Q[2:0] <= Q[3:1]; end endmodule Note non-blocking assignment

shift4 simulation

Ring Counter

ring4.v module ring4(clk,clr,Q); input clk; input clr; output [3:0] Q; reg [3:0] Q; // 4-bit Ring Counter clk or posedge clr) begin if(clr == 1) Q <= 1; else begin Q[3] <= Q[0]; Q[2:0] <= Q[3:1]; end endmodule

ring4 simulation

Johnson Counter

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

Johnson Counter

A Random Number Generator

Q3 Q2 Q1 Q C E F B Q3 Q2 Q1 Q A D

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

A Random Number Generator

clk inp Q2 Q0 Q1 outp Clock Pulse

module clk_pulse(clk,clr,inp,outp); input clk; input clr; input inp; output outp; wire outp; reg [2:0] Q; // clock pulse generator clk or posedge clr) begin if(clr == 1) Q <= 0; else begin 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