Given 4 inputs (A,B,C,D) how can I design a circuit that counts the number of 1s?

The question is in the title.

If I have 4 inputs, how can I count the number of 1s using full/half adders and produce the binary equivalent of how many 1s exist in the 4 inputs?

• What have you tried so far and where did you get stuck? Sep 15, 2020 at 12:26
• Do you know how to make an n-bit (ripple carry) adder from full adders ? You can construct a 2-bit adder from the full adders and chain them to add up the four input lines.
– AJN
Sep 15, 2020 at 12:45
• Are you allowed to use ONLY half/full adders ? Are gates and flip flops allowed ?
– AJN
Sep 15, 2020 at 12:46
• A single full adder has three inputs, and the output is the count of how many of them are "1". You just need to extend this concept to add the fourth input. Sep 15, 2020 at 13:14
• I am allowed to use you gates and half/full adders, no FlipFlops. Yes, i can understand that if you have 3 bits you can use the Full Adder to get the result but given 4 bits, I just don't seem to achieve the same result.. Sep 15, 2020 at 14:25