edited by
314 views
4 votes
4 votes

A processor that has carry, overflow and sign flag bits as part of its program status word (PSW) performs addition of the following two $2's$ complement numbers $01101100$ and $11000011.$ After the execution of this addition operation, the status of the carry, overflow and sign flags, respectively will be:

  1. $0, 1, 1$
  2. $1, 0, 1$
  3. $0, 1, 0$
  4. $1, 0, 0$
edited by

1 Answer

Best answer
4 votes
4 votes
$$\begin{array}{|l c c c c c|}
        \hline
             C_n & C_{n-1} &  &  & &\\
             \hline
             & x_{n-1} & x_{n-2} & \ldots &  x_{0}& + \\
             & y_{n-1} & y_{n-2} & \ldots &  y_{0}&\\
             \hline
             & s_{n-1} & s_{n-2} & \ldots &  s_{0}& \\
              \hline
        \end{array}$$
For overflow: If $C_{n} \oplus C_{n-1} = 1$ or $x_{n-1}y_{n-1}\overline{s_{n-1}} + \overline{x_{n-1}} .\overline{y_{n-1}}{s_{n-1}} = 1 $
        $$\begin{array}{|l c c c c c c c c c|}
        \hline
             C_n & C_{n-1}& & & & & & & &  
              \\
             \hline
              & 0 & 1 & 1 & 0 & 1 & 1 & 0 & 0 &+\\
               & 1 & 1 & 0 & 0 & 0 & 0 & 1 & 1 &
            \\  \hline
              & 0 & 0 & 1 & 0 & 1 & 1 & 1 & 1 &
         \\    \hline
        \end{array}$$
From above we can say carry $= 1,$ overflow $= 0$ and sign $= 0.$

We can also see that since addition is for a positive and negative number, there wont be an overflow.
    
So, Option D
selected by
Answer:

Related questions