Redirected
recategorized
1,558 views

5 Answers

Best answer
4 votes
4 votes
let X=2^3=8=1000

then X-1=7=0111

now X&(X-1)=0000

(here & is bitwise AND= If both bits in the compared position of the bit patterns are 1, the bit in the resulting bit pattern is 1, otherwise 0)

so ans is B
selected by
1 votes
1 votes

X & X-1 is a bitwise operation which is used to check whether a number is power of 2 or not.

For ex. X= 8(1000), X= 7(0111) 

X & X-1 = 0000.

Let X= 16(10000) , X= 15(01111)

X & X-1 = 00000.

The Expression X & X-1 will always give 0 when X is power of 2.

Hence option b) is correct.

1 votes
1 votes
let X=2^3=8=1000

then X-1=7=0111

now X&(X-1)=0000

(here & is bitwise AND= If both bits in the compared position of the bit patterns are 1, the bit in the resulting bit pattern is 1, otherwise 0)
0 votes
0 votes
just take example:

x=0100

x-1=0011

difference= 0000

again

x=10000

x-1=1111

difference =0000

 

so option 2

00.......00
Answer:

Related questions

0 votes
0 votes
4 answers
1
go_editor asked Mar 24, 2020
1,448 views
Convert the octal number $0.4051$ into its equivalent decimal number.$0.5100098$$0.2096$$0.52$$0.4192$
0 votes
0 votes
6 answers
2
go_editor asked Mar 24, 2020
1,530 views
The hexadecimal equivalent of the octal number $2357$ is :$2EE$$2FF$$4EF$$4FE$
0 votes
0 votes
2 answers
3
go_editor asked Mar 24, 2020
1,170 views
ECL is the fastest of all logic families. High speed in ECL is possible because transistors are used in difference amplifier configuration, in which they are never driven...