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.

Divider for synthesis

Status
Not open for further replies.

Edward_2288

Member level 4
Joined
Mar 7, 2004
Messages
71
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,288
Activity points
725
dw divider

hi,
I encounter a problem in synthesising a divider to a gate level. for simulation, it can be simply done by using "/" symbol. however during synthesis, an error occurs.

well, anybody know how to synthesis division, let say by 3, 5, 7, etc, please advise me.

thx
 

niuniu

Member level 5
Joined
Jul 23, 2002
Messages
87
Helped
4
Reputation
8
Reaction score
0
Trophy points
1,286
Activity points
691
serial divider verilog

DC can not synthesize divider, you have to write your own implemenations. find some 'computer arithmatic' book on this topic.
 

Edward_2288

Member level 4
Joined
Mar 7, 2004
Messages
71
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,288
Activity points
725
combinatorial integer divider verilog

anyone has the e-book or paper? actually, how many ways are they to build a divider?
 

kctang

Member level 1
Joined
Nov 4, 2004
Messages
39
Helped
2
Reputation
4
Reaction score
0
Trophy points
1,286
Activity points
451
divider verilog code with remainder

What are your requirements(speed, area, latency)?
Pure combinational, or digit-serial divider?
 

Edward_2288

Member level 4
Joined
Mar 7, 2004
Messages
71
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,288
Activity points
725
divider with quotient and remainder

hi can u show me both ways? thx
 

kctang

Member level 1
Joined
Nov 4, 2004
Messages
39
Helped
2
Reputation
4
Reaction score
0
Trophy points
1,286
Activity points
451
Hi,

The following combinatorial divider code is written by me when I was a undergraduate and it should be synthesisble. In fact the concept for digit-serial divider is the same excepted that "temp_remainder" is evaluated in each clock cycle.

Another higher radix division requires a lookup table first and you can find the theory in most computer arithematics books, enjoy!!


/**************************************/
module divider(quotient, remainder, dividend, divider);

output [15:0] quotient, remainder;
input [15:0] dividend, divider;

reg [15:0] quotient, remainder;
reg [31:0] scaled_divider, temp_remainder, temp_result;
integer i;


always @(dividend or divider) begin
scaled_divider = {1'b0, divider, 15'h0000};
temp_remainder = {16'h0000, dividend};

for(i = 0;i < 16; i = i + 1) begin
temp_result = temp_remainder - scaled_divider;

if(temp_result[31 - i]) begin // Negative result, Quotient set to '0'
quotient[15 - i] = 1'b0;
end
else begin // Positive result, Quotient set to '1'
quotient[15 - i] = 1'b1;
temp_remainder = temp_result;
end

scaled_divider = scaled_divider >> 1;
end

remainder = temp_remainder[15:0];
end

endmodule
/**************************************/
 

jimjim2k

Advanced Member level 3
Joined
May 17, 2001
Messages
996
Helped
23
Reputation
46
Reaction score
13
Trophy points
1,298
Activity points
7,199
Hi

for a collection of HDL codes for

Adder/multiplier/dividers and more look at:

check each of them with HDL lint tools for synthesizabiliy too.

1. h**p://ntu.csie.org/~b88047/p1/
2. h**p://ntu.csie.org/~b88047/p2/

* -> t

tnx
 

Edward_2288

Member level 4
Joined
Mar 7, 2004
Messages
71
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,288
Activity points
725
any link for verilog?

btw, what is the difference between pure combinational and digit-serial divider? is it the number of cycles required to complete a division? thx
 

seasonyangd

Member level 3
Joined
Nov 14, 2001
Messages
62
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
China
Activity points
361
Edward_2288 said:
anyone has the e-book or paper? actually, how many ways are they to build a divider?

Here is a paper on this topic?

It is a SNUG paper about divider implementation using verilog.
 

Edward_2288

Member level 4
Joined
Mar 7, 2004
Messages
71
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,288
Activity points
725
kctang said:
Hi,

The following combinatorial divider code is written by me when I was a undergraduate and it should be synthesisble. In fact the concept for digit-serial divider is the same excepted that "temp_remainder" is evaluated in each clock cycle.

Another higher radix division requires a lookup table first and you can find the theory in most computer arithematics books, enjoy!!


/**************************************/
module divider(quotient, remainder, dividend, divider);

output [15:0] quotient, remainder;
input [15:0] dividend, divider;

reg [15:0] quotient, remainder;
reg [31:0] scaled_divider, temp_remainder, temp_result;
integer i;


always @(dividend or divider) begin
scaled_divider = {1'b0, divider, 15'h0000};
temp_remainder = {16'h0000, dividend};

for(i = 0;i < 16; i = i + 1) begin
temp_result = temp_remainder - scaled_divider;

if(temp_result[31 - i]) begin // Negative result, Quotient set to '0'
quotient[15 - i] = 1'b0;
end
else begin // Positive result, Quotient set to '1'
quotient[15 - i] = 1'b1;
temp_remainder = temp_result;
end

scaled_divider = scaled_divider >> 1;
end

remainder = temp_remainder[15:0];
end

endmodule
/**************************************/

Hi...this code will be synthesized into what? how many counters? how many adders? substractors? thx
 

kctang

Member level 1
Joined
Nov 4, 2004
Messages
39
Helped
2
Reputation
4
Reaction score
0
Trophy points
1,286
Activity points
451
This is a 16bit by 16bit, unsigned combinatinoal divider with no counters. It should have 16 subtractors of various width(max 32).
 

Edward_2288

Member level 4
Joined
Mar 7, 2004
Messages
71
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,288
Activity points
725
so it means that in one clk cycle, we get the result of division. am i rite?
 

xwcwc1234

Full Member level 5
Joined
Jul 21, 2001
Messages
286
Helped
7
Reputation
14
Reaction score
2
Trophy points
1,298
Activity points
1,751
Any one knows where can get a synthesizable Verilog code for digital filter ?
 

kctang

Member level 1
Joined
Nov 4, 2004
Messages
39
Helped
2
Reputation
4
Reaction score
0
Trophy points
1,286
Activity points
451
Yeap, it gets the result in a single cycle. But it is slow due to cascaded subtractors.
 

taotaocui

Newbie level 6
Joined
Nov 18, 2004
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
90
Maybe you can use DW divider in DC during ASIC implementation or Coregen or MegaFunction in FPGA.
It's no a good method that you write everything you need yourself.
 

heartfree

Advanced Member level 4
Joined
Oct 31, 2004
Messages
100
Helped
3
Reputation
8
Reaction score
2
Trophy points
1,298
Activity points
738
Edward_2288 said:
what is DW divider?
DW -----Design Ware
this is a kind of IP provied by Synopsys.
If you are licensed, you can make a reference when RTL coding.
 

kinjal_book

Junior Member level 3
Joined
Oct 14, 2006
Messages
26
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,281
Activity points
1,422
i have got quotient and remainder but i need to combine them to get the floating number

is there any good algorithm
 

posedge

Newbie level 1
Joined
Dec 10, 2002
Messages
1
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
4
kinjal_book said:
i have got quotient and remainder but i need to combine them to get the floating number

is there any good algorithm

Two years after original Topic was discusssed ?
It will be more effective for you if you open your own new topic on the subject:

"Synthesizable RTL Floating Point Dividers"
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top