With unsigned char you can store a number from 0 to 255
255(b10) = 11111111(b2) <= that’s 1 byte
This will make it easy to preform operations like +,-,*…
Now how about:
255(b10) = 10101101(b2)
Following this method will make it possible to represent up to 399 using unsigned char?
399(b10) = 11111111(b2)
Can someone propose an algorithm to preform addition using the last method?
With eight bits there are only 256 possible value (28), no matter how you slice and dice it.
Your scheme to encode digits in a 2-3-3 form like:
ignores the fact that those three-bit sequences in there can only represent eight values (0-7), not ten (ie, that second one would be 377, not 399).
The trade-off is that this means you gain the numbers
'25[6-7]'(2 values)'2[6-7][0-7]'(16 values) and'3[0-7][0-7]'(64 values) for a total of 82 values.Your sacrifice for that gain is that you can no longer represent any numbers containing
8or9:'[8-9]'(2 values),'[1-7][8-9]'(14 values),'[8-9][0-9]'(20 values),'1[0-7][8-9]'(16 values),'1[8-9][0-9]'(20 values) or'2[0-4][8-9]'(10 values), for a total of 82 values.The balance there (82 vs. 82) shows that there are still only 256 possible values for an eight-bit data type.
So your encoding scheme is based on a flawed premise, which makes the second part of your question (how to add them) irrelevant, I’m afraid.