How does combination of functions reduce memory requirements in embedded systems?
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.
In case of interactive systems display of menu list and reading in the choices of user's could be encapsulated as a single unit.
Explain what is embedded system in a computer system?
An embedded system is a computer system that is part of a larger system or machine. It is a system with a dedicated function within a larger electrical or mechanical system.
Explain interrupt latency and how can we decrease it?
Interrupt latency basically refers to the time span an interrupt is generated and it being serviced by an appropriate routine defined.,usually the interrupt handler.
External signals,some condition in the program or by the occurrence of some event,these could be the reasons for generation of an interrupt.
Interrupts can also be masked so as to ignore them even if an event occurs for which a routine has to be executed.
Following steps could be followed to reduce the latency
isrs being simple and short.
Interrupts being serviced immediately
Avoiding those instructions that increase the latency period.
Also by prioritizing interrupts over threads.
Avoiding use of inappropriate APIs.
When one must use recursion function? Mention what happens when recursion functions are declared inline?
Recursion function can be used when you are aware of the number of recursive calls is not excessive. Inline functions property says whenever it will called, it will copy the complete definition of that function. Recursive function declared as inline creates the burden on the compilers execution.
A vast majority of High Performance Embedded systems today use RISC architecture why?
According to the instruction sets used, computers are normally classified into RISC and CISC.RISC stands for 'Reduced Instruction Set Computing' .The design philosophy of RISC architecture is such that only one instruction is performed on each machine cycle thus taking very less time and speeding up when compared to their CISC counterparts.
Here the use of registers is optimised as most of the memory access operations are limited to store and load operations.
Fewer and simple addressing modes, and simple instruction formats leads to greater efficiency, optimisation of compilers, re-organisation of code for better throughput in terms of space and time complexities. All these features make it the choice of architecture in majority of the Embedded systems.
CISC again have their own advantages and they are preferred whenever the performance and compiler simplification are the issues to be taken care of.