1 / 26

A/D Converter Control

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: 0 – 4095 Successive Approximation. Method of Successive Approximation. Implementing Successive Approximation.

cera
Download Presentation

A/D Converter Control

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. A/D ConverterControl Discussion D8.6

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

  3. Method of Successive Approximation

  4. Implementing Successive Approximation

  5. Implementing Successive Approximation

  6. A/D CPLD Control

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

  8. A/D Control Unit

  9. A Mealy state machine

  10. ADctl adflg = done; msel = ~gt; adld = done; sarld = ~done; sh = ~done;

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

  12. module DFF (D, clk, clr, Q); input clk, clr ; wire clk, clr ; input D ; wire D ; output Q ; reg Q ; always @(posedge clk orposedge clr) if(clr == 1) Q <= 0; else Q <= D; endmodule

  13. module DFF1 (D, clk, reset, Q); input clk, reset; wire clk, reset ; input D ; wire D ; output Q ; reg Q ; always @(posedge clk orposedge reset) if(reset == 1) Q <= 1; else Q <= D; endmodule

  14. // adconv control module ADctrl(Clk, Clear, gt, adstart, done, msel, sarld, sh, adld, adflg); input Clk, Clear, gt, adstart, done; output msel, 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;

  15. 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));

  16. // C2 Outputs assign adflg = done; assign msel = ~gt; assign adld = done; assign sarld = ~done & keep | ~done & remove | adgo & start; assign sh = ~done & keep | ~done & remove | adgo & start; endmodule

  17. // 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),.msel(msel),.sh(sh), .sarld(sarld),.adld(adld),.sar(sar),.ADR(adreg), .done(done)); ADctrladc2(.Clk(clock),.Clear(clear),.gt(gt), .adstart(adstart),.done(done),.msel(msel), .sarld(sarld),.sh(sh),.adld(adld), .adflg(adflg)); endmodule

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

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

  20. always @(posedge Clk orposedge Clear) begin if (Clear == 1) present_state <= start; else present_state <= next_state; end

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

  22. // C2 Outputs assign adflg = done; assign msel = ~gt; assign adld = done; assign sarld = ~done & keep | ~done & remove | adgo & start; assign sh = ~done & keep | ~done & remove | adgo & start; endmodule

  23. A/D Control Unit

  24. // 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),.msel(msel),.sh(sh), .sarld(sarld),.adld(adld),.sar(sar),.ADR(adreg), .done(done)); ADctrl adc2(.Clk(clock),.Clear(clear),.gt(gt),.adstart(adstart), .done(done),.msel(msel),.sarld(sarld),.sh(sh), .adld(adld), .adflg(adflg)); endmodule

More Related