Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Which language to use for DSP, C or Assembly ?

Status
Not open for further replies.

mjinux

Newbie level 3
Joined
Aug 6, 2006
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,318
c or assembly language

i have read the book about dsplf240x. now i will learn the programme about dsp. but i have some questions. which language should i to use? c or assembly language?
who could give me the answer?
 

Re: c or assembly language

I would go with C. it is the most widely used, you can find a C compiler for almost any processor. I find assembly to be very fun myself, but assembly changes from processor to processor, some only having 30 or so instructions, and others having hundreds. Assembly also takes longer to program in though, the effort usually results in a program that runs faster, but you will want to question if that is worth the extra effort in the project. you can also do inline assembly in most C compilers so it is useful to understand.

I learned Assembly first and I found it to be a huge head start when I began to study C. Understanding Assembly is like understanding what goes on underneath the bonnet of a C program, and if ever your compiler generates code which a) doesn't work properly or b) isn't as efficient as you'd like, you've always got the option of modifying the resulting code manually.

If anyone else on this forum is interested in C, and you have the time, I'd definately advise you to get your feet wet with Assembly first.

Quoted from:
https://www.electro-tech-online.com/general-electronics-chat/23091-c-assembly-java.html

Regards,
IanP
 

Re: c or assembly language

I would suggest to use Assembly first then go to C Programming.
 

Re: c or assembly language

Completely agree with previous post.
Assembly will let u visulize how the work is being done at its most basic level and provide a good understanding.
Once u master assembly C is always an easier option and in bigger codes , infact the only option.
 

c or assembly language

of course starts with assemply then migarate to C
search for peter norton assemply it's very nice
 

c or assembly language

mjinux, you should know both . It is preferred as you will have advantage over control of mcu . Example ? Let take one - there is an interrupt routine to be executed very frrequently . Defining interrupt routine in C will force compiler to push/pull all gp registers to stack . It is not much bad but sometimes there are a lot of registers to push and less time to handle interrupt . Let say for AVR you have 32 registers and you can reduce their number to 20 by locking them from compiler . But that means your interrupt routine still contains 40 push pull
operations . But you can write your isr by hands using asm and push pull only few registers (as much as you need) and your job will be done quicker .
 

Re: c or assembly language

In my opinion, using Assembly is better.
If you use C , the code will need big memory after converting to assembly.It will be also more slowly.Although C is very easy to use , It will cost you money to find bigger memory.
 

Re: c or assembly language

Hello,

Regarding the C compilers that generate large and ineffective code, they belong to the past. Informit has a very cool article on this, "Debunking the Myth of High-level Languages" - h**p://www.informit.com/articles/article.asp?p=486104&rl=1 Anyway, compilers nowadays can generate far more efficent code than an unexperienced assembly programmer during his best day. It's true, differences do exist betwwen compilers, but the code is still more efficient than hand coded assembly. In my opinion, one should use C and turn to assembly only if necessary - maybe for highly optimized peripheral acces or very small timings, comparable with the period of the machine cycle.

Best Regards
 

c or assembly language

I would definitely get a llittle assembly before c. I'm not sayng master it, but learn how it works at the hardware level. I started with doing c++ at my university, and struggled with it (although I did manage to pull up my D grade from my midterm to a B+ at the end of the semester) but wthen I took a course on micro processors and got some experience using assembly. Programming made a lot more sense at the higher levels. It seems us hardware guys have an easier time understanding how programming works when we see what hardware is actually associated with the program we are writing, and at the assembler level it's pretty easy to see how it all works together.
 

Re: c or assembly language

Know assembly,use C :D
 

Re: c or assembly language

u have to get exposed to assembly first to get an idea how everything is working in details

then use C after that to have more efficient codes
 

Re: c or assembly language

Even though C is easy to read and understand it hardly tells u anything about the structure of the logical machine. Assembly on another hand consumes very less space and gives u a complete understanding of the logical machine and moreover it is fast.

Thanks :)
 

c or assembly language

C, trust me, u won't regret. Almost anywhere in DSP or Micro-Controller designing need to use C.
 

Re: c or assembly language

c is good & general form of programming language.
If u use assembly then u have to go through all mnumonics
 

Re: c or assembly language

C is a better choice since it is easy to use...Assembly is more complicated than C and once u make a slight mistake the whole thing won't compile...
 

Re: c or assembly language

Learn Assembly for knowledge. But always use C, It is much easier, widely accepted an dmore practical. One can not expect from a single person to know each detail if he is working in big project, you have documentation for that. There are nice software like Borland Code composer which makes like easy.
 

Re: c or assembly language

where to use which language is important when ur clock is slow .

EMBEDDED SOFTWARE SHOULD BE
1.MODULAR
2.LAYERED

Write the driver part for ur hardware in assembly and the application part in c,so even if u change ur hardware u have to just make changes into the driver part and the application LAYER should be written in c.(independent of architecture)

advantages of assembly over c : speed of execution BUT hardware dependent code

hint:1::: read abt "#pragma" invoking assembly code in c
hint:2::: mixture of c and assembly is "THE WAY"for embedded software
(study embedded software-- by JONATHAN VALVANO
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top