Multiplication of large numbers on microcontroller

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I wanted to know some information on simulation of any 8 bit AVR microcontroller on Proteus.  Please help me if you know anything about these : -

 

(I have just recently started using the softwares Atmel Studio 7 and Proteus 8 Professional).

 

1) So far I have understood that if I want to display the output of any mathematical operation that I perform in my code,   blinking LEDS is an option / or displaying through LCDs , these are the only way possible .  (Please correct me if I'm wrong)

Is there any way to just do normal printing on any console using Atmel Studio ? (I have tried using printf statement, the code builts without any error, but I couldnt figure out where will the print statement show up :/ ) Is it possible at all ?

Though sprintf kindof works. 


 

Suppose I want to perform a normal multiplication of larger than 8 bits input say,  a =1234 , b =7346 , c= a*b , will I need to use multiprecision arithmetic library like GMP?

 

2)Second thing is, in normal C code, when I do some mathematical operation, I can measure the cpu cycles it took to perform that certain task. In case of simulation of a microcontroller, I know I can run my same C code on Atmel Studio and simulate on any microcontroller on Proteus, but will it be possible to measure processor cycles it took to perform that particular operation on Proteus? If so then how?

 

 

 

 

 

 

 

TBANRJEE

Last Edited: Fri. Jan 12, 2018 - 06:13 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 2

Why on earth did you buy a very expensive software package that can tell you exactly what is going on at what moment on what bit even and totally do not bother to to use it?

 

Protheus should be able to tell you exactly what is happening at what moment and what the output is that is actually generated.

 

Why do you not start using that very expensive tool to your advantage?

If you run into problems with Protheus itself, you should first contact their support people. You payed an awful lot of money to them to give you support when you have trouble, yet you come here.....

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

okay, so you mean mailing/getting in contact with Labcenter Electronics ?  like this website https://www.labcenter.com/contact/

??

TBANRJEE

Last Edited: Fri. Jan 12, 2018 - 06:46 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes. And don't forget to include your customer number.

 

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

using the softwares Atmel Studio 7

 If you're programming in C, the compiler will handle multiplication for you, up to 64bits (long long) in each operand, signed or unsigned.  (up through 32bits * 32bits, there are pretty highly optimized assembly functions in C library that do this.   For 64bits, I think it uses "generic" gcc C code, and is significantly less efficient.

 

how to use printf() is described here: http://www.nongnu.org/avr-libc/u...
For simulation purposes, it may be easier to use sprintf() to a buffer, and then look at the buffer.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Tanushree Banerjee wrote:
okay, so you mean mailing/getting in contact with Labcenter Electronics ? 

Yes - as has been said to you in at least two of your threads already!!

 

Note that they also have a User Forum: https://support.labcenter.com/forums/index.php

 

There's also a load of tutorials, videos, etc on the https://www.labcenter.com/ website; you need to pay attention to those - you won't get a good reception if you're just asking basic questions which are already covered in the documentation & support materials ...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sure @awneil I'll do that. Sorry for not paying attention to your advise before :( Thanks!

 

TBANRJEE

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

There are also plenty of Proteus tutorials on Youtube.