Chapter 6 Applied Instructions S1 b0 b15 Y0 Y1 Y2 Before the instruction is executed S2 b0 b15 Y10 Y11 Y12 D b0 b15 After the instruction is executed Y20 Y21 Y22 Additional remarks 1. If S 1 +n-1 , S 2 +n-1 , or D+n-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003. 6_ 2. If n is not between 1–256, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B. 3. Explanation of matrix instructions: A matrix is composed of more than one 16-bit register. The number of registers in a matrix is the length of the array n . There are 16Ч n bits in a matrix, and the matrix operation is performed on one bit at a time.
The matrix instruction takes the 16Ч n bits in a matrix as a string of bits, rather than as values. The matrix operation is performed on each bit. Matrix instructions mainly process the one-to-many or many-to-many status, such as moving, copying, comparing, and searching by bit. You must specify a 16-bit register for the matrix instruction. The 16-bit register specifies a certain bit among the 16 n bits in the matrix for the operation, and the 16-bit register is called the pointer. The value in the register is between 0–16 n -1, and corresponds to the bit between b0–b16 n -1. Shifting or rotating of the specified data can be involved in the matrix operation.
Note that the bit number decreases from the left to the right, as illustrated below. 6-237 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0