Spin Semiconductor Forum Index Spin Semiconductor
Support forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Easy Hard Clip (Max Value) of Accumulator

 
Post new topic   Reply to topic    Spin Semiconductor Forum Index -> FV-1 software questions
View previous topic :: View next topic  
Author Message
thegrinch



Joined: 27 Jun 2017
Posts: 2

PostPosted: Wed Sep 06, 2017 9:28 am    Post subject: Easy Hard Clip (Max Value) of Accumulator Reply with quote

Hi, I am looking for a way to easily clip the accumulator at a maximum value (e.g. if(accum > .5){accum = .5}; kind of thing). The MAXX instruction does this nicely for clipping the accumulator to a minimum value, but there is not an accompanying MINX instruction (would have been nice!).

I'd imagine people have found the fastest way to do this by this point, so I wanted to ask for y'all's solutions to the problem. Trying to keep the instruction count required to accomplish this as low as possible.

Thanks!
Back to top
View user's profile Send private message
frank



Joined: 19 Oct 2005
Posts: 973

PostPosted: Wed Sep 06, 2017 10:22 am    Post subject: Reply with quote

If 0.5 is the actual desired clip value and the value is in ACC then try something like:

sof -2.0,0
sof -0.5,0
_________________
Frank Thomson
Experimental Noize
Back to top
View user's profile Send private message Visit poster's website
thegrinch



Joined: 27 Jun 2017
Posts: 2

PostPosted: Sun Sep 10, 2017 10:09 am    Post subject: Reply with quote

Okay. I assume that is using the fact that the maximum range of the accumulator is +.9999389 to -1.0?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Spin Semiconductor Forum Index -> FV-1 software questions All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group