clz
Count Leading Zeros
rD, rA
clz
1 0 0 1 0 0
0
6
Description
This instruction counts the number of leading zeros in register rA starting from the most significant
bit. The result is a number between 0 and 32, stored in register rD.
The result in rD is 32 when rA is 0, and it is 0 if rA is 0xFFFFFFFF.
Pseudocode
←
n
0
while (rA)[n] = 0
←
n
n + 1
←
(rD)
n
Registers Altered
•
rD
Latency
•
1 cycle
Note
This instruction is only available when the parameter C_USE_PCMP_INSTR is set to 1.
MicroBlaze Processor Reference Guide
UG984 (v2018.2) June 21, 2018
Count leading zeros in rA
rD
rA
11
www.xilinx.com
Chapter 5: MicroBlaze Instruction Set Architecture
0 0 0 0
0
0 0 0 1 1 1 0 0 0 0 0
16
21
31
225
Send Feedback
Need help?
Do you have a question about the MicroBlaze and is the answer not in the manual?
Questions and answers