1.02. Bit-wise Operators

  1. If there is a register.in that some bits are continuously getting toggled. How do you find which bits are getting toggled .What is your approach.[AMD Jan-2026]
  2. Convert a given 32bit integer from Little Endian format to Big Endian format.[AMD Jan-2026 ,Analogics Jan-2026]    Example:       Input: 0x12345678 Output: 0x78563412
  3. Set a Value in Bit Range [4:2] [AMD Jan-2026]  Given an 8-bit variable x, set the bit positions from [4:2] with the provided value val.
        Example:      Input:  x = 0b10000010 val = 0b110  Outputx = 0b10011010
  4. Retrieve 4 MSB Bits from a 32-bit Integer [AMD Jan-2026]
  5.  Given a 32-bit unsigned integer, retrieve the 4 Most Significant Bits (MSB) using bitwise operations.
    Example :    Input: x = 0xF2345678  OutputMSB = 0xF
  6. A hardware register is observed where some bits are continuously toggling while others remain stable .Explain your approach to identify which specific bits are toggling.[AMD Dec-2025]
  7.  Write a C program to modify a 16-bit hexadecimal input value. [Mirafra Jan-2026]  Example:  Input: 0xABCD   Output: 0xACBD
  8.  Write separate Set ,Clear And Toggle functions to perform the following operations on an integer for nth bit . [AMD Jan-2026 ,AMD Dec-2025,Vem Feb-2026]
  9. Bit-wise Coding question to (write a program which consists of one starting and ending index you need to toggle the bits from staring index to ending index?[AMD Dec-2025]
  10. Write a C program for function set bits using bitwise operators.[AMD Jan-2026,Vem Feb-2026]
  11. Write a program to count no of set bits.[AMD Dec-2026][5G] [Pentagon Rugged Systems Private Limited] [TeraScale Inc]
  12. Write a program toggle a number in given position using macros [AMD Dec-2025,Analogics -Jan-2026] [Analogics-14-08-24]
  13. Bit-wise Coding question to (write a program which consists of one starting and ending index you need to toggle the bits from staring index to ending index.[AMD Dec-2026]
  14. Bit-wise Coding Question(Write a program to change the swap the bits from first index to second index, you give first index and second index with the length swap through bits.[AMD Dec-2026] first index = 1  second index = 12    length = 31,2,3 bits need to interchange with 12,13,14 bits
  15. complement 7th bit in 37 number[Vem Feb-2026]
  16. Define macros how to set a bit  at particular bit position.[Vem Feb-2026]
  17. Write a program to swap 2 no’s using bitwise.[AMD 11-Feb-2026] I/p:0000 0000 1010
    o/p:1010 0000 0000  how to achieve this
  18. Write a program to reverse the binary bits in a given number.[AMI Nov-2025]
  19. In given number ,replace 1-3 bits values from position 6 onward, from 6th position 3 bits replace 1-3 bits(3 bits swap)?[AMD 11-Feb-2026]
  20. Write a program to swap bits from first index to second index. [AMD 11-Feb-2026]
  21. You are given first index, second index, and length. Swap the bits through the given length.
    First index = 1 Second index = 12
    Length = 3
    Bits 1, 2, 3 need to be interchanged with bits 12, 13, 14.
  22. Write a program to TOGGLE particular bit?[AMD 11-Feb-2026]
  23. Write a program if my input is 0xffffffff and the output should be 0xfff000ff .[AMD 11-Feb-2026]
  24. Invert a Bit In an given Integer .Invert a Bit In an given Integer.[5G]
  25. program to check given number is 2 power or not.[5G]
  26. write and explain the program to set 5th bet in 2bytes integer?(using macro and without using macro).
  27. write a code that check the 5th bit if 1 is there clear and 0 is there set the bit[5G]
  28. set bit with Error Handling(pos should be 0-31 else through the error),similar for clear-bit, Toggle bit [AMI] [AMI-06-05-2024 ]
  29. bitwise operators-why used and two programs[AMI]
  30. how to toggle nth bit in a number[AMI]
  31. how to multiply a number with 2 using bitwise operator[AMI]
  32. WAP to swap the nibbles in a given number?[AMI]
  33. Explain about bitwise operators?[AMI] [5G Testbed] [AMI-06-05-2024 ]
  34. What if we send 10 bit address instead of 8 bit?[AMI]
  35. swap each bit in a variable using bitwise[AMI] [AMI-06-05-2024 ]
  36. what is bitwise operators explain with example?[AMI] [AMI-06-05-2024 ]
  37. Generic code for number of one’s in a given number using bitwise [5G Testbed]
  38. Given number is power of 2 or not using bitwise [Analogics-14-08-24]
  39. How do you check if a given number is positive or negative using bitwise. [5G Testbed]
  40. write and explain the program to set 5th bet in 2bytes integer?(using macro and without using macro). [5G Testbed]
  41. Bitwise operators using write functions set, toggle ,clear and with proper error handling for position bit. [AMI-06-05-2024 ]
  42. write a program to swap 60th position and 10th position of a 64-bit integer using bitwise operators.[AMI-06-05-2024 ]
  43. Explain Bitwise operator with Example ? [AMI-06-05-2023] [Analogics-14-08-24] [TeraScale Inc]
  44. Write Program for set ,clear ,toggle a bit ? [AMI-06-05-2023] [Ample Semi conductors][Mirafra Technologies Pvt. Ltd.] [People Tech Semiconductor Pvt. Ltd-24-07-2024] [VEM Technologies Feb_2026]
  45. write a program to swap 3rd bit position to 7th bit position and 7th bit to 3rd bit in a given number     [AMI-06-05-2023]                               input:0101 1011    output:0001 1111
  46. WAP to swap the nibbles in a given number? [AMI-06-05-2023]
    input:87(1000 0111)   output:78(0111 1000)
  47. write a program  to swap 4th and 9th bits in an 32 bit integer if they are equal. Don’t swap if they are not equal? [AMI-06-05-2023]
  48. write a program to using macro to set ,clear ,toggle a bit particular position ? [Ample Semi conductors] [Analogics-14-08-24]
  49. count number of 1s in given number ,using bitwise operators? [Ample Semi conductors] [Analogics-14-08-24]
  50. write a program to clear first 4 bits and then later set 4 bits without changing remaining bits [Analogics-14-08-24]
  51. If input is 0xABCD write the program to print the output as 0xACBD. [Mirafra Technologies Pvt. Ltd.]
  52. write a program to swap a last to first and first bit to last bit. [Mirafra Technologies Pvt. Ltd.]
  53. Which bitwise operator is suitable for turning off a particular bit in a number? [Mirafra Technologies Pvt. Ltd.]
  54. write a program to show the difference b/w logical and bitwise operator. [People Tech Semiconductor Pvt. Ltd-24-07-2024]
  55. write a program using bitwise a no is power of 2 or not ? [People Tech Semiconductor Pvt. Ltd-24-07-2024]
  56. How do you swap nibbles? [People Tech Semiconductor Pvt. Ltd-24-07-2024]
  57. Write a function that takes an integer and toggle particular bit. [Quanint Techsoft Private Limited]
  58. Write a program to set bits from position 2 to 6 with only bitwise operators in given integer number? [TeraScale Inc]
  59. Write a program to clear bits from position 2 to 6 with only bitwise operators? [TeraScale Inc]
  60. Write a program to set a pattern of bits from position 2 to 6 with only bitwise (no +,- also) [TeraScale Inc]
  61. input is 0x FFFFFFFF , 11010 should shift to  2 to 6 position of i/p [TeraScale Inc]
  62. Write program to reverse the bits [TeraScale Inc]
  63. Write a program to shift first four bit to 12 positions onwards. [TeraScale Inc]
  64. Write a program to shift bit from 15 to 12 positions to first 4 bits. [TeraScale Inc]
  65. Write a program to find sum of n natural numbers. [TeraScale Inc]
  66. Write a program which consists of one starting and ending index you need to toggle the bits from staring index to ending index? [TeraScale Inc]
  67. Write a program to change the swap the bits from first index to second index, you give first index and second index with the length swap through bits? [TeraScale Inc]
    first index = 1
    second index = 12
    length       = 3
    1,2,3 bits need to interchange with 12,13,14 bits
  68. Count the total number of 1s and 0s in the binary representation of a number. [TeraScale Inc] E.g., 1010001 → 1s: 3, 0s: 4.
  69. Count the number of alternating bit patterns in a decimal number. [TeraScale Inc] For example, in the binary number 10110010, there are 5 such transitions (10, 01, 10, 01, 10).
  70. Check if the binary representation is a palindrome. Use decimal input. [TeraScale Inc]
    Example: 100001 is a palindrome
  71. What is the output of this code:
    x=17;
    x=((x>>1) <<2); printf(“%d”,x);
    x=((x & 0xf)^ 0xf); printf(“%d”,x);
  72. write a program complement 7th bit in 37 number [VEM Technologies Feb_2026]
  73. write a program compliment the bit by using bitwise [VEM Technologies Feb_2026]
  74. write a program Print the binary values [VEM Technologies Feb_2026]
  75. Explain bitwise operators with an example.[VEM Technologies 2025]
  76. write a code to convert binary [VEM Technologies 2025] float f 6.16
  77. write a generic code , to clear a bit.[ Vconnect 2025]
  78. write a program of nibble swap[ Vconnect 2025] int x=0xAB;
    print it separate A and B
  79. Explain bitwise operators — set, toggle, clear, extract, load (both hardcoded and generic). [TeraScale]
  80. How to set, clear, and toggle a particular bit using bitwise operators? [TeraScale]
  81. Write a program to set 3rd bit and clear 7th bit in a number. [TeraScale]
  82. Write generic logic to toggle a bit position of a hexadecimal number. [TeraScale]
  83. write a program Set and reset a particular bit using bitwise operators. [TeraScale]
  84. write a program swap 2 bits using bitwise operators. [TeraScale]
  85. write a program swap two integers using bitwise operators (without third variable). [TeraScale]
  86. write a program to swap two bit positions from user input. [TeraScale]
  87. Write a program to swap bits from position 4,5 with bits from position 13,14. [TeraScale]
  88. Given input 0x00000ABC, output should be 0x0ABC0000 — how to achieve this shift using bitwise? [TeraScale]
  89. Input: 0xFFFFFFFF, pattern: 11010 — shift pattern to bits 2 to 6 using only bitwise (no +/- operators). [TeraScale]
  90. Write a program to set bits from position 2 to 6 using only bitwise operators. [TeraScale]
  91. Write a program to clear bits from position 2 to 6 using only bitwise operators. [TeraScale]
  92. Write a program to set a pattern of bits from position 2 to 6 using only bitwise. [TeraScale]
  93. Write a program to reverse the bits of a number. [TeraScale]
  94. Write a program to shift first four bits to 12th position onwards. [TeraScale]
  95. Write a program to shift bits from position 15-12 to first 4 bits. [TeraScale]
  96. Write a program to toggle bits from a starting index to ending index. [TeraScale]
  97. Write a program which consists of one starting and ending index — toggle the bits from starting index to ending index. [TeraScale]
  98. Define macros to set, clear, and toggle a bit. [TeraScale]
  99. Find whether a given number is even or odd using bitwise. [TeraScale]
  100. Find whether a given number is a power of two using a macro. [TeraScale]
  101. Write code to add two numbers without using ‘+’ operator. [TeraScale]
  102. Write code to add two numbers using only bitwise operators. [TeraScale]
  103. Write code to swap two numbers using XOR bitwise. [TeraScale]
  104. Reverse a hexadecimal number (e.g., 0xABCD → 0xDCBA) using bitwise. [TeraScale]
  105. How do you rate yourself in bitwise operators? [TeraScale]
  106. Write a program to swap bits from first index to second index with a given length. (first index=1, second index=12, length=3 — swap bits 1,2,3 with bits 12,13,14) [TeraScale]
  107. Write a program to extract n bits from a given position (user inputs: number of bits and position) [TeraScale]