Microchip
直播中

王金凤

7年用户 221经验值
私信 关注
[问答]

桶形移位器如何访问40位值?

嗨,我用DSPIC33FJ128GP802做了一些合成器。这个论坛有人告诉我我用的是桶形移位器,一个指令是16位移位。我读过桶形移位器可以处理40位的值,我怎么能访问40位的值?现在我使用一个暂时的无符号长来把最有意义的值换算进去,然后执行两次乘法。也许用40位值可以乘32位值,然后再换回去?提前感谢

以上来自于百度翻译


      以下为原文

    Hi, i,m using the DSPIC33FJ128GP802 to make some synthesizers.
Some one in this forum told me i was using the barrel shifter, 16 bit shift in 1 instruction.

I readed the barrel shifter can handle a 40 bits value, how can i access a 40 bit value ?
Now i am using a temporary unsigned long to shift the most significant into, and perform the multiply twice.

Maybe with a 40 bit value i could multiply a 32 bit value, and shift back again ?
Thanks in advance

回帖(5)

冯待策

2019-7-1 06:59:45
嗨,谢谢你的回复,我可以用一些SORT40位值乘法和换档吗?然后,我找出我到底得到了什么。无符号long已经处于它的极限,我喜欢将500000000乘以32768,所以我需要一个40位的值。

以上来自于百度翻译


      以下为原文

    Hi, thanks for the reply,
can i use some sort 40 bit value for multiplying and shifting ?
Then i find out what i gain or not.
 
The unsigned long is already on it limits, i like to multiply number 500000000 by 32768, so i need a 40 bit value.
举报

贾翠晓

2019-7-1 07:05:13
DSPIC有2个40位累加器(内存映射),带有附加子- NEG -移位+/- 1…16位所有指令。参见编程手册DS70157,

以上来自于百度翻译


      以下为原文

    DSPIC has 2 40 bit accumulators  (memory mapped) with ADD - SUB - NEG  - SHIFT +/- 1..16 bits
all one instruction.   See programming manual DS70157,
举报

李天竹

2019-7-1 07:17:08
乘以32768等于从右增加一个零字,然后向右移位1。使用普通寄存器要容易得多。累加器不会帮助你。

以上来自于百度翻译


      以下为原文

    Multiplying by 32768 is the same as adding a zero word from the right, then shifting to the right by 1. It's much easier to do with regular registers. Accumulators won't help you with this.
举报

李维兴

2019-7-1 07:27:21
那个产品需要44位。

以上来自于百度翻译


      以下为原文

   
That product takes 44 bits.
举报

更多回帖

发帖
×
20
完善资料,
赚取积分