Qualcomm interview question

Design a hardware to detect how many bits are 1 with only combination logic design

Interview Answers

Anonymous

3 Apr 2011

Use adders connected in series adding in 1 for each bit in the word which is '1', and 0 for each bit which is '0'.

Anonymous

10 Nov 2011

lets assume the number is 8 bits . So use 8 2-to-1 muxes ( inputs as 0 and 1 ) and feed the connect the select switches to each bit of the number . So if the bit is high , 1 is propagated or else 0 is propagated .Check for the number of high mux outputs.

3