# and4b

The keyword and4b belongs to the family of the bitwise operators operating on bitstrings, hexstrings or octetstrings of equal length. It performs the following operation: for each corresponding bit position, the resulting value is a 1 if both bits are set to 1, otherwise the value for the resulting bit is 0.

Related keywords:

- bitstring
- hexstring
- octetstring
- not4b
- or4b
- xor4b

### and4b

Example 1:

const bitstring c_forsta := '1001'B;
const bitstring c_andran := '0101'B;
var bitstring v_tredje := c_forsta and4b c_andran;

The variable v_tredje will initially contain the value '0001'B.

Example 2:

const hexstring c_elso := 'B'H ;
const hexstring c_afro := '5'H;
var hexstring v_zold := c_elso and4b c_afro;

The variable v_zold will initially contain the value '1'H.

Example 3:

const octstring c_eux := 'FB'O ;
const octstring c_les := '15'O;
var octstring v_ils := c_eux and4b c_les;

The variable v_ils will initially contain the value '11'O.

BNF definition of and4b