I am trying to come up with a way to add individual bits of a register.
eg, if regA = 111000 then regB = 3 (Sum of bits of regA).
1) Is there any synthesizable function/operator in Verilog or SystemVerilog which I can directly use to do this operation?
If not, then maybe the problem is a little interesting, especially because the operation has to be done in one clock cycle (pure combinational logic) and the register width is parameterizable.
2) In case there is no inbuilt Verilog or SystemVerilog operator then what can be done?
Thanks, Ujjwal