in Education by
Ankita takes as input 2 integer numbers, a and b, whose value can be between 0 and 31. He stores them as 5 bit numbers. He writes the following code to process 9 these numbers to produce a third number c. c = 2*(a – b) In how many minimum bits should Ankita store c? Op 1: 6 bits Op 2: 7 bits Op 3: 8 bits Op 4: 9 bits Op 5: Select the correct answer from above options

1 Answer

0 votes
by
Ankita can use the option 2 and that is 7 bits. If two numbers are taken like number a, 11100 (28) and number b, 11101 (29). a-b implies subtracting 29 from 28 and it results in -1 or -00001. We need an extra bit to store the sign. We are using a minimum of 6 bits. 2(a-b)=-00010 (-00001×2). This process required the carry bit. We are using minimum of 5+2=7 bits.

Related questions

0 votes
    Write a program in java to display the given pattern. 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 Please ... as brainlist Please answer it very fast Select the correct answer from above options...
asked Dec 21, 2021 in Education by JackTerrance
0 votes
    Write a function in python to sort n numbers of integer stored in a list passed as parameter in function selesort(L[],n) Select the correct answer from above options...
asked Dec 14, 2021 in Education by JackTerrance
0 votes
    Which of the following input control is used for input fields that should contain a value from a range of numbers in Web Form 2.0? A - week B - time C - number D - range...
asked Dec 2, 2020 in Technology by JackTerrance
0 votes
    If A =1,B’=0, C=0 are the input of a NOR GATE what will be the out put Select the correct answer from above options...
asked Dec 13, 2021 in Education by JackTerrance
0 votes
    If A =1,B’=0, C=0 are the input of a NOR GATE what will be the out put. Select the correct answer from above options...
asked Dec 11, 2021 in Education by JackTerrance
0 votes
    If A =1,B’=0, C=0 are the input of a NOR GATE what will be the out put. Select the correct answer from above options...
asked Dec 11, 2021 in Education by JackTerrance
0 votes
    WAP in java to input 2 numbers from user and print their difference (Always Positive). Select the correct answer from above options...
asked Dec 19, 2021 in Education by JackTerrance
0 votes
    2 Write an algorithm to input two numbers and find their sum and difference Select the correct answer from above options...
asked Nov 28, 2021 in Education by JackTerrance
0 votes
    2) She Crosk) as a recepotionist 31 He with his parents at the moment, Cleave) 4) I always get up at Go' ... an friend te to are friend Select the correct answer from above options...
asked Dec 21, 2021 in Education by JackTerrance
0 votes
0 votes
    Write a C program to accept an integer number between 1 and 9. Write the value of the number in words. Select the correct answer from above options...
asked Dec 14, 2021 in Education by JackTerrance
...