發表文章

Signed Number's Binary Addition

圖片
Clash Royale CLAN TAG #URR8PPP up vote 0 down vote favorite I'm going to discuss about Signed Number's Binary addition, I searched about it and even read books. Now I make little changes in it's logic and start my own logic to solve it. Let me show 4 bit example by Book Method. -5+3 Book told me that I should take two's complement of 5 to add in 3's binary. 1011 is two's complement of 5. now add with 3's binary. 0011. 1011 <----- -5 ( 5's two's complement ) 0011 <----- 3 --- 1110 <----- -2 ( leftsigned bit is 1 therefore it is in two's complement form ) 0010 <----- 2 ( Again two's complement of answer to show original answer ) But the answer sign bit is positive that's mean answer is 2? Now I tried again and again and find a stupid method to solve the above or any signed number's binary addition. Let me explain with my stupid logic. Note: I will never change sign bit during once complement. First I will take t...