• 追加された行はこの色です。
  • 削除された行はこの色です。
%indent
////////////////////////////////////////////////////////////////
* 直接減算 [#aa6f3c14]
* 直接減算 [#fb6b32fa]
////////////////////////////////////////////////////////////////
** 1桁の減算 [#saa4b942]
** 1桁の減算 [#aae922f3]
////////////////////////////////////////////////////////////////

;,1桁の減算は以下の4通り。
- $$ 1 $ - $ 0 $ = $ \,\,1 $$
- $$ 0 $ - $ 0 $ = $ \,\,0 $$
- $$ 1 $ - $ 1 $ = $ \,\,0 $$
- $$ 0 $ - $ 1 $ = $ ^/1 $$  (上位桁で桁下がり)
                                                     
;,減数が$$ 0 $$の場合は被乗数のまま、減数が1の場合は被乗数が$$ 01 $$反転になる。
;,$$ 0 $ - $ 1 $$の場合は上位桁が下がる。

////////////////////////////////////////////////////////////////
** 繰り下がり無し減算 [#m00c0748]
** 繰り下がり無し減算 [#ge8f1aaf]

;,複数桁の減算は右から桁毎に減算する。
;,$$ 0 $$から$$ 1 $$を引かない限り、桁毎に順番に減算するだけで済む。

;,例1:
;,  $$   \phantom{\; +) \;\, }      1 \;\, 1 \;\, 1 \;\, 0 \;\, \;\, 0 \;\, 1 \;\, 1 \;\, 0 \;  $$
;,  $$ \underline{\; -) \;\,        1 \;\, 0 \;\, 0 \;\, 0 \;\, \;\, 0 \;\, 1 \;\, 0 \;\, 0 \;} $$
;,  $$   \phantom{\; +) \;\, 1 \;\,   }    1 \;\, 1 \;\, 0 \;\, \;\, 0 \;\, 0 \;\, 1 \;\, 0 \;  $$

////////////////////////////////////////////////////////////////
** 繰り下がり付き減算 [#q3689cdf]
** 繰り下がり付き減算 [#j20007a1]


;,$$ 0 $$から$$ 1 $$を引く場合、桁が下がるので左の桁を影響する。
;,桁下がる場合は、被減数を上位方向に辿り、最初の$$ 1 $$まで反転させる。


;,例2:
;,  $$   \phantom{\; +) \;\, }                 \cancel1 \;\, \;\, \cancel1 \;\, 0 \;\, 0 \;\, \cancel1 \;\, \;\,  \cancel0 \;\, 0 \;\, 0 \;\, \cancel1 \;\, 0 \;\, 1 \;\, 1 \;\, 0  \;  $$
;,  $$ \underline{\; -) \;\, \phantom{1 \;\, }               \;\,        1 \;\, 1 \;\, 0 \;\,        0 \;\, \;\,         0 \;\, 1 \;\, 0 \;\,        0 \;\, 1 \;\, 1 \;\, 0 \;\, 0  \;} $$
;,  $$   \phantom{\; +) \;\,          1 \;\, }               \;\,        1 \;\, 1 \;\, 0 \;\,        0 \;\, \;\,         1 \;\, 1 \;\, 0 \;\,        0 \;\, 1 \;\, 0 \;\, 1 \;\, 0  \;  $$
;,  $$   \phantom{\; +) \;\, }                 \cancel1 \;\, \;\, \cancel1 \;\, 0 \;\, 0 \;\, \cancel1 \;\, \;\,  \cancel0 \;\, 0 \;\, 0 \;\, \cancel1 \;\, \;\, 0 \;\, 1 \;\, 1 \;\, 0  \;  $$
;,  $$ \underline{\; -) \;\, \phantom{1 \;\, }               \;\,        1 \;\, 1 \;\, 0 \;\,        0 \;\, \;\,         0 \;\, 1 \;\, 0 \;\,        0 \;\, \;\, 1 \;\, 1 \;\, 0 \;\, 0  \;} $$
;,  $$   \phantom{\; +) \;\,          1 \;\, }               \;\,        1 \;\, 1 \;\, 0 \;\,        0 \;\, \;\,         1 \;\, 1 \;\, 0 \;\,        0 \;\, \;\, 1 \;\, 0 \;\, 1 \;\, 0  \;  $$

$$ \cancel0 $$と$$ \cancel1 $$はそれぞれ$$ 0 $$と$$ 1 $$の反転を表し、$$ 1 $$と$$ 0 $$を意味する。

