code: def signed_mult(a, b):
      
      a, b = as_wires(a), as_wires(b)
      final_len = len(a) + len(b)
      # sign extend both inputs to the final target length
      a, b = a.sign_extended(final_len), b.sign_extended(final_len)
      # the result is the multiplication of both, but truncated
      # TODO: this may make estimates based on the multiplication overly
      # pessimistic as half of the multiply result is thrown right away!
      return (a * b)[0:final_len]
docs: Return a*b where a and b are treated as signed values.