A/D Converter Control Discussion D8.6 Rev. B – 3/14/2006.

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.
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.
Latches and Flip-Flops Discussion D8.1 Section 13-9.
CSE Spring Verilog for Sequential Systems - 1 Today: Verilog and Sequential Logic zFlip-flops yrepresentation of clocks - timing of state.
FSM examples.
Spring 20067W. Rhett Davis with minor modifications by Dean Brock ECE 406 at UNASlide 1 ECE 406 Design of Complex Digital Systems Lecture 10: 9: State.
Edge-Triggered D Flip-Flops
Pulse-Width Modulated DAC
1 COMP541 Sequencing and Control Montek Singh Mar 29, 2007.
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.
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.
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:
ENEE 408C Lab Capstone Project: Digital System Design Fall 2005 Sequential Circuit Design.
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.
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.
Sequential Logic in Verilog
Verilog Intro: Part 2. Procedural Blocks There are two types of procedural blocks in Verilog. – initial for single-pass behavior: initial blocks execute.
Chapter 11: System Design Methodology Digital System Designs and Practices Using Verilog HDL and 2008, John Wiley11-1 Ders 8: FSM Gerçekleme ve.
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.
Register Transfer Level & Design with ASM
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.
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use Verilog Part 3 – Chapter.
Finite State Machine (FSM) Nattha Jindapetch December 2008.
Figure 7.6. Gated SR latch. (a) Circuit Q Q R S R S R Clk Q Q S Time (c) Timing diagram Clk ? ? SR xx Q(t) (no change) 0 1.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL State Machines Anselmo Lastra.
1 COMP541 State Machines – 2 Registers and Counters Montek Singh Feb 11, 2010.
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.
Chapter 11: System Design Methodology Digital System Designs and Practices Using Verilog HDL and 2008, John Wiley11-1 Chapter 11: System Design.
ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU 99-1 Under-Graduate Project Design of Datapath Controllers Speaker: Shao-Wei Feng Adviser:
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 9: State Machines & Reset Behavior Spring.
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 (c) W. J. Dally Digital Design: A Systems Approach Lecture 7: Data Path State Machines.
EMT 351/4 DIGITAL IC DESIGN Verilog Behavioral Modeling  Finite State Machine -Moore & Mealy Machine -State Encoding Techniques.
Pusat Pengajian Kejuruteraan Mikroelektronik EMT 351/4 DIGITAL IC DESIGN Verilog Behavioural Modeling (Part 4) Week #
1 Lecture 3: Modeling Sequential Logic in Verilog HDL.
Figure Implementation of an FSM in a CPLD..
Exp#7 Finite State Machine Design in Verilog COE203 Digital Logic Laboratory Dr. Ahmad Almulhem KFUPM Spring 2009.
Supplement on Verilog FF circuit examples
Supplement on Verilog for Algorithm State Machine Chart
Figure 8.1. The general form of a sequential circuit.
Verilog Modules for Common Digital Functions
Lecture L5.1 Mealy and Moore Machines
Supplement on Verilog Sequential circuit examples: FSM
Pulse-Width Modulation (PWM)
Analog-to-Digital Converters
FSM MODELING MOORE FSM MELAY FSM. Introduction to DIGITAL CIRCUITS MODELING & VERIFICATION using VERILOG [Part-2]
Verilog.
Supplement on Verilog Sequential circuit examples: FSM
Register-Transfer Level Components in Verilog
The Verilog Hardware Description Language
Presentation transcript:

A/D Converter Control Discussion D8.6 Rev. B – 3/14/2006

Analog-to-Digital Converters Converts analog signals to digital signals –8-bit: 0 – 255 –10-bit: 0 – 1023 –12-bit: 0 – 4095 Successive Approximation

Method of Successive Approximation

Implementing Successive Approximation

A/D CPLD Control

Use Mealy Machine Inputs to C1: adstart, gt, done Outputs from C2: sarald, sh, adld, msel, adflg

A/D Control Unit Why won't this work?

Note: sar must be 1000 on reset so that gt can be set properly. Now we don't need the mux or the AND gates!

