Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A.) (11010 - 01111) = 1 01001 B.) (11110 - 01110 ) = 1 10000 C.) (1111 1110) = 1

ID: 2267916 • Letter: A

Question

A.) (11010 - 01111) = 1 01001

B.) (11110 - 01110 ) = 1 10000

C.) (1111 1110) = 1 1000 0000

D.) (101001 - 000101) =1100100

Verify your answers by converting the numbers to their decimal equivalents performing the operations (Show all work!)

3. Repeat above problem assuming the numbers are 2s compliment signed numbers. Use extensions to equalize the length of the operands.   (8 points)  

(Hint: how to use extensions? Since these are mentioned to be 2s compliment signed numbers, each number is a negative number, MSB corresponding to each number is a 1. To equalize the length in this case, should you be padding zeroes in the front of the number or 1’s? )

  Verify your answers by converting the numbers to their decimal equivalents performing the operations (Show all work!)

Explanation / Answer

Answer :- A) (11010 - 01111) = i.e. 11010 = 26, 01111 = 15, hence 26 - 15 = 9 so 1001

B) 11110 - 01110 = 30 - 14 = 16 so 10000

C) 1111 - 1110 = 15 - 14 = 1 so 0001

D) 101001 - 000101 = 41 - 5 = 36 = 100100

Above shown results are correct answer for first part of the question.

Now doing same with each number as 2's complement number-

A) 11010 - 01111 applying sign extension upto few bits, i.e. adding more MSB bits and then subtracting as usual, we can write-

11111010 - 00001111 = ...11101011 = -(25) + 23 + 2 + 1 = -21 ...........(1), (leave the repeated MSB 1's.)

Now by using decimal equivalent of 2's complement number-

(-(24) + 23 + 21 ) - ( -0 + (23) + 22 + 2 + 20 ) = -6 - (15) = -21...........(2)

Hence from equation (1) and (2) we are getting the same value.   

B) 11110 - 01110 , doing sign extension to some extent, hence

11111110 - 00001110 = 11110000 = -(24) = -16 ...............(1)

From decimal equivalent-

(-(24) + 23 + 22 + 21 ) - (-0 + 23 + 22 + 21 ) = -2 - (14) = -16 ..........(2)

Hence from equation (1) and equation (2), we are getting same value.

Note for 2's complement number weightage of MSB bit is only taken as negative.

Similarly we can do part C and part D.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote