bits - Binary Subtraction Borrowing Logic for 1000 - 0110? -


i having hardtime understanding borrowing logic 1000 - 0110 . know answer 0010 having trouble understanding borrowing part little.

first step ok 0 - 0 = 0

1000 0110 ----    0 

second step 0 - 1 , need borrow . borrow 1 , result 10 - 1 = 1

   ->1     1000     0110     ----       10 

but @ next step there nothing borrow, how work ?

when borrow, carry on binary 10 lower bit, so:

  0 ->1  0000  0110  ----     0  

then borrow again, , subtract 1 10, 1:

   0 ->11  0000  0110  ----     0  

and finally:

   0 ->11  0000  0110  ----  0010  

Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -