LUT in verilog

Guest #4493286
Rate this post
• ▲ useful
▼ not useful
you could write a Matlab script printing the relevant code snippet 
(inside of a case block) in verilog syntax. Something like this 
(untested!) Matlab code here:

for i=1:length
 fprintf('8'h%x: out <= 8'h%x\n', i, value(i));
end

The result you copy & paste into you verilog file.
OP #4493382
Rate this post
• ▲ useful
▼ not useful
Ok, this is a good way to solve problem of copy,Thanks.
But about the LUT creation itself?

For example if i want a LUT of a function sqrt((1/x)+1) with input fixed 
because i have a fixed point representation, how can i get the function 
output?

Is there a function ?


excuse me, but i've never done this.
Guest #4493766
Rate this post
• ▲ useful
▼ not useful
Of course there is a function in Matlab to calculate this. And there is 
the function fixdt() in Matlab to create a fixed point representation of 
your numbers.

This is more a Matlab problem rather than a Verilog problem, right?

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [vhdl]VHDL-Code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.