# Allen Bradley Bitwise Logical Operations

To study the working of Allen Bradley Bitwise logical operations like AND, OR, NOT, XOR in Programmable logic Controllers (PLC).

## Bitwise Logical Operations

### Block Name: Bitwise AND

In the above picture, there are totally three parameters,

SOURCE A â€“ Address of First Binary Value

SOURCE B â€“ Address of Second Binary Value

DESTINATION â€“AND operation result of Source A & B stored in this address

### Block Name: Bitwise OR

In the above picture, there are totally three parameters,

SOURCE A â€“Address of First Binary Value

SOURCE B â€“Address of Second Binary Value

DESTINATION â€“OR operation result of Source A & B stored in this address

### Block Name: Bitwise XOR

In the above picture, there are totally three parameters,

SOURCE A â€“Address of First Binary Value

SOURCE B â€“Address of Second Binary Value

DESTINATION â€“XOR operation result of Source A & B stored in this address

### Block Name: Bitwise NOT

In the above picture, there are totally twoÂ  parameters,

DESTINATION â€“NOT operation result of Source stored in this address

### CASE 1:

When,

Source A : 0000 0000 0000 0000 (AND,OR & XOR)

Source B : 0000 0000 0000 0000 (AND,OR & XOR)

SourceÂ  : 0000 0000 0000 0000 (NOT)

#### Rung 0000:

All Bitwise operator block are connected in parallel with input condition I: 0/0. When it goes ON, each block performs its operation. Since Source addresses are having zeros except NOT block remaining blocks are resulting 0s.

### AND Logic:

Source A : 0000 0000 0000 0000Â Â  (B3:0)

Source B : 0000 0000 0000 0000Â Â  (B3:1)

Destination : 0000 0000 0000 0000Â Â  (B3:2)

### OR Logic :

Source A : 0000 0000 0000 0000Â Â  (B3:0)

Source B : 0000 0000 0000 0000Â Â  (B3:1)

Destination : 0000 0000 0000 0000Â Â  (B3:3)

### XOR Logic :

Source A : 0000 0000 0000 0000Â Â  (B3:0)

Source B : 0000 0000 0000 0000Â Â  (B3:1)

Destination : 0000 0000 0000 0000Â Â  (B3:4)

### NOT Logic :

Source: 0000 0000 0000 0000Â Â  (B3:0)

Destination : 1111 1111 1111 1111Â  (B3:5)

### CASE 2:

When,

Source A : 0010Â  0101 0100 0001Â Â  (AND,OR & XOR)

Source B : 0001 0001 0001 Â 0001Â  (AND,OR & XOR)

SourceÂ  :0101 0100 1000 0111 (NOT)

#### Rung 0000:

I:0/0 giving input condition to all Bitwise Blocks. When it goes ON, value placed in Source A and Source B performs respective operation depends on blocks.

### AND logic:

Source A : 0010Â  0101 0100 0001Â Â  (B3:0)

Source B : 0001 0001 0001 Â 0001Â  (B3:1)

Destination : 0000 0001 0000 0001Â  (B3:2)

### OR Logic:

Source A : 0010Â  0101 0100 0001Â Â  (B3:0)

Source B : 0001 0001 0001 Â 0001Â  (B3:1)

Destination : 0011 0101 0101 0001Â  (B3:3)

### XOR Logic:

Source A : 0010Â  0101 0100 0001Â Â  (B3:0)

Source B : 0001 0001 0001 Â 0001Â  (B3:1)

Destination : 0011 0100 0101 0000Â  (B3:4)

### NOT Logic:

Source: 0101 0100 1000 0111 (B3:0)

Destination : 1010 1011 0111 1000Â  (B3:5)

### Conclusion:

We can use this explanation to understand the workingÂ of Bitwise logical operation like AND, OR, NOT, XOR in Allen Bradley Programmable logic Controllers (PLC).

Author :Â Hema Sundaresan

How to use Converters in PLC