[Moved] How to divide any numbers in Verilog

Status
Not open for further replies.

prakhars

Junior Member level 3
Joined
Oct 5, 2012
Messages
26
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,497
Want to divide a number by 21 in verilog code, but it is giving an error saying, Second Operand should be power of 2.

How to perform division of any two numbers in verilog???
 

hi,

Want to divide a number by 21 in verilog code, but it is giving an error saying, Second Operand should be power of 2.


you can use a division ip core for this .
how did you get that error ??
or else you can design a divider. but using division ip core is better(i mean not time consuming).
How to perform division of any two numbers in verilog???[/

it is done by shifting . do you want to design a divider by yourself ?
regards
 
Last edited:

Yes,. Actually I don't know IP core, so either you can explain how to do division with IP core or you can help me design a Divider,.
 

Last edited:

I am using Xilinx ISE Sim

Thank you so much for your reply, I will work on it and in case I find some difficulty I'll let u know.
 

hi
How to perform division of any two numbers in verilog???

sorry for the incomplete reply ads-ee. normally it is done by shifting followed by substraction.before shifting we need to arrange the dividend and divisor in proper manner.

may be other methods are also there...

regards
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…