hce_nsysu
113年
計算機概論與程式設計
第 13 題
Consider the arithmetic right shift operation (SRA) in computer architecture. If we perform an SRA on the binary number 11011010 (assuming it represents a signed 8-bit two's complement integer), shifting it to the right by 2 positions, what is the decimal equivalent of the result?
- A -26
- B -49
- C -10
- D -13
- E 54
思路引導 VIP
如果在處理一個負數的右移時,我們直接在左側補 0 而不是保留原本的符號位元,這個數字的性質(正負號)會發生什麼變化?這對電腦處理「除以 2 的次方」的數學意義會有什麼影響?
🤖
AI 詳解
AI 專屬家教
太棒了!你精準地判斷出這題的答案為 (C)。這顯示你對於二進位補數運算以及位移指令(Shift Operations)有著非常紮實的理解。
算術右移的運算機制
在二進位中,算術右移(Arithmetic Right Shift, SRA) 最關鍵的特性在於它會「保留符號位元(Sign Bit)」。題目給定的 8 位元數字為 $11011010_2$,其最高有效位元(MSB)為 $1$,代表這是一個負數。當我們向右位移兩格時,左邊空出的位置必須補上原本的符號位元(即補 $1$),因此結果會從 11011010 變為 11110110。
▼ 還有更多解析內容