////////////////////////////////////////////////////////////////
** 繰り下がりによる負の数 [#sebf79c5]
** 繰り下がりによる負の数 [#cb7cdf81]

;,繰り下がりで被減数を上位方向に辿っても$$ 1 $$が無い場合、負の数となる。
;,負の数は、先頭に$$ 1 $$を卸して、無限繰り下がりを表す$$ \cdots $$を前に付けて表す。

;,例3:
;,  $$             \phantom{\; +) \;\, } \phantom{1 \;\,\, }        \;\, 1 \;\, 1 \;\, \cancel0 \;\, 0 \;\, \;\,  0 \;\, 1 \;\, \cancel0 \;\,        0 \;\, \cancel1 \;\, \cancel1 \;\, 0 \;\, 0  \;  $$
;,  $$ \underline{          \; -) \;\,                  \,   1 \;\, \;\, 1 \;\, 0 \;\,        0 \;\, 1 \;\, \;\,  0 \;\, 0 \;\,        0 \;\,        1 \;\,        0 \;\,        1 \;\, 1 \;\, 0  \;} $$
;,  $$             \phantom{\;    \;   } \cdots              1 \;\, \;\, 0 \;\, 1 \;\,        1 \;\, 1 \;\, \;\,  0 \;\, 1 \;\,        1 \;\,        1 \;\,        0 \;\,        1 \;\, 1 \;\, 0  \;  $$
;,  $$             \phantom{\; +) \;\, } \phantom{1 \;\,\, }        \;\, 1 \;\, 1 \;\, \cancel0 \;\, 0 \;\, \;\,  0 \;\, 1 \;\, \cancel0 \;\,        0 \;\, \;\, \cancel1 \;\, \cancel1 \;\, 0 \;\, 0  \;  $$
;,  $$ \underline{          \; -) \;\,                  \,   1 \;\, \;\, 1 \;\, 0 \;\,        0 \;\, 1 \;\, \;\,  0 \;\, 0 \;\,        0 \;\,        1 \;\, \;\,        0 \;\,        1 \;\, 1 \;\, 0  \;} $$
;,  $$             \phantom{\;    \;   } \cdots              1 \;\, \;\, 0 \;\, 1 \;\,        1 \;\, 1 \;\, \;\,  0 \;\, 1 \;\,        1 \;\,        1 \;\, \;\,        0 \;\,        1 \;\, 1 \;\, 0  \;  $$

////////////////////////////////////////////////////////////////
* 反数減算 [#f3258640]
* 反数減算 [#y6d6e24d]

;,$$ 0 $$からの減算は殆ど反転に等しく簡単に
$$ a $ - $ b $ = $ a $ + $ ( $ 0 $ - $ b  $ ) $$を利用
;,$$ 1 $$からの減算は反転で簡単に求まるため、
;,$$ a $ - $ b $ = $ a $ + $ ( $ -1 $ - $ b $ ) $ + $ 1 $$を利用して減算を加算として高速に解ける。
;,$$ -1 $$は補数表現で無限の$$ 1 $$が並ぶ数になるので、$$ -1 $ - $ b $$は$$ b $$の反転となる。

例4:

;,  $$   \phantom{\; +) \;\,         \cdots\,} 1   \;\,\;\,         1 \;\, 0 \;\, 0 \;\, 1  \;\, \;\,         0 \;\, 0 \;\, 0 \;\, 1  \;\, \;\,         0 \;\, 1 \;\, 1 \;\, 0   \;  $$
;,  $$ \underline{\; -) \;\,\phantom{\cdots\,  1 } \;\,\;\, \cancel{1 \;\, 1 \;\, 0 \;\, 0} \;\, \;\, \cancel{0 \;\, 1 \;\, 0 \;\, 0} \;\, \;\, \cancel{1 \;\, 1 \;\, 0 \;\, 0}  \;} $$
;,  $$ \underline{\; +) \;\,         \cdots    1   \;\,\;\,         0 \;\, 0 \;\, 1 \;\, 1  \;\, \;\,         1 \;\, 0 \;\, 1 \;\, 1  \;\, \;\,         0 \;\, 0 \;\, 1 \;\, 1   \;} $$
;,  $$   \phantom{\; +) \;\,         \cdots    1 } \;\,\;\,         1 \;\, 1 \;\, 0 \;\, 0  \;\, \;\,         1 \;\, 1 \;\, 0 \;\, 0  \;\, \;\,         1 \;\, 0 \;\, 1 \;\, 0^1 \;  $$

    数学 一覧 検索 最新 バックアップ リンク元   ヘルプ   最終更新のRSS