05-29-2017, 03:15 AM
So i was playing around with subtraction and i came up with a subtraction algorithm ( i don't remember how i derived it)
So first you have the problem: (Red=1, White=0)
![[Image: 7Azujhp.png]](https://i.imgur.com/7Azujhp.png)
In order to subtract, you find all the places where it is 0-1 and propagate a carry upwards. Then you stop propagating when you hit a 1 on top.
![[Image: 48oFOcX.png]](https://i.imgur.com/48oFOcX.png)
And then you xor all three lines.
![[Image: z3GenWW.png]](https://i.imgur.com/z3GenWW.png)
So the bottom is the answer.
So in implementing this i had two options: ICA type, or CCA type.
I chose CCA type because noone likes ica.
So basically the carry generation was made using B nimplies A and the cancel with B.
Therefore a 3 tick subtractor is formed.
I would post a picture of the subtractor now, but imgur allows only posting every hour
so i have a warp
/warp 3ticksub
So first you have the problem: (Red=1, White=0)
![[Image: 7Azujhp.png]](https://i.imgur.com/7Azujhp.png)
In order to subtract, you find all the places where it is 0-1 and propagate a carry upwards. Then you stop propagating when you hit a 1 on top.
![[Image: 48oFOcX.png]](https://i.imgur.com/48oFOcX.png)
And then you xor all three lines.
![[Image: z3GenWW.png]](https://i.imgur.com/z3GenWW.png)
So the bottom is the answer.
So in implementing this i had two options: ICA type, or CCA type.
I chose CCA type because noone likes ica.
So basically the carry generation was made using B nimplies A and the cancel with B.
Therefore a 3 tick subtractor is formed.
I would post a picture of the subtractor now, but imgur allows only posting every hour
so i have a warp
/warp 3ticksub