Discover the PCIM Europe

CODING Scope of coding for electrical and electronics engineers: Five types of programming languages you must know

From Venus Kohli Reading Time: 5 min

Related Vendors

The term “coding” is analogous to computer, IT, and software engineers and breadboard connections to electrical/electronics engineers. But it is a lesser-known fact that most electrical/electronics engineers are skilled in many programming languages and also work on softwares (EDA-Electronic Design Automation Softwares).

The article explores the levels of coding for electrical/electronics engineers and lists such top 5 programming languages.
The article explores the levels of coding for electrical/electronics engineers and lists such top 5 programming languages.
(Source: Jamie - stock.adobe.com)

Do electrical/electronics engineers really code?

Most people consider that electrical/electronics engineers work on-site with electricity, components, power generators, transmission lines, semiconductor fabrication, PCB manufacturing, etc but do not code. However, electrical/electronics engineers learn extensive coding throughout their courses to develop, design and test efficient systems. The electrical/electronics engineers code to test hardware, simulate and verify circuits and generate design files.

Electrical/electronics engineers use both low-level and high-level coding languages to program and test hardware. One of the biggest challenges in programming and verifying hardware is to have knowledge about how each component works and understand its characteristic curves. Another additional challenge is complex mathematical algorithms like FFT, DFT, and many more equations to realize circuits. There are extremely long lines of code compared to other programming languages. The level of code varies from machine to machine and is based on Boolean algebra and binary numbers.

Some of the domains where electrical/electronics engineers code:

  • Firmware development
  • Control applications
  • Motor drivers
  • Robotics
  • Image processing
  • Signal processing
  • Telecommunications
  • Instrumentation
  • FGPA (Field Programmable Gate Array)
  • ASIC (Application-specific Integrated Circuit)

Top 5 types of programming languages for electrical/electronics engineers

1. C/C++/Embedded C

C: C has been the most basic programming language throughout the last two decades. Most engineers are taught C during their initial course because of its structured programming approach.

Image one.  A program written in C to print “Hello Power Electronics”.
Image one. A program written in C to print “Hello Power Electronics”.
(Source: Venus Kohli)

Most people are confused between C and C++ but they are not the same.

C++: C++ is a programming language that is built on C only.

Image two. A program written in C++ to print “Hello Power Electronics”.
Image two. A program written in C++ to print “Hello Power Electronics”.
(Source: Venus Kohli)

Both C and C++ are used to write code for firmware development.

Embedded C: Embedded C is another variant of C that is used only in embedded systems to program microcontrollers, motors, and other integrated circuits.

Image three.  A program written in Embedded C to print “Hello Power Electronics”.
Image three. A program written in Embedded C to print “Hello Power Electronics”.
(Source: Venus Kohli)

One of the challenges in programming microcontrollers using embedded C is a steep learning curve that requires large lines of code and the use of extensive functions.

C#: Another programming language C# has recently been used by developers more than C and C++.

Image four. A program written in C# to print “Hello Power Electronics”.
Image four. A program written in C# to print “Hello Power Electronics”.
(Source: Venus Kohli)

However, C# is not much used in the electrical/electronics industry but serves-related software and websites in some applications.

2. MATLAB Simulink

MATLAB is software that runs circuit simulations and allows the user to perform various mathematical operations to generate accurate graphical results. The programming language has a large set of functions that enable matrix and array operations seamlessly. MATLAB Simulink has various functions, libraries, controls, and toolboxes that perform complex operations.

Image five. A program written in MATLAB Simulink to print “Hello Power Electronics” after performing several operations.
Image five. A program written in MATLAB Simulink to print “Hello Power Electronics” after performing several operations.
(Source: Venus Kohli)

In electronics engineering, MATLAB Simulink is used in image processing, transformations, and signal processing to design FIR and IIR filters, perform decimation and interpolation, and implement FFT, DFT, and many other mathematical theorems. MATLAB Simulink has one of the best data visualization capabilities that create user-friendly and detailed graphics, plots, charts, etc. These features make MATLAB a reliable tool for mathematicians as well.

