Signed/unsigned divider

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

Reply to
vinch
Loading thread data ...

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-

Reply to
Ben Jones

"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

Reply to
vinch

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.