Sign in

username or email:

password:



Not a member?
Forgot your password?

Search compdsp



Search tips

Ads

Discussion Groups

Free Online Books

See Also

Embedded SystemsFPGA

Discussion Groups | Comp.DSP | Sign-extension on ADSP SHARC 21469 ??

There are 5 messages in this thread.

You are currently looking at messages 1 to .


Is this discussion worth a thumbs up?

0

Sign-extension on ADSP SHARC 21469 ?? - Mauritz Jameson - 2012-08-11 12:32:00

Hi,

I have some 24bit audio data (stored in an unsigned int). I have to
sign extend it to 32 bit.
From what I understand, I just look at bit 23 (counting from bit0)
which is the sign-bit. If it
is 1 then I place 1's in bit23 to bit31. If it is zero then I don't
need to do anything.

Now...is there a fast way of doing that on SHARC ADSP 21469 ? A built-
in function or something?

I haven't been able to find anything in the manuals (maybe I am
overlooking something).

Thanks
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Sign-extension on ADSP SHARC 21469 ?? - Vladimir Vassilevsky - 2012-08-11 13:16:00



"Mauritz Jameson" <m...@gmail.com> wrote in message 
news:2...@u7g2000yqj.googlegroups.com...
> Hi,
>
> I have some 24bit audio data (stored in an unsigned int). I have to
> sign extend it to 32 bit.
> From what I understand, I just look at bit 23 (counting from bit0)
> which is the sign-bit. If it
> is 1 then I place 1's in bit23 to bit31. If it is zero then I don't
> need to do anything.
>
> Now...is there a fast way of doing that on SHARC ADSP 21469 ? A built-
> in function or something?
> I haven't been able to find anything in the manuals (maybe I am
> overlooking something).

s32 y = (u32)(s24) x -  (s32)0x800000

Duh.

Vladimir Vassilevsky
DSP and Mixed Signal Consultant
www.abvolt.com



______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Sign-extension on ADSP SHARC 21469 ?? - Vladimir Vassilevsky - 2012-08-11 13:22:00

"Vladimir Vassilevsky" <n...@nowhere.com> wrote in message 
news:d...@giganews.com...
>
> "Mauritz Jameson" <m...@gmail.com> wrote in message 
> news:2...@u7g2000yqj.googlegroups.com...
>> Hi,
>>
>> I have some 24bit audio data (stored in an unsigned int). I have to
>> sign extend it to 32 bit.
>> From what I understand, I just look at bit 23 (counting from bit0)
>> which is the sign-bit. If it
>> is 1 then I place 1's in bit23 to bit31. If it is zero then I don't
>> need to do anything.
>>
>> Now...is there a fast way of doing that on SHARC ADSP 21469 ? A built-
>> in function or something?
>> I haven't been able to find anything in the manuals (maybe I am
>> overlooking something).
>
> s32 y = (u32)(s24) x -  (s32)0x800000
>
> Duh.
>
Oops.

s32 y =  (x ^ 0x800000) -  0x800000



Vladimir Vassilevsky
DSP and Mixed Signal Consultant
www.abvolt.com
 


______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Sign-extension on ADSP SHARC 21469 ?? - Mauritz Jameson - 2012-08-11 14:35:00

Thanks Vlad :-)
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Sign-extension on ADSP SHARC 21469 ?? - Mac Decman - 2012-08-11 22:18:00

On Sat, 11 Aug 2012 09:32:55 -0700 (PDT), Mauritz Jameson
<m...@gmail.com> wrote:

>Hi,
>
>I have some 24bit audio data (stored in an unsigned int). I have to
>sign extend it to 32 bit.
>From what I understand, I just look at bit 23 (counting from bit0)
>which is the sign-bit. If it
>is 1 then I place 1's in bit23 to bit31. If it is zero then I don't
>need to do anything.
>
>Now...is there a fast way of doing that on SHARC ADSP 21469 ? A built-
>in function or something?
>
>I haven't been able to find anything in the manuals (maybe I am
>overlooking something).
>
>Thanks

See Processor Manual page 11-79
Rn = FEXT Rx BY Ry (SE)

Mark DeArman
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.