Many top companies are offering jobs in various roles in Embedded Testing. So, there is a huge scope for professionals in the job market. We at Tekslate, have prepared a bunch of top Embedded interview questions in this blog that covers the basics of embedded systems. We hope you will benefit from these questions and clear your interview easily.
Ans: An embedded system is part of a more extensive electrical or mechanical system dedicated to a specific task. It is a microcontroller or microprocessor-based.
Ans: An embedded system has typically 3 components:
Ans: The fundamental characteristics of an embedded system are:
Ans: Based on performance and functional requirements, there are four types:
Based on performance and microcontroller, there are three types:
Ans: The differences between Serial and Parallel I/O devices are as follows:
Serial:
Type |
Input |
Output |
Synchronous |
Audio/Video signal |
Audio/Video signal |
Asynchronous |
Keypad, mouse, modem |
Printer, modem |
Parallel:
Type |
Input |
Output |
Single-bit |
Rotation, threshold sensors |
Pulses to an external circuit |
Multi-bit |
Vp from ADC, sensors |
LCD, printer |
Ans: The applications are:
Ans: Real-time embedded systems are computer systems that monitor, respond, or control external environments.
Ans: Microcontrollers are self-contained systems inserted in devices to control the actions and features of a product. They are also called embedded controllers.
Ans: Interrupt latency is the time taken to return from a disrupted service to regular functioning.
Interrupt latency is reduced by:
Ans: Types of Buses used are:
TYPE |
DESCRIPTION |
Memory Bus |
It is related to the processor connected to the memory. |
Multiplexed Address/Data Bus |
It reads and writes in the memory, but it decreases performance because of the time consumed in the memory. |
De-multiplexed Bus |
It consists of two wires on the same bus. One wire has the address, and the other one has the data. |
Input/Output Bus |
It uses multiplexing techniques to multiplex the same input and output signals. |
Ans: The different uses of timers in embedded systems are:
Ans: A watchdog timer is an electronic device that is dedicated to a specific operation after a particular time if something goes wrong with a system.
Ans: Embedded systems use infinite loops to process or monitor the state of a program repeatedly. For example, in a customer support telephone system, a pre-recorded audio file is played in case the dialer is on hold.
Ans: Some of the common errors found in an embedded system are:
Ans: The differences between mutexes and semaphores are:
MUTEXES |
SEMAPHORES |
Only the acquired thread releases it. |
Another thread or process can signal it. |
Mutexes always have a known owner. |
The thread is not known. |
It provides deadlock-free mutual exclusion. |
It is a synchronization tool that overcomes that critical section problem. |
Mutexes are binary semaphores. Two states are locked or unlocked. |
Semaphores are counter locks. |
Ans: A recursive function is used when it is known that the number of recursive calls is not excessive. It can be declared inline if required.
Ans: A memory leak is the accumulation of uncleared memory. It stalls the execution of the system if it reaches adequate space.
Ans:
Advantages:
Disadvantages:
Ans: Reasons a system could go blanks are:
The steps to debug are:
Ans: The automotive embedded system is a computer system for electronic devices that controls the mechanism of data and devices.
Ans: Embedded C is an extension of the C programming language. It is used to develop applications based on micro-controllers such as device drivers (camera device drivers, WiFi device drivers, etc.)
Ans: Segmentation fault error is a runtime error that occurs due to a few of the following reasons:
Ans: Stack overflow error occurs if the program accesses the memory beyond its available limit. When this error occurs, the program terminates and does not execute further instructions.
Ans: When a variable is used often, the compiler optimizes it and keeps the variables in its memory. Therefore, volatile prevents the compiler from any optimization.
Ans: The hard real-time Embedded Systems are the ones that depend on the output very strictly on time. Any late response or delay cannot be tolerated and will always be considered a failure. The soft real-time systems on the other are not very rigid as the hard real-time systems. The performance of the system degrades with the lateness of response, but it is bearable and can be optimized to a certain level for reuse of the result.
Ans: There are four levels of testing in embedded systems:
Ans: There are five main stages of the software development life cycle:
Requirement: In this phase, the customer fills a requirement form to write what they actually need from the product.
Analysis: In this phase, the requirements are converted into documents and cover all the functional requirement specifications.
Design: In this phase, the design of the product is prepared. The requirements are converted into architecture design. This phase includes:
Low-Level Design Documentation (LLD)
High-Level Design Documentation (HLD)
Coding: In this phase, the requirements are converted into a coded form.
Testing: In this phase, the software under development is tested for product quality. This includes 2 types:
Static testing
Dynamic testing
Maintenance: In this phase, the maintenance of the product is implemented.
Ans: Software testing refers to the software developing process:
Ans: Equivalence partitioning involves designing a test case to uncover a group or a class of error.
Ans: Some of the common testing tools are:
Ans: The amount of code that has to be dealt with is reduced thus easing the overhead and redundancy is eliminated in case if there is anything common among the functions.
Memory allocation is another aspect that is optimized and it also makes sense to group a set of functions related in some way as one single unit rather than having them to be dispersed in the whole program.
Ans: The most powerful optimization for the compiler is register allocation. That is it operates the variable from the register, then a memory.
Generally, local variables are allocated in registers. However, if we take the address of a local variable, the compiler will not allocate the variable to register.
Ans: Pure functions are those which return a result which depends only on their arguments.
They can be thought of as mathematical functions: they always return the same result if the arguments are the same. To tell the compiler that a function is pure, use the special declaration keyword __pure.
__pure int square(int x)
{
return x * x;
}
The compiler does optimization for pure functions. For example, the values which are allocated to memory can be safely cached in registers, instead of being written to memory before a call and reloaded afterward.
Ans: It’s not an embedded system. Because it will be a part of an embedded system and it does not work on any software.
Ans: In the 8086 processor architecture, memory addresses are specified in two parts called the segment and the offset. Segment values are stored in the segment registers. There are four or more segment registers: Code Segment (CS) contains a segment of the current instruction (IP is the offset), Stack segment (SS) contain a stack of the segment (SP is the offset), DS is the segment used by default for most data operations; ES is an extra segment register.
Ans: Special function registers like accumulator, program controller (PC), data pointer (DPTR), TMOD and TCON (timing registers), 3 register banks with r0 to r7, Bit addressable registers like B.
Ans: As now you are fundamentally familiar with what is a microcontroller And microprocessor, it is easy to recognize the significant contrasts between a microcontroller and microprocessor.
1. Key difference in both of them is the presence of external peripheral, where microcontrollers have RAM, ROM, EEPROM embedded in it while we have to use external circuits in the case of microprocessors.
2. As all the peripheral of microcontrollers are on the single-chip it is compact while the microprocessor is bulky.
3. Microcontrollers are made by using complementary metal-oxide-semiconductor technology so they are far cheaper than microprocessors. In addition, the applications made with microcontrollers are cheaper because they need lesser external components, while the overall cost of systems made with microprocessors is high because of the high number of external components required for such systems.
4. Processing speed of microcontrollers is about 8 MHz to 50 MHz, but on the contrary processing speed of general microprocessors is above 1 GHz so it works much faster than microcontrollers.
5. Generally microcontrollers have a power-saving system, like idle mode or power-saving mode so overall it uses less power, and also since external components are low overall consumption of power is less. While in microprocessors generally there is no power saving system and also many external components are used with it, so its power consumption is high in comparison with microcontrollers.
Ans: A preprocessor is a Program That processes its input data to produce output that is used as input to another program. The output is said to be a preprocessed form of the input data, which is often used by some subsequent programs like compilers. The amount and kind of processing done depend on the nature of the preprocessor.
Some Pre-processors Are Only Capable Of Performing Relatively Simple Textual Substitutions And Macro Expansions, while others have the power of full-fledged programming languages.
A Common Example From Computer programming is the processing performed on source code before the next step of compilation. In some computer languages (e.g., C and PL/I) there is a phase of translation known as preprocessing. It can also include macro processing, file inclusion, and language extensions.
Ans: Where possible, it is best to avoid using char and short as local variables. For the types, char and short the compiler needs to reduce the size of the local variable to 8 or 16 bits after each assignment. This is called sign-extending for signed variables and zero extending for unsigned variables.
It is implemented by shifting the register left by 24 or 16 bits, followed by a signed or unsigned shift right by the same amount, taking two instructions (zero-extension of an unsigned char takes one instruction).
These shifts can be avoided by using int and unsigned int for local variables. This is particularly important for calculations that first load data into local variables and then process the data inside the local variables.
Even if data is input and output as 8- or 16-bit quantities, it is worth considering processing them as 32-bit quantities
Ans: The ARM compilers support inline functions with the keyword __inline.
These results in each call to an inline function being substituted by its body, instead of a normal call.
This results in faster code, but it adversely affects code size, particularly if the inline function is large and used often.
Ans: Device drivers are basically a set of modules/routines so as to handle a device for which a direct way of communication is not possible through the user's application program and these can be thought of as an interface thus keeping the system small providing for minimalistic of additions of code if any.
Physical device drivers can’t perform all the logical operations needed in a system in cases like IPC, Signals, and so on...
The main reason for having virtual device drivers is to mimic the behavior of certain hardware devices without it actually being present and these could be attributed to the high cost of the devices or the unavailability of such devices.
These basically create an illusion for the users as if they are using the actual hardware and enable them to carry out their simulation results.
Examples could be the use of virtual drivers in the case of Network simulators, also the support of virtual device drivers in case a user runs an additional OS in a virtual box kind of software.
Ans: Dirac delta function is a continuous-time function with units are and infinite amplitude at t=0.
The Fourier transform of the Dirac delta function is 1.
Using Dirac delta as an input to the system, we can get the system response. It is used to study the behavior of the circuit. We can use this system behavior to find the output for any input.
Ans: Verification is a front-end process and testing is a post-silicon process. Verification is to verify the functionality of the design during the design cycle. Testing is to find manufacturing faults.
{
a &= ~BIT3;
}
Some people prefer to define a mask together with manifest constants for the set and clear values. This is also acceptable. The element that I'm looking for is the use of manifest constants, together with the |= and &= ~ constructs
Ans: In this case, the cat(x,y) is the macro which is defined by using the preprocessor directive, this will be substituted only at the place where it is called in this example it happens like this
cat(1,2)##3 which will once again become 1##2##3
here if we use ## in between we can join or concatenate only two variables that why it gives a preprocessor warning.
Ans: What Will Happen If We Have A Statement Like Malloc(sizeof(0));
Malloc is the function that is used for dynamically allocating memory to the different variables. The malloc returns a memory pointer of void type (void *). The statement malloc(sizeof(0)) returns a valid integer pointer because the size of(0) represents the size of memory taken up by the integer value of 0. The memory allocated by memory is not automatically cleaned up by the compiler after the execution of the functions and should be cleaned up by the programmer using the free () function.
You liked the article?
Like: 8
Vote for difficulty
Current difficulty (Avg): Medium
TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.