Create a MATLAB structure describing a signed fractional data type
a = sfrac(TotalBits)
a = sfrac(TotalBits, GuardBits)
sfrac(TotalBits) returns a MATLAB structure that describes the data type of a signed fractional number with a word size given by
sfrac(TotalBits, GuardBits) returns a MATLAB structure that describes the data type of a signed fractional number. The total word size is given by
GuardBits bits located to the left of the sign bit.
sfrac is automatically called when a signed fractional data type is specified in a block dialog box.
The default radix point for this data type is assumed to lie immediately to the right of the sign bit. If guard bits are specified, they lie to the left of the radix point in addition to the sign bit.
Define an 8-bit signed fractional data type with 4 guard bits. Note that the range of this number is -24 = -16 to (1 - 2(1 - 8)).24 = 15.875.
a = sfrac(8,4)