459 views
11 11 votes

A $6$-bit CPU uses $\mathbf{2}$'s complement representation for signed integers. Two numbers, $X= (101101)_2$ and $Y=(011010)_2$, are fed into an Arithmetic Logic Unit (ALU) to perform the operation $Z=X-Y$.

Which of the following statements is TRUE regarding the result $Z$ ?

  1. The result $Z$ in decimal is $-45$ and no overflow occurred.
     
  2. The result $Z$ in decimal is $+19$ and an overflow occurred.
     
  3. The result $Z$ in decimal is $-19$ and no overflow occurred.
     
  4. The result $Z$ in decimal is $-27$ and an overflow occurred.

2 Answers

4 4 votes

$$
\begin{aligned}
X & =-19 \\\\
Y & =+26 \\\\
Z & =(-19)-(+26)=-45
\end{aligned}
$$
In a $6$-bit $2$'s complement system, the range of representable integers is:

  • Range $:\left[-2^{n-1}, 2^{n-1}-1\right]$
     
  • For $n=6:\left[-2^5, 2^5-1\right]=[-32,+31]$.
     
  • Since the theoretical result $-45$ falls outside the range $[-32,31]$, an overflow occurs.

$$
\begin{aligned}
& X=101101 \\\\
& -Y=2^{\prime} \text { s complement of } 011010=100110 \\\\
& Z=X+(-Y)=101101+100110=(1) 010011
\end{aligned}
$$
The $6$-bit result is $010011$, which is $+19$ (the "incorrect" result due to overflow).

Answer:
Position:
Show:

Related questions

4 4 votes
1 1 answer
328
328 views
GO Classes asked Feb 27
328 views
In a hypothetical $8$-bit floating-point representation, $1$ bit is for the sign, $4$ bits are for the biased exponent $($bias $=7)$, and $3$ bits are for the fraction (n...
5 5 votes
2 2 answers
321
321 views
GO Classes asked Feb 27
321 views
A $3$-bit synchronous counter uses three $T$ flip-flops $\left(T_2, T_1, T_0\right)$ where $Q_2$ is the MSB. The excitation equations are:$$\begin{aligned}& T_0=1 \\\\& T...
4 4 votes
2 2 answers
284
284 views
GO Classes asked Feb 27
284 views
You are tasked with implementing a $3$-input XOR gate using a single $4$-to-$1$ Multiplexer. The inputs to the XOR gate are $X, Y, Z$. If $X$ and $Y$ are connected to the...
6 6 votes
3 3 answers
314
314 views
GO Classes asked Feb 27
314 views
Consider a Boolean function $f(A, B, C, D)$ expressed as the sum of minterms $\sum m(0,1,2,5,8,9,10)$. If the variable $A$ is the Most Significant Bit (MSB), which of the...