ΣSigmaStudio Ask AI Русский Log in

Problem with Arithmetic shift operator

SigmaDSP & SigmaStudio AST Mar 2, 2025 00:00 3 replies Original on forum ↗
Subscribe
AST Question
Mar 2, 2025 00:00

Dear community,

I have a question regarding the arithmetic shift operator. Whenever I shift a bit to the MSB it shows 7F FF FF FF. See the screenshot below.

After some research, I understand this is the expected behaviour, since the MSB is the sign bit. However in my application I need to set the MSB manually.

Is there a way around this automatic saturation? I want to use the serial output ports to output the variable as a bitstream. It works fine if I connect a DC Source directly to the output, but in my application I need to calculate the value at runtime.

Best regards

Alex

Audio Signal Processors

software

sigma studio 4.7

SigmaDSP Audio Processors

adau1466

arithmetic shift

Show More

pastedimage1740919636436v3.png
pastedimage1740919636436v3.png
AST Reply
Mar 2, 2025 00:00

BitshiftMSB.dspproj

This is the Sigma Studio Project for your reference.

Harishgowtham Reply
Mar 3, 2025 00:00

Hello AST,

When you read and write using DC and readback, this saturation will not occur (the saturation operation has its own condition inside the core). when you shift the bits or do any operation, this saturation occurs. This is an internal saturation occurs in the accumulator. sorry, I can't explain this further here.

we may be able to help you with your application in a possible way if you can give us some information.

What data you are going to send out? Is it audio data?

If it's audio and you are messing with the sign bit, then you will get an undesired output, noise.

AST said:
I want to use the serial output ports to output the variable as a bitstream

where are you sending these variables and what is the purpose? Do you really need to manipulate the MSB?

we may try to work around, if possible. if you give us some info.

Regards,

Harish

DaveThib Reply
Mar 3, 2025 00:00

Hello Alex,

If you respond to the question Harish posed which is to explain what you need to do we might be able to help more.

Meanwhile, I had written these programs and posted how to increase the channel data in and out of a delay line. This program shows how to manipulate 24 bit data into and out of the core.

You are asking about the core but I also want to point out that there are circuits for truncating and sign extending between 32 bit and 24 bit data when going from 32 bit memory and the serial ports. These truncators and saturators can be bypassed with a register setting.

Have a look at what I did with this post:

(+) How to increase Delay time? - Q&A - SigmaDSP Processors & SigmaStudio Dev. Tool - EngineerZone

Dave T