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: 0 – 4095 Successive Approximation
Method of Successive Approximation
Implementing Successive Approximation
A/D CPLD
A/D CPLD Datapath
A/D Datapath mask SAR B
module maskReg(clk,reset,sh,Q); input clk; input reset,sh; output [3:0] Q; reg [3:0] Q; // 4-bit Shift Register clk or posedge reset) begin if(reset == 1) Q <= 4'b1000; else begin if(sh == 1) begin Q[3] <= 0; Q[2:0] <= Q[3:1]; end endmodule maskR
// Title: A/D converter datapath module ADpath(clk,reset,msel,sh,sarld,adld,sar,ADR,done); input clk,reset,msel,sh,sarld,adld; output done; output [3:0] sar,ADR; wire [3:0] sar,sarin,ADR,A,B; wire [3:0] mask; assign done = ~|mask; assign A = sar | mask; assign B = sar & ~mask; reg4 sarReg(.D(sarin),.Load(sarld),.Clear(reset),.Clk(clk),.Q(sar)); reg4 adReg(.D(sar),.Load(adld),.Clear(reset),.Clk(clk),.Q(ADR)); maskReg maskR(.clk(clk),.reset(reset),.sh(sh),.Q(mask)); mux24 mux1(.A(A),.B(B),.s(msel),.Y(sarin)); endmodule