Picture showing; The number crunching isn't really bad, but I've had to resort to some amount of floundering,...to get my bearings on that analog and digital 'decrement' (psuedo).
The digital 'ones' are at count values 10 or above, to have some decent amplitude, for the 'terminus' electronics to read. Using the counts, of '000 thru 999' or actually thru '0.999', each peel-away needs to contain a digital '1' level that is enough, right now I've started using '010' for each digital bit flag, so a count-down, of numeral '5' involves total of '5 X 10' that will get moved over, into the count-down shifter. Working backwards from there, it is needed to have '50' as the ending point, for becoming the new WORD for controlling '5' decrements. That is variable 'j', in the unrolled loop that I've been describing.
Now, working backwards, into the analog decrement, by way of usual ratiometric multiply, I've figured those first 5 psuedo-decrements do ten (counts) each, of reduction split-off, generally in a range close to 10 counts each (counts being a substitute for analog light amplitude).
Works out pretty well, as the goal is to work the numbers forward in the process, during the 'loop' downward code stack. In other words, each step will grab 20 % 'residue 'or as close as can get, and leave the 80% main value to continue down the list.
That 20% approx. is a bit sloppy, moving down from '20' counts on the first save, to '16', to 12, 10.2, and lastly '8.2' (on the low side). Figuring 10.0 is close....but lacking explanation. Some random impulsive changes got things this way...a partially satisfying match...
For a digital threshold, similar to the TTL spec, suggested digital threshold is at '7' counts, with 10 being enough guarantee.
Weird part was the numerical adjustments to get results. Number multipliers were '0.8', '0.85', '0.98', and '0.998', with results being the proper amounts in the take-off residue and the numeral amount being in the flow so to speak. Generally you multiply, to get the ratiometric reduction or decrement, and then, for an example like 'X 0.85', you do a 'X 0.15' as the remainder or 'residue' light. That's on paper, simulating the numbers as light travels down the 'code stack'.
For example, I've determined, by working backwards, as mentioned above, that '100' counts of intensity or amplitude are needed to supply the 5 'withdrawals' of ten each, and the count of 50 that is present at the start (of ratiometric decrements).
Photo shows, using multiplier of '0.8' gets a fairly good compromise, having enough amplitude for each bit flag in the new digital WORD being created. If take off too much, then errors creep in, and if take off too little, there isn't enough 'light' quantity to do the digital WORD buildup for having '5' digital shifts to do later.
It seems like a '0.8' multiplier gives good results, for single digits (for doing decrement approximation).
When doing '2' significant digits, you might prefer multiplier like '0.98:, and, it seems, for 3 significant digits, you'd want to use '0.998' as a multiplier.
All this gets to feeling a bit 'lost' in this attempted adjustment, for least amount of error, simulating a single digit decrement. But the '0.8' multiplier works pretty good, taking off or splitting off a bit too much amplitude, so that then, the feed over, to new digital WORD will not be 'enough', to supply a valid digital 'ones' level, of 10 or more counts to each new bit flag position.
Those bit flags, by the way, hopefully, can simplify any electronics used, digitally, for translation to usual electronics / computer output.