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

- Community Forums
- :
- Forums
- :
- About Our Community
- :
- General Technical Discussion
- :
- 2 compliment adder and divisor...need comments or ...

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

sraza

Explorer

- Mark as New
- Subscribe to RSS Feed
- Permalink
- Email to a Friend

05-22-2012 06:50 AM

28,528 Views

Registered:
03-13-2012

2 compliment adder and divisor...need comments or correction

Dear all,

Please consider my following design

1) I have 14 bit 2' compliment input and then input 10 frames of such input and add up which means sum_width = 18 bit. 9no issue)

2) Then I use divider core and have this sum is divide by a number through this divider core.

3) Divider has both Integer and fraction part as output.

**My question** **is** **:** What should I consider for the fraction part since it is 2' compiment System/Operation?

Hence I need some sugegstion. Till now I consider that I should treat the fraction normally since to my understanding

it is no different that normal number( only difference is in dealing and this is then done inside PC with software)

What do you guys suggest for the fraction part, even if ignoring the software part...

Do you see any thing wrong with this...?

Please do comment..

Best Reagrds,

Shan

4 Replies

rcingham

Teacher

- Mark as New
- Subscribe to RSS Feed
- Permalink
- Email to a Friend

05-22-2012 08:33 AM

28,523 Views

Registered:
09-09-2010

It is a System Design decision as to whether you need to keep the fractional part. Ask the person who designed the overall algorithm.

------------------------------------------

"If it don't work in simulation, it won't work on the board."

sraza

Explorer

- Mark as New
- Subscribe to RSS Feed
- Permalink
- Email to a Friend

05-22-2012 10:04 AM

28,518 Views

Registered:
03-13-2012

Thank you for your reply.

Well it is me who is the algorithm designer...hehehe

Well I do need the fractional part, the question is not "needing or not needing"

I mean to ask is that should I consider the fraction part as like I consider the normal division fraction part.

Since it is the 2' compliment and not the normal number

But U guess I got the answer since the High Radix division algo of the divider core 3.0 from XIlinx COre Generator gives two compliments' answer (both fraction and Integer).

Is my guess all right. Just want an experts' opinion now...**:)**

Bests and Thanks

eteam00

Professor

- Mark as New
- Subscribe to RSS Feed
- Permalink
- Email to a Friend

05-22-2012 10:14 AM - edited 05-22-2012 10:17 AM

28,515 Views

Registered:
07-21-2009

*Well it is me who is the algorithm designer...hehehe*

*Well I do need the fractional part, the question is not "needing or not needing"*

*I mean to ask is that should I consider the fraction part as like I consider the normal division fraction part.*

*Since it is the 2' compliment and not the normal number*

It appears you are choosing an *implementation* (signed vs. unsigned partial result) before you have settled on a working *algorithm*. This would be an example of putting the proverbial cart before the proverbial horse.

On basic principle, almost *any* representation of the 'fraction' can be made to work *if it is used properly*. Conversely, any representation of the 'fraction' can be improperly applied, and this is quite easily demonstrated. Design and verify the algorithm first, then choose one of the many possible implementations for the algorithm.

-- Bob Elkind

SIGNATURE:

README for newbies is here: http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369

Summary:

1. Read the manual or user guide. Have you read the manual? Can you find the manual?

2. Search the forums (and search the web) for similar topics.

3. Do not post the same question on multiple forums.

4. Do not post a new topic or question on someone else's thread, start a new thread!

5. Students: Copying code is not the same as learning to design.

6 "It does not work" is not a question which can be answered. Provide useful details (with webpage, datasheet links, please).

7. You are not charged extra fees for comments in your code.

8. I am not paid for forum posts. If I write a good post, then I have been good for nothing.

README for newbies is here: http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369

Summary:

1. Read the manual or user guide. Have you read the manual? Can you find the manual?

2. Search the forums (and search the web) for similar topics.

3. Do not post the same question on multiple forums.

4. Do not post a new topic or question on someone else's thread, start a new thread!

5. Students: Copying code is not the same as learning to design.

6 "It does not work" is not a question which can be answered. Provide useful details (with webpage, datasheet links, please).

7. You are not charged extra fees for comments in your code.

8. I am not paid for forum posts. If I write a good post, then I have been good for nothing.

ywu

Xilinx Employee

- Mark as New
- Subscribe to RSS Feed
- Permalink
- Email to a Friend

05-25-2012 05:47 PM

28,488 Views

Registered:
11-28-2007

Yes, both integer and fractional results are in 2's complement format.

@sraza wrote:

Thank you for your reply.

Well it is me who is the algorithm designer...hehehe

Well I do need the fractional part, the question is not "needing or not needing"

I mean to ask is that should I consider the fraction part as like I consider the normal division fraction part.

Since it is the 2' compliment and not the normal number

But U guess I got the answer since the High Radix division algo of the divider core 3.0 from XIlinx COre Generator gives two compliments' answer (both fraction and Integer).

Is my guess all right. Just want an experts' opinion now...

:)

Bests and Thanks

Cheers,

Jim

Jim