3. Python: Most used programming languages

As of 2022, Python has been the fourth most-used programming language among developers. Python is a high-level, object-oriented, function-based, and procedure-oriented programming language for various projects. It supports a wide variety of cross-platform integrations and robust interrupt-handling mechanisms. Despite being extremely popular for computer/IT/software engineers, Python is extensively used in embedded systems and telecommunications.

A program is written in Python to print “Hello Power Electronics”:

print("Hello Power Electronics")

Python allows the user to enter the shortcode for performing various functions. In electrical/electronics engineering, Python is used in signal processing, simulation, visualization, GUI development, and interfacing between different modules to verify digital circuits. PCB design engineers test design algorithms and generate manufacturing files through Python. In telecommunications systems, Python plays a massive role in programming various networking layers for different protocols to support data transfer.

4. Assembly-level language

The assembly-level coding is one of the oldest programming languages that hardware engineers still use. Assembly level is a low-level programming language that is an extension of the actual machine code to humans. Dating back to old intel microprocessors like 8085, 8086, etc, the assembly-level language programmed a huge part of computers and electronics.

Image six.  A program written in Assembly-level language to print “Hello Power Electronics”.
Image six. A program written in Assembly-level language to print “Hello Power Electronics”.
(Source: Venus Kohli)

Even today, assembly-level language gives direct access to hardware and is used extensively in embedded system projects. Efficient memory management, machine-level access, and controllability are some of the features. However, assembly-level language is an old programming language that offers less portability, more debugging, large size, and manual insertion to form new data structures.

Subscribe to the newsletter now

Don't Miss out on Our Best Content

By clicking on „Subscribe to Newsletter“ I agree to the processing and use of my data according to the consent form (please expand for details) and accept the Terms of Use. For more information, please see our Privacy Policy.

Unfold for details of your consent

5. Hardware Description Languages: Verilog, Systems Verilog, and VHDL

Just as the name suggests, Hardware Description Languages (HDL) are used to model, and structurize digital electronic circuits. HDLs are used to code FPGA (Field-Programmable Gate Array), and ASIC (Application-specific Integrated Circuits). An HDL is built especially for “logic gates” to code, simulate and analyze hardware. In fact, logic gates are building blocks of digital electronics and semiconductors. These languages interpret the combinational and sequential logic of electronics that emphasizes timing, memory, synchronization, and execution. The result of coding electronic systems with HDL is the implementation of actual hardware in different applications. Just like an HDL, a Hardware Verification Language (HVL) enables the verification of logic-level circuits in modern electronics. The three widely used HDLs are:

  • Verilog: Verilog is an HDL IEEE 1364 standard to model, and design digital electronic circuits. One of the main features of Verilog is that it performs logic operations to transmit and receive data in the internal registers of various processors.

Image seven. A program written in Verilog to print “Hello Power Electronics”.
Image seven. A program written in Verilog to print “Hello Power Electronics”.
(Source: Venus Kohli)

  • SystemVerilog: SystemVerilog is IEEE 1800 standard to model, design, simulate, verify, and implement hardware. SystemVerilog is an HDL and HVL, an evolution of Verilog that enable the verification of hardware.
  • VHDL: VHSIC Hardware Description Language (VHDL) is IEEE 1076 standard to model and structure electronic systems. VHDL allows direct design and modeling of logic gates that further lays down a foundation of digital electronics.

References

  • https://www.sciencedirect.com/topics/computer-science/hardware-description-languages
  • https://www.statista.com/statistics/793628/worldwide-developer-survey-most-used-languages/
  • https://www.mathworks.com/products/matlab.html
  • https://www.chipverify.com/verilog/verilog-tutorial

Follow us on LinkedIn

Have you enjoyed reading this article? Then follow us on LinkedIn and stay up-to-date with daily posts about the latest developments on the industry, products and applications, tools and software as well as research and development.

Follow us here!

(ID:49645682)