Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

- Community Forums
- :
- Forums
- :
- Hardware Development
- :
- Vivado Debug and Power Estimation Tools
- :
- Bit Width of division result

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Highlighted
##

sai_deepthi

Participant

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-20-2018 06:28 AM

1,189 Views

Registered:
08-15-2018

Bit Width of division result

I am performing division between 16 bit (numerator) and 32 bit (denominator) variables. It is getting simulated in model sim. But I'm unable to insert few MSB bits in chipscope inserter, as they are not visible to make connections.

Also I want to know what will be the bit width of result after performing division operation?

Regards,

Deepthi

5 Replies

Highlighted
##

u4223374

Advisor

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-20-2018 06:55 AM - edited 08-20-2018 06:56 AM

1,178 Views

Registered:
04-26-2015

The bit width of an integer division can be anywhere between zero (eg. 0/1 = 0, technically no bits required) and infinity (eg. 1/0 = infinity, infinite bits required). Normally you'd make the output width the same as the numerator width, since there's only one case where it'll exceed that; however if you're using fixed-point then a longer output may be required.

While Vivado can actually build a divider for you, it's rarely a good idea to use that - combinational division is very large and very slow. Much better to write your own sequential one that produces as many bits as you desire and also provides an overflow flag when the output would exceed that length.

Highlighted
##

drjohnsmith

Teacher

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-20-2018 12:57 PM - edited 08-20-2018 12:59 PM

1,134 Views

Registered:
07-09-2009

Been a long day, and brain fuzzy, but

Is not a divide the same rules as a multiply in terms of number of bits,

https://zipcpu.com/dsp/2017/07/21/bit-growth.html

https://courses.cs.washington.edu/courses/cse467/08au/labs/l5/fp.pdf

if you multiple a 10 bit word by a 16 bit word, then you get 26 bits.

If the 16 bit word is the 1/x of the number, thats a divide,

So the vhdl output would always be a 26 bit output.

<== If this was helpful, please feel free to give Kudos, and close if it answers your question ==>

Highlighted
##

u4223374

Advisor

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-21-2018 03:01 AM

1,089 Views

Registered:
04-26-2015

@drjohnsmith Unfortunately not.

If you're doing integer division, then the quotient value can be no more than the dividend value, unless it's infinity. As such, just keeping the same number of bits as the dividend is fine.

If you're accepting fractional results, then the maximum length is infinity - the obvious decimal example is 1/3 = 0.333333333333333333333333333333333333333333333333333333333333333 and so on. In binary you can get this just by doing 1/10.

Highlighted
##

drjohnsmith

Teacher

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-21-2018 04:02 AM

1,083 Views

Registered:
07-09-2009

you say "keep ing"

What about the calculation , how many bits in that ?

<== If this was helpful, please feel free to give Kudos, and close if it answers your question ==>

Highlighted
##

drjohnsmith

Teacher

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-21-2018 06:41 AM

1,066 Views

Registered:
07-09-2009

I'd have to dis agree with you @u4223374

another example,

https://www.eetimes.com/author.asp?section_id=36&doc_id=1321047

<== If this was helpful, please feel free to give Kudos, and close if it answers your question ==>