Marvell Technology Interview Question

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

Interview Answers

Anonymous

Mar 3, 2015

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

3

Anonymous

Feb 17, 2016

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

2

Anonymous

May 22, 2015

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

2

Anonymous

Jan 5, 2016

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

2