Decimal to Q15 format
by Szymon Leja
31 Jan 2008
(Updated 01 Feb 2008)
Function that converts decimal value to Q15 format.
|
Watch this File
|
| File Information |
| Description |
y = dec2q15( x , form )
Function that works with any decimal value (beacuse of saturation using). Available representation of Q15 format are binary or hexadecimal.
Input arguments of function:
x - decimal integer
form - form - dependent on representation of input argument (hexadecimal or binary) take 'hex' or 'bin'
Valu of function:
y - its hexadecimal or binary representation stored in a MATLAB string
EXAMPLE:
>> dec2q15(0.125,'hex')
ans =
1000
>> dec2q15(0.125,'bin')
ans =
0001000000000000
>> dec2q15(-0.775,'hex')
ans =
9ccd
>> dec2q15(-0.775,'bin')
ans =
1001110011001101 |
| MATLAB release |
MATLAB 7.5 (R2007b)
|
| Other requirements |
non |
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Comments and Ratings (1) |
| 11 Feb 2008 |
saroja siddamal
|
|
|
|
Contact us at files@mathworks.com