Computers are unable to store negative numbers, because there is no "-" in binary. As such, they resort to various algorithms to indicate that a number is negative instead.
A computer has the following negative numbers stored in binary form using the 2's complement approach. Which number is wrongly stored?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
A simple and useful technique to find the 2's complement of the number is: F i r s t r e p r e s e n t t h e n u m b e r i n B i n a r y f o r m . T h e n s t a r t f r o m l e f t a n d c o p y d o w n t h e d i g i t s s a m e a s a b o v e u n t i l y o u e n c o u n t e r a 1 . . . O n c e y o u e n c o u n t e r a o n e i n v e r t a l l t h e r e m a i n i n g n u m b e r s i . e c h a n g e 0 t o 1 a n d 1 t o 0 e g : l e t x = 8 9 i n b i n a r y f o r m 8 9 = 0 1 0 1 1 0 0 1 N o w s t a r t i n g f r o m l e f t I e n c o u n t e r 1 i n p o s i t i o n ′ 0 ′ s o I c o p y i t d o w n a n d c h a n g e a l l t h e r e m a i n i n g 1 ′ s t o 0 ′ s a n d 0 ′ s t o 1 ′ s t o g e t 1 0 1 0 0 1 1 1 , w h i c h i s i n f a c t t h e 2 ′ s c o m p l e m e n t o f 8 9 S i m i l a r l y f o r 4 8 = 0 0 1 1 0 0 0 0 2 ′ s c o m p l e m e n t = 1 1 0 1 0 0 0 0 . h e n c e 4 8 i s t h e a n s w e r . .
48 -> (convert to binary) 00110000 -> (flip all bits) 11001111 -> (add 1) 11010000 != 11101000
only the choice which is -48 has the wrong answer.. because -48 in binary form is 1011 0000 and using 2's complement approach -48 is 1011 0000 which is contradictory to the given choice (1110 1000).
Its simple!!!! 1. Convert the decimal number to the binary form.(consider no negative sign) 2. now take the compliment of each number. (if the no. is 1 then compliment should be 0 and vice-a-verse). 3. Add 1 to the no. complimented.(if last digit is 1 than 1+1=0). 4. Now, the number formed is the same decimal no. but with a negative sign.
-48 is wrongly stored. The correct for -48 stored in 2's complement form will be 11010000
Problem Loading...
Note Loading...
Set Loading...
first to convert 48 decimal to binary form which is 00110000 hear -48 is given so that find complement1 's of -48 .11001111+1= 11010000