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

Click For 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!)
 
Learn If you want to write code for Python Machine learning, AI Statistics/data analysis Scientific research Web application servers Some microcontrollers JavaScript/Node JS/TypeScript Web sites Web application servers C# Games (Unity) Consumer applications (Windows) Business applications C++ Games (Unreal Engine) Operating systems, device drivers Microcontrollers/embedded systems Consumer applications (Linux) Some more tips: Do not learn C++ (or any other dialect of C) as a...

Similar threads

Replies
10
Views
5K
  • · Replies 9 ·
Replies
9
Views
4K
Replies
16
Views
3K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 49 ·
2
Replies
49
Views
4K
Replies
1
Views
2K
  • · Replies 38 ·
2
Replies
38
Views
2K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 17 ·
Replies
17
Views
3K