2

4bit の 2 の補数系を使用して、正負の両方の数を表すと仮定します。

Suppose  we have to find 2's complement of no.  3
We can subtract this no. with 2^4
              that is ,                   
                           = 2^4 - 3
                           = 13  
                           =1101 (which represent -3 , in 2's complement system)

//* there is another way of finding 2's complement , taking 1's complemen of the 
    number and add 1 to it.

本のルールでは、2つのいいえを引くために与えられています。

規則 : 2 つの no X と Y を減算する、つまり X - Y は、no の 2 の補数を形成します。Yを X に追加します。

2 つの no を減算する必要があるとします。(-7) と (-5) の場合、規則に従って、いいえ (-5) の 2 の補数を見つけ、それを (-7) に追加する必要があります。

本の解決策 :

ここに画像の説明を入力

-5 の 2 の補数が 0101 であることを知る必要があります。

4

1 に答える 1