[an error occurred while processing this directive]
Все просто. Все fixed поинт числа представлены внутри процессора целыми. Для того, чтобы из целого сделать "вещественное", его надо сдвинуть вправо. Для этого служат Q-форматы. Почитайте spra109
(«Телесистемы»: Конференция «Цифровые сигнальные процессоры (DSP) и их применение»)

миниатюрный аудио-видеорекордер mAVR

Отправлено AntZ 08 января 2003 г. 10:43
В ответ на: Форматы чисел для DSP. отправлено AndrSerg 08 января 2003 г. 10:18

Digital signal processor (DSP) architectures are designed to handle finite number precision. Compared to floating point architecture, fixed-point DSPs offer a limited degree of precision but are usually more cost effective, and offer far superior performance.


To work with fixed-point formats, programmers need to take into consideration that each of the numerical operations should avoid overflow, and that the fractional portion of the number should not be truncated.


Q-values are used whenever a fixed-point variable is used to store a floating-point value. For example, the Q15 is a popular format in which the most significant bit is the sign bit, followed by 15 bits of fraction. The Q15 number has a decimal range between –1 and 0.9999 (0x8000 to 0x7FFF). This Q-value specifies how many binary digits are allocated for the fractional portion of the number.


The main purpose of this application report is to demonstrate how to display variables with a specified Q-value in the watch window. This functionality already exists in the memory window. For example, if the binary form of a variable is 00010011b, and you are using a Q value of 2, then the number is positive since the most significant binary digit is 0, and the two least significant binary digits are 11b. Thus, the fractional portion of (2–1 + 2–2 = .75) and 00100b is the whole portion (22 = 4), so the variable has a value of 4.75.




Составить ответ  |||  Конференция  |||  Архив

Ответы


Отправка ответа

Имя (обязательно): 
Пароль: 
E-mail: 

Тема (обязательно):
Сообщение:

Ссылка на URL: 
Название ссылки: 

URL изображения: 


Перейти к списку ответов  |||  Конференция  |||  Архив  |||  Главная страница  |||  Содержание  |||  Без кадра

E-mail: info@telesys.ru