Computer Science, Operating Systems.
first bit decides the sign, we cannot simply fill up zeros, otherwise a negative number in signed short will become a positive number in signed int after expansion. 4-bits: 0b1001 = -7 8-bits: 0b00001001 = 9 8-bits: 0b11111001 = -1–2–4 = -7 Instead, we should do signed extension, depending on the