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$ ?The result $Z$ in decimal is $-45$ and no overflow occurred. The result $Z$ in decimal is $+19$ and an overflow occurred. The result $Z$ in decimal is $-19$ and no overflow occurred. The result $Z$ in decimal is $-27$ and an overflow occurred. Digital Logic goclasses digital-logic goclasses-cs-dpp goclasses-cs-dpp-day-207 goclasses-digital-logic-practice-questions + – GO Classes 459 views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
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). GO Classes answered Feb 27 GO Classes comment Share Follow 0 reply Please log in or register to add a comment.
0 0 votes VIPIN_CHANDRA answered Feb 28 VIPIN_CHANDRA comment Share Follow 0 reply Please log in or register to add a comment.