I'm doing an assignment where I need to multiply two 16 bit numbers and store result as an 16 bit integer array.

a is binary with length of n

b is binary with length of m

I have already found out that a * b would have length of n + m if a and b are repdigits consisting of 1 or n + m - 1 if they're not.

Can I also find length of a + b?

  • 3
    $\begingroup$ It's either the maximum length of a and b or one more, but what simplification of rules are you looking for? $\endgroup$
    – Askeroni
    Jul 29 at 21:10
  • 1
    $\begingroup$ (There are natural numbers. And there are, say, integral numbers of both signs, the sum of which can be quite short.) $\endgroup$
    – greybeard
    Jul 30 at 4:17
  • $\begingroup$ 110*110=100100; I don't think 110 is a "repdigit". $\endgroup$
    – rici
    Jul 30 at 22:00
  • $\begingroup$ @rici Thank you. $\endgroup$
    – trofchik
    Aug 1 at 4:31
  • $\begingroup$ @Askeroni Nothing specific. Just looking for ways to simplify carry handling in cases where multiple array elements get affected by sum. $\endgroup$
    – trofchik
    Aug 1 at 4:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.