sarld sarReg maskR sar gt

A Mealy state machine

ADctl

A Mealy state machine Use one-hot encoding: one flip-flop per state

module DFF (D, clk, clr, Q); input clk, clr ; wire clk, clr ; input D ; wire D ; output Q ; reg Q ; clk or posedge clr) if(clr == 1) Q <= 0; else Q <= D; endmodule

module DFF1 (D, clk, reset, Q); input clk, reset; wire clk, reset ; input D ; wire D ; output Q ; reg Q ; clk or posedge reset) if(reset == 1) Q <= 1; else Q <= D; endmodule

// adconv control module ADctrl(Clk, Clear, gt, adstart, done, sarld, sh, adld, adflg); input Clk, Clear, gt, adstart, done; output sarld, sh, adld, adflg; wire msel, sarld, sh, adld, adflg; wire start, keep, remove; wire startD, keepD, removeD; assign startD = start & ~adstart | keep & done | remove & done; assign keepD = start & adstart & gt | keep & gt & ~done | remove & gt & ~done; assign removeD = start & adstart & ~gt | keep & ~gt & ~done | remove & ~gt & ~done;

DFF1 startFF(.D(startD),.clk(Clk),.reset(Clear),.Q(start)); DFF keepFF(.D(keepD),.clk(Clk),.clr(Clear),.Q(keep)); DFF removeFF(.D(removeD),.clk(Clk),.clr(Clear),.Q(remove));

// C2 Outputs assign adflg = done; assign adld = done; assign sarld = gt & keep | gt & remove | gt & adstart & start; assign sh = ~done & keep | ~done & remove | adstart & start; endmodule

// Title : A/D converter module adconv(clock, clear, adstart, gt, adflg, sar, adreg); input clock, clear, adstart, gt; output adflg; output [3:0] sar, adreg; wire adflg, sarld, adld, sh, done; wire [3:0] sar, adreg; ADpath adc1(.clk(clock),.reset(clear),.sh(sh),.sarld(sarld),.adld(adld),.sar(sar),.ADR(adreg),.done(done)); ADctrladc2(.Clk(clock),.Clear(clear),.gt(gt),.adstart(adstart),.done(done),.sarld(sarld),.sh(sh),.adld(adld),.adflg(adflg)); endmodule

A Mealy state machine Use binary encoding: two flip-flops

// adconv control module ADctrl(Clk, Clear, gt, adstart, zero, msel, sarld, sh, adld, adflg); input Clk, Clear, gt, adstart, zero; output sarld, sh, adld, adflg; reg msel, sarld, sh, adld, adflg; reg[2:0] present_state, next_state; parameterstart = 2'b00, keep = 2'b01, remove = 2'b11;

Clk or posedge Clear) begin if (Clear == 1) present_state <= start; else present_state <= next_state; end

or adstart or gt or done) begin case(present_state) start: if(adstart == 1) next_state <= load; else if(gt == 1) next_state <= keep; else next_state <= remove; keep: if(done == 1) next_state <= start; else if(gt == 1) next_state <= keep; else next_state <= remove; remove: if(done == 1) next_state <= start; else if(gt == 1) next_state <= keep; else next_state <= remove; default next_state <= start; endcase end

// C2 Outputs assign adflg = done; assign adld = done; assign sarld = gt & keep | gt & remove | gt & adstart & start; assign sh = ~done & keep | ~done & remove | adstart & start; endmodule

A/D Control Unit

// Title : A/D converter module adconv(clock, clear, adstart, gt, adflg, sar, adreg); input clock, clear, adstart, gt; output adflg; output [3:0] sar, adreg; wire adflg, msel, sarld, adld, sh, done; wire [3:0] sar, adreg; ADpath adc1(.clk(clock),.reset(clear),.sh(sh),.sarld(sarld),.adld(adld),.sar(sar),.ADR(adreg),.done(done)); ADctrl adc2(.Clk(clock),.Clear(clear),.gt(gt),.adstart(adstart),.done(done),.sarld(sarld),.sh(sh),.adld(adld),.adflg(adflg)); endmodule

Lab 9