LIVE Course for free

Rated by 1 million+ students
Get app now
JEE MAIN 2023
JEE MAIN 2023 TEST SERIES
NEET 2023 TEST SERIES
NEET 2023
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
23 views
in Computer by (24.2k points)
closed by
In an 8 bit representation of computer system the decimal number 26 has to be subtracted from 22 and the result in binary 2's complement is _________
1. 00000100
2. 00001100
3. 00000101
4. 00010100

1 Answer

0 votes
by (24.2k points)
selected by
 
Best answer
Correct Answer - Option 1 : 00000100

The correct answer is 00000100

  • Two's complement representation, or, in other words, signed notation - the first bit tells about the sign. The convention is that a number with a leading 1 is negative, while a leading 0 denotes a positive value. In an 8-bit representation, we can write any number from -128 to 127. The name comes from the fact that a negative number is a two's complement of a positive one.
  • 26 has to be subtracted from 22 hence result will be negative. So, to avoid negative results, 2's complement is to be used. We have to find 2's complement of the Subtrahend (26) and add it to the minuend (22). To calculate 2's complement, first, we need to find the 1's complement by swapping all 1 to 0 and all 0 to 1 and then we need to add 1 to it:
    • for 22, Binary = 10110
    • for 26, Binary = 11010, 1's Complement  =  001012's Complement  =  00110
    • Addition = 10110 + 00110 = 11100
    • now in the answer obtained, there is no carry generated. In this case, we will have to find 2's complement of the result in order to find the final result.
    • 11100 = 1's Complement  =  000112's Complement  =  00100
    • In 8 bit representation, we will write 00000100
    • hence our answer is 00000100

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...