100 likes | 228 Views
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.
E N D
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
A/D Datapath B SAR mask 1000 1100 1110 1111 1111 1000 0100 0010 0001 0000 0000 1000 1100 1110 1111
module maskReg(clk,reset,sh,Q); input clk; input reset,sh; output [3:0] Q; reg [3:0] Q; // 4-bit Shift Register always @(posedge clk orposedge reset) begin if(reset == 1) Q <= 4'b1000; else begin if(sh == 1) begin Q[3] <= 0; Q[2:0] <= Q[3:1]; end end end endmodule maskR 0000 1000 0100 0010 0001 0000
// 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