Marvell Technology interview question

How many data bits needed to represent A*B+C, all are 8 bit unsigned

Interview Answers

Anonymous

3 Mar 2015

15bits is enough [0, 2^16-2^8]; 15 bits can represent [0, 2^16-1].

3

Anonymous

17 Feb 2016

16 bit. It is because the worst condition is 0xFF*0xFF+0xFF, it is 0xFF*0x100. Result is 0xFF00.

2

Anonymous

22 May 2015

(2^8-1)*(2^8-1)+2^8<2^8*2^8=2^16

2

Anonymous

5 Jan 2016

I think it should be 17 bits . (8+8) bits for '*', +1 bit for "+'.

2