0
590views
Perform following operation using 2's compliment method- (i) (28)10-(42)10 (ii) (52)10-(-18)10
1 Answer
0
7views

$i) \ (28)_{10} -(42)_{10}$ $(28)_{10} \rightarrow binary \ (00011100)_2 \ (42)_{10} \rightarrow binary \ (00101010)_2 $ $Calculating \ 2's \ complement \ of \ (42)_{10}:\ 1's \ complement \ of \ 42 \rightarrow (11010101)_2\ Add \ 1 \ to \ it \rightarrow (11010110)_2$ $\begin{matrix} & &0 &0 &0 &1 &1 &1 &0 &0 \ &+ &1 &1 &0 &1 &0 &1 &1 &0 \ \hline & &1 &1 &1 &1 &0 &0 &1 &0 \end{matrix}$ $Calculating \ 2's \ complement \ of \ result \ since \ MSB \ is \ 1: \ 1's \ complement \ of \ (11110010)_2 \rightarrow (00001101)_2 \ Adding \ 1 \rightarrow (00001110)_2 $ $Solution: \ (-14)_{10}$ --- $ii) \ (52)_{10} -(-18)_{10}$ $(52)_{10} \rightarrow binary \ (00110100)_2 \ (18)_{10} \rightarrow binary \ (00010010)_2 \ To \ represent \ (-18)_{10}, \ take \ 2's \ complement:\ 1's \ complement \rightarrow(11101101)_2 \ Add\ 1 \rightarrow (11101110)_2$ $Calculating \ 2's \ complement \ of \ (-18)_{10}:\ 1's \ complement \ of \ (-18)_{10} \rightarrow (0001001)_2\ Add \ 1 \ to \ it \rightarrow (00010010)_2$ $\begin{matrix} & &00110100 \ &+ &00010010 \ \hline \ & &01000110 \end{matrix}$ $Solution: \ (70)_{10}$

Please log in to add an answer.