Shift right on a signed integer as arithmetic shift
R2026bBehavior of signed integer arithmetic right shift for selected hardware
Model Configuration Pane: Hardware Implementation
Description
The Shift right on a signed integer as arithmetic shift parameter describes how the compiler for the hardware fills the sign bit in a right shift of a signed integer. An arithmetic right shift fills bits vacated by the right shift with the value of the most significant bit. The most significant bit indicates the sign of the number in twos complement notation.
Select this parameter if the C compiler implements a signed integer right shift as an arithmetic right shift.
Dependencies
This parameter is enabled only if you can modify it for the selected hardware.
Settings
on (default) |
offSelecting a device by using the Device vendor and Device type parameters sets a device-specific value for this parameter.
onThis option generates simple, efficient code whenever the Simulink® model performs arithmetic shifts on signed integers.
offThis option generates fully portable but less efficient code to implement right arithmetic shifts.
Recommended Settings
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | No impact |
| Efficiency | On |
| Safety precaution | No
recommendation for
simulation without code generation. |
Programmatic Use
Parameter:
ProdShiftRightIntArith
|
| Type: string | character vector |
Value:
"on" | "off"
|
Default:
'on'
|
Version History
Introduced in R2006b
See Also
Topics
- Hardware Implementation Pane
- Hardware Implementation Options (Simulink Coder)
- Specifying Production Hardware Characteristics (Simulink Coder)