Re: 請問乘法問題
|
||||
---|---|---|---|---|
版主
|
int main(void)
{ int ADC_Value1 = 0b100000000010, ADC_Value2 = 0b100000000010; long Result1; Result1= (long) ADC_Value1*ADC_Value2; while(1) ; Nop() ; } 加個強迫型別轉換 (long)
發表於: 2008/10/6 17:24
|
|||
|
請問乘法問題
|
||||
---|---|---|---|---|
新會員
|
兩個16位元做乘法,應賅會產生32位元的值,
ex. 0000 1000 0000 0010 * 0000 1000 0000 0010 但為什麼Watch看到的卻沒有bit 17-31的值? 程式碼如下: int main(void) { int ADC_Value1 = 0b100000000010, ADC_Value2 = 0b100000000010; long int Result1; Result1=ADC_Value1*ADC_Value2; while(1) ; Nop() ; }
發表於: 2008/10/4 11:45
|
|||
|