# File lib/ruby-vpi/integer.rb, line 97
 97:   def extend_sign aOrigWidth, aExtWidth
 98:     result = self
 99:     maskWidth = aExtWidth - aOrigWidth
100: 
101:     if maskWidth > 0 && result[aOrigWidth - 1] == 1
102:       result |= (maskWidth.to_mask << aOrigWidth)
103:     end
104: 
105:     result & aExtWidth.to_mask
106:   end