Hi
@ray123
if my 8 bit reg has 01110000
then I should get '0' as output
But ur solution gives '1'
@shanmugaveld
ya 2 4-bit full adders will do.
but can it b more simple.
You can also traditional approach of k-map, if you don't like to use adders in your logic.
Split your 8-bit bus to two 4-bit busses, for each four bit bus, try to find exactly one 1's, exactly 2 1's and exactly 0 1's anthen u need to simply form the logic for 0+2, 2+0 and 1+1
The same procedure can be applied to if you want find for three 1's inside your 8-bit bus that would be : 0+3,3+0,1+2,2+1