Nov 17, 2005 #1 L lihui002 Newbie level 5 Joined Nov 4, 2005 Messages 10 Helped 2 Reputation 4 Reaction score 1 Trophy points 1,283 Activity points 1,378 There are two equations for the adder or subtraction a book s=a^(b^M)^c; c[i+1]=(a+c)(b^M)+ac; when M = 0, it is an adder a[i[+b when M = 1, it is a subtraction a-b ------------------------------------- I think when M = 1, d=a^b^l, the b should not become the 1's complement, and l[i+1]=(a^M)(b+l)+bl, a should be the 1's complement, not the b. please explain the equation in the book. Thanks
There are two equations for the adder or subtraction a book s=a^(b^M)^c; c[i+1]=(a+c)(b^M)+ac; when M = 0, it is an adder a[i[+b when M = 1, it is a subtraction a-b ------------------------------------- I think when M = 1, d=a^b^l, the b should not become the 1's complement, and l[i+1]=(a^M)(b+l)+bl, a should be the 1's complement, not the b. please explain the equation in the book. Thanks
Nov 17, 2005 #2 T tarkyss Full Member level 6 Joined Aug 1, 2005 Messages 340 Helped 26 Reputation 52 Reaction score 8 Trophy points 1,298 Location China Activity points 4,162 because a-b=a+(~b+1) maybe you forget add 1
Nov 17, 2005 #3 L lihui002 Newbie level 5 Joined Nov 4, 2005 Messages 10 Helped 2 Reputation 4 Reaction score 1 Trophy points 1,283 Activity points 1,378 but b^1 is ~b, not ~b+1. please explain more particular, thanks
Nov 17, 2005 #4 T tarkyss Full Member level 6 Joined Aug 1, 2005 Messages 340 Helped 26 Reputation 52 Reaction score 8 Trophy points 1,298 Location China Activity points 4,162 sorry, what I said is not clear, when excute sub M=1,at the same time c[0]=1 when excute sub M=0,at the same time c[0]=0 c[0] must be assigned previously
sorry, what I said is not clear, when excute sub M=1,at the same time c[0]=1 when excute sub M=0,at the same time c[0]=0 c[0] must be assigned previously
Nov 18, 2005 #5 L lihui002 Newbie level 5 Joined Nov 4, 2005 Messages 10 Helped 2 Reputation 4 Reaction score 1 Trophy points 1,283 Activity points 1,378 I think M=0 , a+b+c M=1, a-b-c, so the c not equal M.
Nov 18, 2005 #6 T tarkyss Full Member level 6 Joined Aug 1, 2005 Messages 340 Helped 26 Reputation 52 Reaction score 8 Trophy points 1,298 Location China Activity points 4,162 I never said c equals M what i said is c[0] equals M maybe you can try to check it through simulating the code
I never said c equals M what i said is c[0] equals M maybe you can try to check it through simulating the code
Nov 18, 2005 #7 L lihui002 Newbie level 5 Joined Nov 4, 2005 Messages 10 Helped 2 Reputation 4 Reaction score 1 Trophy points 1,283 Activity points 1,378 I have run the simulation with code, through the simulation result, s = a ^ b ^ c; c[i+1] = (a^M)(b+c)+bc; should can get the correct result. but arithmetic in the book, the result is not right. Thanks you suggestion
I have run the simulation with code, through the simulation result, s = a ^ b ^ c; c[i+1] = (a^M)(b+c)+bc; should can get the correct result. but arithmetic in the book, the result is not right. Thanks you suggestion
Dec 1, 2005 #8 L lihui002 Newbie level 5 Joined Nov 4, 2005 Messages 10 Helped 2 Reputation 4 Reaction score 1 Trophy points 1,283 Activity points 1,378 Thanks tarkyss, now I understand your means.