Autor Tema: Raiz cuadrada  (Leído 5371 veces)

0 Usuarios y 1 Visitante están viendo este tema.

Desconectado tori

  • PIC10
  • *
  • Mensajes: 4
Raiz cuadrada
« en: 24 de Mayo de 2010, 13:20:30 »
hola a todos,

estoy trabajando en un proyecto con el PIC 16F876A y programando en assembler y me gustaría saber si alguien me puede ayudar a crear una rutina que realice la raiz cuadrada de un número. he conseguido alguna que hace la raiz de un número pero sin decimales, es decir, el resutado es un entero. Pero necesito alguna que sea más precisa para mis calculos. Cualquier ayuda será agradecida, bien código para ese u otro procesador, bien alguna indicación para que al menos pueda ver la estrategia a seguir para desarrollar el código ya que estoy un poco perdido.

gracias de antemano y un saludo.

Desconectado flacoclau

  • Colaborador
  • PIC24H
  • *****
  • Mensajes: 1692
    • El Micro Reactor
Re: Raiz cuadrada
« Respuesta #1 en: 24 de Mayo de 2010, 14:15:20 »
Hola Tori acá te dejo unos links que saqué de google, la verdad es que está interesante el desafío, suerte y espero que postees tus resultados!!
Saludos!!

La raíz cuadrada a mano

Rutina en ensamblador

Pic microcontroler maths square root methods

√Square Roots
Las personas con buena ortografía me atraen textualmente.

El Micro Reactor

Córdoba capital - Argentina.

Desconectado migsantiago

  • Colaborador
  • DsPIC33
  • *****
  • Mensajes: 8257
    • Sitio de MigSantiago
Re: Raiz cuadrada
« Respuesta #2 en: 24 de Mayo de 2010, 15:39:38 »
Hola, una application note directamente desde Microchip para PIC16.

http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1824&appnote=en010982

Citar
Title:      Floating Point Routines
Name:    AN660
Date:    8/26/97
Author:    Frank J. Testa
Description:    This application note presents implementations of the following math routines for the Microchip PICmicro microcontroller family: square root function, exponential function, base 10 exponential function, natural log function, common log function, trigonometric sine function trigonometric cosine function trigonometric sine and cosine functions power function, floor function, largest integer not greater than x, as float, floating point logical comparison tests integer random number generator Routines for the PIC16CXXX and PIC17CXXX families are provided in a modified IEEE 754 32-bit format together with versions in 24-bit reduced format. The techniques and methods of approximation pre-sented here attempt to balance the usually conflicting goals of execution speed verses memory consumption, while still achieving full machine precision estimates. Although 32-bit arithmetic routines are available and constitute extended precision for the 24-bit versions, no extended precision routines are currently supported for use in the 32-bit routines, thereby requiring more sophisticated error control algorithms for full or nearly full machine precision function estimation. Differences in algorithms used for the PIC16CXXX and PIC17CXXX families are a result of performance and memory considerations and reflect the significant platform dependence in algorithm design.


 

anything