[Ada] How do I perform bitwise operations in Ada?

In Ada, bitwise operations can be performed using the predefined logical operators. Here are the bitwise operators available in Ada:

  1. AND operator: and This operator performs a bitwise AND operation between two operands. For example:

    1A := B and C;
    
  2. OR operator: or This operator performs a bitwise OR operation between two operands. For example:

    1A := B or C;
    
  3. XOR operator: xor This operator performs a bitwise XOR (exclusive OR) operation between two operands. For example:

    1A := B xor C;
    
  4. NOT operator: not This operator performs a bitwise NOT operation on a single operand. For example:

    1A := not B;
    
  5. Left Shift operator: sll This operator performs a logical left shift operation on a single operand by a specified number of positions. For example:

    1A := B sll 2;  -- Shift B two positions to the left
    
  6. Right Shift operator: srl This operator performs a logical right shift operation on a single operand by a specified number of positions. For example:

    1A := B srl 3;  -- Shift B three positions to the right
    

Note that these operators can be used with integer and enumeration types in Ada. If you want to perform bitwise operations on individual bits of a variable, you can use the Bit type or predefined packages like Ada.Text_IO, Ada.Text_IO.Integer_IO, etc., to manipulate individual bits.