Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

verilog a code for 8 bit ideal ADC

Status
Not open for further replies.

tibusso

Newbie level 4
Joined
Oct 30, 2009
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
ireland
Activity points
1,333
Hi all,

Can someone find the error in the following code?

module top;
wire in, clk, out;

ideal_adc i1(in,clk,out);
endmodule

module ideal_adc(in,clk,out);
input in,clk;
output [0:adc_size-1] out;
voltage in,clk,out;

parameter integer adc_size = 8 from [1:inf);
parameter real fullscale = 1.0;
parameter real delay_ = 0, trise = 10n, tfall = 10n;
parameter real clk_vth = 2.5;
parameter real out_high = 1, out_low = 0 from (-inf:eek:ut_high);

real sample,thresh;
real result[0:adc_size-1];
integer i;

analog
begin
@(cross(V(clk)-clk_vth, +1))
begin
sample = V(in);
thresh = fullscale/2;
for(i=adc_size-1;i>=0;i=i-1)
begin
if (sample > thresh)
begin
result = out_high;
sample = sample - thresh;
end
else result = out_low;
sample = 2*sample;
end
end
V(out) <+ transition(result,delay_,trise,tfall);
end
endmodule


Many thanks
 

Hi tibusso..
for this 8bit ideal ADC,it requires "dot H" files so can u provide me that "dot H" files...
so that errors can be removed....
thank u..
 

I do not understand the part concerning
sample =sample -threshold
and
sample = 2* sample

I think that we should check the input sample at different thresholds and no processing is done on the sample

please clarify
 

I do not understand the part concerning
sample =sample -threshold
and
sample = 2* sample
It is the simple ideal successive approximation ADC (adc_8bit_ideal), copied - incorrectly - from the ahdlLib from c@dence.

Can someone find the error in the following code?
Incorrect copy.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top