Hi,
I think you are over complicating this and not understanding my intent here.
For example, when i said that we get a leading 10 i ALSO said that the second digit there can CHANGE later. If the second digit is a zero (which it is) then if it changes it can only change to a 1, thus making both digits 11. Yet you stated that we might not only get 10 we might get 11, whcih is the same thing i said.
This is why we have to stick to very simple examples not long drawn out examples with base changes and stuff like that. We also dont really have to consider the exponent just yet because we can assume that it gets adjusted correctly when needed.
Whatever you are talking about might be different, but i can assure you that what iam talking about works and works efficiently. It has actually been done on the Z80 CPU and the mid range Microchip uC's. It's just so easy that it is almost not worth discussing
For example, if we have a four bit number 1001 and a four bit number 1010, if we add them we get:
01001
01010
-------
10011
and we can see that the carry bit (on the left) ended up being a 1. This is standard addition in CPU's and uC's.
If you want to drop the leading 1 then we have 0001 and 0010, or 001 and 010, and before we add we can put the 1's back to get 1001 and 1010 and we then have the same as above. If we want to add them first then we have;
0 001
0 010
--------
0 011
but then we have to add the two upper 1's.
If instead we had 1111 and 1110 with dropped leading 1's then we have 111 and 110, and putting the 1's back we have:
01111
01110
---------
11101
and then adjust that.
If we do it without the leading 1's then we have:
0 111
0 110
-------
1 101
and then we know we had two leading 1's whcih then added end up as a leading 10, so we have to add that next:
10
01101
--------
11101
and so we get the same result either way.
But i cant remember running into a case where i had to do this. That means i must have restored the leading 1's before the addition. In fact if we dont restore the leading 1's then i dont see how we could 'denormalize' the number in preparation for the addition.
Perhaps you can show a SIMPLE example of the way you would propose to add the two numbers. You seem to be suggesting that we dont use the carry bit, and i dont see how that is possible. That is because if we have a register length of N then we need a register length N+1 to do an integer addition or else we loose 1 bit every time we do an addition, assuming we dont want to have to check for leading zeros, which we never want to have to take the time to do.
I could probably find some code for the uC's chips. I know they have routines published on line too somewhere.
But if you have another way of doing it, that would be good to see too.
I think you are over complicating this and not understanding my intent here.
For example, when i said that we get a leading 10 i ALSO said that the second digit there can CHANGE later. If the second digit is a zero (which it is) then if it changes it can only change to a 1, thus making both digits 11. Yet you stated that we might not only get 10 we might get 11, whcih is the same thing i said.
This is why we have to stick to very simple examples not long drawn out examples with base changes and stuff like that. We also dont really have to consider the exponent just yet because we can assume that it gets adjusted correctly when needed.
Whatever you are talking about might be different, but i can assure you that what iam talking about works and works efficiently. It has actually been done on the Z80 CPU and the mid range Microchip uC's. It's just so easy that it is almost not worth discussing
For example, if we have a four bit number 1001 and a four bit number 1010, if we add them we get:
01001
01010
-------
10011
and we can see that the carry bit (on the left) ended up being a 1. This is standard addition in CPU's and uC's.
If you want to drop the leading 1 then we have 0001 and 0010, or 001 and 010, and before we add we can put the 1's back to get 1001 and 1010 and we then have the same as above. If we want to add them first then we have;
0 001
0 010
--------
0 011
but then we have to add the two upper 1's.
If instead we had 1111 and 1110 with dropped leading 1's then we have 111 and 110, and putting the 1's back we have:
01111
01110
---------
11101
and then adjust that.
If we do it without the leading 1's then we have:
0 111
0 110
-------
1 101
and then we know we had two leading 1's whcih then added end up as a leading 10, so we have to add that next:
10
01101
--------
11101
and so we get the same result either way.
But i cant remember running into a case where i had to do this. That means i must have restored the leading 1's before the addition. In fact if we dont restore the leading 1's then i dont see how we could 'denormalize' the number in preparation for the addition.
Perhaps you can show a SIMPLE example of the way you would propose to add the two numbers. You seem to be suggesting that we dont use the carry bit, and i dont see how that is possible. That is because if we have a register length of N then we need a register length N+1 to do an integer addition or else we loose 1 bit every time we do an addition, assuming we dont want to have to check for leading zeros, which we never want to have to take the time to do.
I could probably find some code for the uC's chips. I know they have routines published on line too somewhere.
But if you have another way of doing it, that would be good to see too.