Fujitsu FR30 Computer Hardware User Manual


 
295
13.3 Bit Search Module Operation and Save/Restore Processing
13.3 Bit Search Module Operation and Save/Restore Processing
This section explains the operations of the bit search module for 0-detection, 1-detection,
and change-point detection and also explains save and restore processing.
0-Detection
The module scans the data written to the 0-detection data register from MSB to LSB and returns
the position where the first "0" is detected.
The detection result can be obtained by reading the detection result register.
The relationship between the detected positions and the values to be returned are summarized in
Table 13.3-1.
If no "0" is found (if the value is FFFFFFFF
H
), 32 is returned as the search result.
[Execution example]
Write data Read value (decimal)
11111111 11111111 11110000 00000000
B
(FFFFF000
H
) ==> 20
11111000 01001001 11100000 10101010
B
(F849E0AA
H
) ==> 5
10000000 00000010 10101010 10101010
B
(8002AAAA
H
) ==> 1
11111111 11111111 11111111 11111111
B
(FFFFFFFF
H
) ==> 32
1-Detection
The module scans the data written to the 1-detection data register from MSB to LSB and returns
the position where the first "1" is detected.
The detection result can be obtained by reading the detection result register.
The relationship between the detected positions and the values to be returned are summarized in
Table 13.3-1.
If no "1" is found (if the value is 00000000
H
), 32 is returned as the search result.
[Execution example]
Write data Read value (decimal)
00100000 00000000 00000000 00000000
B
(20000000
H
) ==> 2
00000001 00100011 01000101 01100111
B
(01234567
H
) ==> 7
00000000 00000011 11111111 11111111
B
(0003FFFF
H
) ==> 14
00000000 00000000 00000000 00000001
B
(00000001
H
) ==> 31
00000000 00000000 00000000 00000000
B
(00000000
H
) ==> 32