C/C++ C++ programming and electrical engineering

AI Thread Summary
C++ programming has applications in electrical engineering, particularly in designing algorithms for tasks such as PCB routing and FPGA logic block management. Some engineers prefer C++ for its efficiency in implementing algorithms with data structures, as opposed to using C, which may introduce unnecessary overhead. While programming is not a requirement for all electrical engineers, it can enhance projects, especially in areas like microcontrollers and digital logic design. For example, using a microcontroller can simplify tasks like creating LED effects compared to traditional circuit methods. The flexibility of software allows for easier corrections compared to hardware modifications. Additionally, not all electrical engineers engage in electronics design; many may work in diverse fields such as power distribution, testing, technical writing, or even unrelated careers.
land_of_ice
Messages
136
Reaction score
0
Is C++ programming used in electrical engineering work, it really doesn't seem as though it would be,but what could it be useful for, some kind of possible scenario ? (E.E. encorporates the use of electricity to make things happen mainly, whereas C++ has to do with computer design)
 
Technology news on Phys.org
Well you can use C++ to design algorithms. For example, implementing a routing algorithm for PCB routing, or routing of logic blocks or logic clusters on an FPGA. Some engineers would prefer the use of C++ to design such algorithms, because they find it easier to implement the algorithm using data structures in a particular language. Sometimes using only C may leave you with a lot of overhead. But it really depends on the application.
 
basic is used a lot with pics - unless you plan to go professional this would be the way to go.
 
One does not need to use programming whatsoever as an electronics engineer. However, you'll probably end up doing lots and lots of analog electronics or lots and lots of discrete logic.

I have a friend who wanted to make an LED flash when a button was pushed. He was going to use a 555 timer circuit along with a transistor (around a half-dozen parts, utilizing some resistors he didn't have on hand and probably an hour or two of tinkering). I suggested that he use a small microcontroller instead, and a half-dozen or so lines of c code. Or a few more lines to make really cool lighting effects (this was for a Deathstar cake his fiancée had been commissioned to make). Ironically, I'm the EE, and he's the CompSci.

In a nutshell, programming (and microcontrollers, CPLDs, FPGAs, etc.) allow you to trade hardware for software. And if you mess up, it's often much easier to fix software mistakes (by reprogramming, or uploading new software to reprogrammable devices) than hardware mistakes (track cutting, ugly board hacks, etc.)

And of course, not all EEs (nor even a significant portion of them) end up doing electronics design (e.g. power distribution systems), design at all (e.g. testing or technical writing), or even something that nebulously falls under the aegis of engineering! (E.g. management or sales, and that doesn't count the people that decide to ditch their EE degrees and go to law school or become a priest, or a banker--things that some of my classmates actually ended up doing!)
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...
Back
Top