Signed/unsigned divider

Jun 07, 2005 2 Replies

Hello,



I'm trying to generate a divider core with Xilinx core generator



I'm confused about the signed/unsigned option, and it seems tha ther's a mistake in the datasheet of the core



dtatsheet



formatting link



At the end of the first page, -9/4 is translated in binary in



strange way First, 9 is 1001 in unsigned, but -9 doesn't exist in signd binary a far as I can remember...



in the datasheet :


-9/4=9/-4=-(2 1/4


this corresponds to :


(1)0111/0100 or 1001/110


isn't that wrong


thank



Well, 10111 would be -9 in 5-bit binary, so it depends what you mean by "wrong". "Sloppy" might be a better word. I think it's a red herring though.

The point it's illustrating is that if the result of a signed division is negative, the quotient will always be negative (or zero). However, if you choose an *integer* remainder then it may differ in sign from the quotient; if you choose a *fractional* remainder then it will always have the same sign as the quotient.

Cheers,

-Ben-

"vinch" wrote i messag

a

Well, 10111 would be -9 in 5-bit binary, so it depends what you mea b "wrong". "Sloppy" might be a better word. I think it's a red herrin though

The point it's illustrating is that if the result of a signed divisio

i negative, the quotient will always be negative (or zero). However, i yo choose an *integer* remainder then it may differ in sign from th quotient if you choose a *fractional* remainder then it will always have th sam sign as the quotient

Cheers

-Ben-[/quote:2e25e143ca

Ok cheers mate

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required