看不懂 英语太烂 求救

[复制链接]
4826|26
 楼主| Periodic 发表于 2011-10-24 17:07 | 显示全部楼层 |阅读模式
TI, ic, shift, IO, ST
L_shr - The L_shr function arithmetically shifts the input variable x right n positions, sign extending the result. If n is negative, the L_shr function arithmetically shifts x left by -n bits, zero filling the least significant bits.
ANSIC prototype: Frac32 L_shr(Frac32 x, Int16 n)
x:Frac32 - The input data value.
n:Int16 - The number of bits to right shift x; n is signed and, if negative, implies a right shift.
Return value:Frac32 - The function returns the value x arithmetically shifted by n bits.
 楼主| Periodic 发表于 2011-10-24 17:09 | 显示全部楼层
Frac32 L_shr(Frac32 x, Int16 n)
不知道这个函数是做啥子用的
 楼主| Periodic 发表于 2011-10-24 17:11 | 显示全部楼层
是不是判断  Frac32 x 最否是负数
lxyppc 发表于 2011-10-24 17:28 | 显示全部楼层
L_shr - The L_shr function arithmetically shifts the input variable x right n positions, sign extending the result. If n is negative, the L_shr function arithmetically shifts x left by -n bits, zero filling the least significant bits.
L_shr函数将x算术右移n位,并扩展其符号位。如果n为负数,L_shr函数将x算术左移n位,低位补零.

ANSIC prototype: Frac32 L_shr(Frac32 x, Int16 n)
x:Frac32 - The input data value.
n:Int16 - The number of bits to right shift x; n is signed and, if negative, implies a right shift. 红色应该是笔误
Return value:Frac32 - The function returns the value x arithmetically shifted by n bits.
xaq79 发表于 2011-10-24 17:31 | 显示全部楼层
楼上厉害
 楼主| Periodic 发表于 2011-10-24 17:48 | 显示全部楼层
并扩展其符号位  这个 不太 明白
lxyppc 发表于 2011-10-24 18:12 | 显示全部楼层
举个例子,负的16位有符号数, -16
其各位值为
1111111111110000
如果不扩展符号位(这个叫逻辑右移),右移后結果为
0111111111111000,32760

如果扩展符号位(这个叫算术右移),右移后結果为。相当于-16/2
1111111111111000,-8
 楼主| Periodic 发表于 2011-10-24 18:14 | 显示全部楼层
谢谢 楼上
lvminhu 发表于 2011-10-24 18:34 | 显示全部楼层
危机原理是这么讲的,,,,呵呵,,
feixi69 发表于 2011-10-24 20:01 | 显示全部楼层
我也不懂呢
sysdriver 发表于 2011-10-24 20:09 | 显示全部楼层
我英语也很烂,不过我觉得这个英语好像有点另类。。。
 楼主| Periodic 发表于 2011-10-24 21:21 | 显示全部楼层
还有一个问题  如果n为负数,L_shr函数将x算术左移n位,低位补零.
那么  最高位的符号位 是不 是 也要 扩展符号位呢?
ads3525826 发表于 2011-10-25 09:40 | 显示全部楼层
下载个翻译软件部就完了
lxyppc 发表于 2011-10-25 09:47 | 显示全部楼层
还有一个问题  如果n为负数,L_shr函数将x算术左移n位,低位补零.
那么  最高位的符号位 是不 是 也要 扩展符号位呢?
Periodic 发表于 2011-10-24 21:21

嗯,这个要不要扩展你可以根据我的例子试试看
opyy125689 发表于 2011-10-25 11:05 | 显示全部楼层
真的是牛人一推
tythering 发表于 2011-10-25 11:53 | 显示全部楼层
好专业啊
open_free 发表于 2011-10-25 12:10 | 显示全部楼层
就这帖子还上首页???
DailyEGroup 发表于 2011-10-25 12:19 | 显示全部楼层
看不懂啊
qtby5 发表于 2011-10-25 12:31 | 显示全部楼层
不太懂
 楼主| Periodic 发表于 2011-10-25 12:59 | 显示全部楼层
结果是

+16     -16

就是 如果是正数  则 +16/2=8
如果是 -16      则 -16*2=-32
您需要登录后才可以回帖 登录 | 注册

本版积分规则

1

主题

670

帖子

2

粉丝
快速回复 在线客服 返回列表 返回顶部