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.

How do I translate this code to Verilog?

Status
Not open for further replies.

buzzerflyer

Newbie level 3
Joined
Mar 20, 2010
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Malaysia
Activity points
1,311
If you cannot translate it, can you give me some TIPS on how to translate it?

Image Normalization Matlab code


function nimg = normalize_image(img,m0,v0)
[ht,wt] = size(img);
%compute mean and variances
m = mean(img:)));
v = var(img:)));

gmidx = find(img > m); %greater than mean
lmidx = find(img <=m); %lesser than mean

nimg(gmidx) = m0 + sqrt((v0*(img(gmidx)-m).^2)/v);
nimg(lmidx) = m0 - sqrt((v0*(img(lmidx)-m).^2)/v);
nimg = reshape(nimg,[ht,wt]);[/u]
 

Verilog (and VHDL) are not programming languages. They are hardware description languages. There are no constructs in either language for normalization, calculating means and variances, etc. etc.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top