Sign-extension works this way: You pad with zeros for a positive number and pad with ones for a negative number, because of two's complement, and left or right depends on endianness.
Did I understand it correctly? Do I need to know more if I'm looking to understand it as it is described e.g. in Pattersson (Comp. Organization)?