Block Comparison Operation

Relational operators (Unsigned operations) for 16Bit(Word) and 32Bit(Double word) Data

 

Relational operators compare two values or strings to provide a true and false result.

 

S1

Value to compare

S2

Value to compare

D

Destination where comparison result is stored

B

Starting bit address for D

n

Number of block for comparison

 

Instruction

Device address

No. of Steps

Flag

M

X

Y

K

L

F

T

C

S

Z

D

@D

Int.

Error

Zero

Carry

BK(P)

S1

o

o

o

o

o

o

o

o

-

o

o

o

o

6

o

-

-

S2

o

o

o

o

o

o

o

o

-

o

o

o

o

D

o

-

o

o

o

-

-

-

-

o

o

o

-

B

o

o

o

o

o

o

o

o

-

o

o

o

o

n

o

o

o

o

o

o

o

o

-

o

o

o

-

 

BK

Functions

  • Compare n number of S1 and n number of S2 and save the result from D2 of assigned D1 in sequence.

  • If the result is true then the assigned bit on D will be turned ON.

  • If the result is false then the assigned bit on D will be turned OFF.

  • Relational operation is word type.

  • The range of S1 is -32768 ~ 32767.

  • S1 =, <, >, <=, >=, <> S2 → Flag (F120~125)

 

Comparison

Operator

Result

BK< Less than

S1 < S2

ON

BK<= Less than or equal

S1 <= S2

ON

BK= equal to

S1 = S2

ON

BK> Greater than

S1 > S2

ON

BK>= Greater than or equal

S1 >= S2

ON

BK<> Not equal

S1 ≠ S2

ON

 

Example)

If X01 is ON and D0, D1 and D2 are greater than D100, D101 and D102 then set the M12, M13 and M14 to 1 in sequence.