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 divide two numbers in verilog

Status
Not open for further replies.

damla61

Newbie level 3
Joined
May 29, 2010
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,303
Hi...


I want to write a module to compute x/y using divide operator where x and y are two signed numbers. Could anyone help me?
 

what specifically are x,y?

If y is a constant, you can use a multiplication. (pre-compute 1/y), where 1/y * max(x) has good resolution.
otherwise, you'll need to use a division algorithm, of which there are many.
 

y is not a constant. But I am very new ın verilog and I don't know could you help me?
 

you can use a divsion IP core to realize it
because division and multiplication can not systhesize in ISE or QUARTUS
 

because division and multiplication can not systhesize in ISE or QUARTUS
With Altera Quartus, a divider IP is automaticaly "inferred" from a signed x/y expression in Verilog or VHDL. With VHDL, the library IEEE.numeric_std is required for it. I don't know, if there's a similar feature in Xilinx IDE.
 

Division requires one add/sub per result bit with a delay for the full
carry output before the next stage can begin. It's not a fast
algorithm

if suppose if you want devide a number with 4'd14,..
Rather than doing a divide by 4'd14,
consider doing a multiply by 17'h12492 which is 2^20/14. Your result
will be the product shifted by 20 bits.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top