Author Message
 shreekant
 Posted: Oct 02, 2010 - 01:43 PM
 Joined: Jun 26, 2010 Posts: 2
 hey i'm doing a project on digital communication wherein i need to implement some equation containing logarithmic function..for e.g.log(1+x)where x=input.. can anybody help.. [Your post suggests you can read/write English so I'm not sure why you weren't able to read the rules posted at the top of Academy Forum which would have told you this was the WRONG FORUM. I'll move this to a more appropriate forum though your second post doesn't make it clear whether you mean the 8bit ATmega32 or the 32 bit AVR32 architecture - I'll assume the latter. Moderator]

 timgoh0
 Posted: Oct 02, 2010 - 02:07 PM
 Joined: Apr 06, 2008 Posts: 415 Location: Singapore
 What language, which bit do you need help on? Also, what arch?

 shreekant
 Posted: Oct 02, 2010 - 02:15 PM
 Joined: Jun 26, 2010 Posts: 2
 c language..8 bit..atmega 32(RISC) architechture

 Heihopp
 Posted: Oct 02, 2010 - 09:32 PM
 Joined: Jun 04, 2007 Posts: 496 Location: Norway
 High level solution: include math.h and the like and just use log() function. Low level solution: Actually the binary numbers are "logarithmic" by nature: Log2(256) = 8, Log2(128) = 7 etc. Each bit position add 6 dB to the total so you can just loop trough the bit positions to find the integer part or "characteristic", then use a table lookup for the fraction or "mantissa": http://en.wikipedia.org/wiki/Common_logarithm Algorithm can be like this, using 8 bit table lookup for fraction part: Code: first_set_bit = 31; // MSB of unsigned int if (input==0) return; // Log(0) error while (input&(1<

 Display posts from previous:  All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
 Jump to: Select a forum Forum index|--[AVR (8-bit) Technical Forums]|   |-- AVR forum|   |-- XMEGA forum|   |-- AVR Wireless forum|   |-- AVR GCC forum|   |-- AVR Studio 5 and Atmel Studio 6 forum|   |-- AVR studio 4 forum|   |-- AVRfreaks Academy forum|   |-- AVR Tutorials|--[AVR Software Framework]|   |-- AVR Software Framework|--[AVR32 (32-bit) Technical Forums]|   |-- AVR32 Linux Forum|   |-- AVR32 General (standalone)|   |-- AVR32 Software Tools|   |-- AVR32 Hardware|--[General Electronics Technical Forums]|   |-- General Electronics|   |-- Atmel Security Products|--[Non-technical forums]|   |-- AVRfreaks.net Housekeeping|--[Non-topical forums]|   |-- Off-topic forum|   |-- AVRfreaks Trading Post
All times are GMT + 1 Hour