MANAKULA VINAYAGAR INSTITUTE OF TECHNOLOGY
Kalitheerthal Kuppam, Puducherry – 605 107
PART-A (QUESTION WITH ANSWERS)
SUB: ECT72/EMBEDDED SYSTEMS CLASS: IV ECE
UNIT-I
1. Define system and embedded system with an examples.
A system is also a arrangement in which all its units assemble and work together
according to the plan or program.
Example
1. WATCH
2. WASHING MACHINE
An embedded system is a system that has software embedded into computer-hardware,
which makes a system dedicated for an application (s) or specific part of an application or
product or part of a larger system
Example
1. ACVM – Automatic chocolate vending machine
2. What are the typical characteristic of an embedded system
Typical characteristics:
• Perform a single or tightly knit set of functions;
• Increasingly high-performance & real-time constrained;
• Power, cost and reliability are often important attributes
• That influence design;
Application specific processor design can be a significant component of some embedded
systems.Other characteristics:
• Application specific
• Digital signal processing in ECS
• Reactive
• Real-time
• Distributed
3. List out the important considerationswhen selecting a processor?
• Performance consideration
• Power consideration
• Pheripheral set
• Operating voltage
• Specialized processing unit
4. What are real time systems?
A real-time system is one that must process information and produce a response within a
specified time, else risk severe consequences, including failure.
5. What are the challenges for embedded design?
a. Amount and type of hardware needed
b. Taking into account the design metrics
c. Optimizing the Power Dissipation
d. Process Deadlines
e. Flexibility and Upgradeability
f. Reliability
6. List the important considerations when selecting a processor.
▪ Instruction set
▪ Maximum bits in an operand
▪ Clock frequency
▪ Processor ability
7. In what ways CISC and RISC processors differ?
CISC RISC
It provides number of addressing modes It provides very few addressing modes
It has a miocroprogrammed unit with a It has a hardwired unit without a
control memory control memory
An easy compiler design Complex compiler design
Provide precise and intensive calculations Provide precise and intensive
slower than a RISC calculations faster than a CISC
8.Define instruction level parallelism.
Instruction level parallelism is the degree on average by which the instruction of a program
can be executed in parallel
9. What are the types of memory?
• RAM
• ROM
• PROM
• EPROM
• EEPROM
10. What are the different components of embedded system?
11. Define Von Neumann architecture.
12. Define Harvard architecture.
13. What is meant by RISC?
RISC (reduced instruction set computer) is a microprocessor that is designed to perform
a smaller number of types of computer instructions so that it can operate at a higher speed
(perform more millions of instructions per second, or MIPS).
14. Define RISC Pipeline
• Fetch instructions from memory
• Read registers and decode the instruction
• Execute the instruction or calculate an address
• Access an operand in data memory
• Write the result into a register
15. List out the advantages of RISC architecture.
• Small set of instruction with fixed format (32 bits/instruction)
• Complexity of software in RISC is very LOW because it has small instruction set.
• Reduced instruction set computer
• Small set of instruction with fixed format (32 bits/instruction)
• Complexity of software in RISC is very LOW because it has small instruction set.
• Complexity of processor in RISC is very high because it uses more general purpose
registers.
• RISC have 3-5 addressing modes
• RISC have 32-192 General purpose registers
• Split cache used for instruction and data
• Large Code Sizes.
16. Define VLIW processor.
Very large instruction word means that program recompiled in the instruction to
run sequentially without the stall in the pipeline
17. List out the advantages of VLIW architecture.
• Increased performance
• Better compiler targets
• Potentially easier to program
• Potentially scalable
18. Give any two VLIW and DSP processor.
DSP VLIW
• TMS320Cxx TMS320C64X64
SHARC Intel Itanium IA-64 EPIC
5600xx
19. Define Embedded System processor.
An Embedded Processor is a microprocessor that is used in an embedded system. These
processors are usually smaller, use a surface mount form factor and consume less power.
Embedded processors can be divided into two categories: ordinary microprocessors and
microcontrollers. Microcontrollers have more peripherals on the chip. In essence, an embedded
processor is a CPU chip used in a system which is not a general-purpose workstation, laptop
or desktop computer.
20. Define Multicore processor.
A multi-core processor is a single computing component with two or more independent
actual processing units (called "cores"), which are the units that read and execute
program instructions.
21. Define configurable processor
A configurable processor is one that can be modified or extended to address specific design
issues by changing the processor’s feature set.
22. . Define bus.
Buses: The exchange of information.
Information is transferred between units of the microcomputer by collections of conductors called
buses. There will be one conductor for each bit of information to be passed, e.g., 16 lines for a 16
bit address bus. There will be address, control, and data buses
23. What are the classifications of I/O devices?
i. Synchronous serial input and output
ii. Asynchronous serial UART input and output
iii. Parallel one bit input and output
iv. Parallel port input and output
24. Give the steps for accomplishing input output data transfer
Accomplishing input/output data transfer. There are three main methods used to perform/control
input/output data transfers. They are,
• Software programming (scanning or polling)
• interrupt controlled
• Direct memory access (DMA)
25. What are the two characteristics of synchronous communication?
• Bytes/frames maintain constant phase difference and should not be sent at random time
intervals. No handshaking signals are provided during the communication.
• Clock pulse is required to transmit a byte or frame serially. Clock rate information is
transmitted by the transmitter.
26. What do you mean by asynchronous communication?
The most basic way of sharing data is by copying the data in question to each server. This
will only work if the data is changed infrequently and always by someone with administrative
access to all the servers in the cluster.
27. What are the characteristics of asynchronous communication?
• Variable bit rate – need not maintain constant phase difference
• Handshaking method is used
• Transmitter need not transmit clock information along with data bit stream
28. What are the three ways of communication for a device?
i. Separate clock pulse along with data bits
ii. Data bits modulated with clock information
iii. Embedded clock information with data bits before transmitting
29. What is I2C?
Inter- Integrated Circuit (2-wire/line protocol) which offers synchronous communication.
Standard speed: 100Kbps and High speed: 400 Kbps
SDA – Serial Data Line
SCL – Serial Clock line
30. What is CAN bus and USB bus? Where is it used?
CAN stands for Controller Area Network. Serial line, bi-directional bus used in
automobiles. Operates at the rate of 1Mbps.
USB – Universal Serial Bus.
Operating speed - upto 12 Mbps in fast mode and 1.5Mbps in low-speed mode.
31. What are the features of DSP?
Parallel multiply and add
Multiple memory accesses (to fetch two operands and store the result)
Lots of registers to hold data temporarily
Efficient address generation for array handling
Special features such as delays or circular addressing
32. What do you mean by IrDA?
The Infrared Data Association (IrDA) is an industry-driven interest group that was founded
in 1993 by around 50 companies. IrDA provides specifications for a complete set of protocols
for wireless infrared communications, and the name "IrDA" also refers to that set of protocols.
The main reason for using IrDA had been wireless data transfer over the “last one meter” using
point-and-shoot principles. Thus, it has been implemented in portable devices such as mobile
telephones, laptops, cameras, printers, and medical devices. Main characteristics of this kind
of wireless optical communication is physically secure data transfer, line-of-sight (LOS) and
very low bit error rate (BER) that makes it very efficient.
33. Give any Two configurable designed Chips?
X32V is geared towards low-power, lowmemory embedded systems, such as cell phones, PDAs,
and digital cameras. X32V uses a feature that allows for variable length instructions that
ultimately decrease the amount of program memory required for applications
34. List the Serial Data Communication Devices?
Some of the serial data communication devices are
1. Synchronous Periperal Interface(SPI)
2. Asynchronous UART Serial Connect Interface(SCI)
3. Asynchronous UART mode serial Interface(SI)
4. I2C Bus
35. what is Cache Coherency?
In computer architecture, cache coherence is the uniformity of shared resource data that
ends up stored in multiple local caches. When clients in a system maintain caches of a common
memory resource, problems may arise with incoherent data, which is particularly the case with
CPUs in a multiprocessing system.
36. What is Register Remaining in VLIW architecture?
Register renaming is a technique that eliminates the false data dependencies arising from
the reuse of architectural registers by successive instructionsthat do not have any real data
dependencies between them. The elimination of these false data dependencies reveals
more instruction-level parallelism in an instruction stream, which can be exploited by various and
complementary techniques such as superscalar and out-of-order execution for better performance.
37. Define CODEC
A circuit for encoding the input information in fewer bits and for decoding then coded
information into the complete set of the original. Voice, speech, image and video signals and bits
can be encoded and decoded. The CODEC also functions as a compression and decompression
unit for vice, speech, image and video signals.
38. Classify the processors in embedded system?
i. General purpose processor
Microprocessor
Microcontroller
Embedded processor
Digital signal processor
Media processor
ii. Application specific system processor
iii. Multiprocessor system using GPP and ASSP
iv. GPP core or ASIP core integrated into either an ASIC or a VLSI
circuit or an FPGA core integrated with processor unit in a VLSI
chip.
39. How the data is transfer through I2C Interface?
It uses smae single line for master transmission,as well as salve response.
1. Data Transfer is initiated with a START bit (S) signaled by SDA being pulled
low while SCL stays high.
2. SDA sets the 1st data bit level while keeping SCL low (during blue bar time).
3. The data is sampled (received) when SCL rises (green) for the first bit (B1).
4. This process repeats, SDA transitioning while SCL is low, and the data being
read while SCL is high (B2, Bn).
5. A STOP bit (P) is signaled when SDA is pulled high while SCL is high.
In order to avoid false marker detection, SDA is changed on the SCL falling edge
and is sampled and captured on the rising edge of SCL.
40. What ar different types of Data transfer take place in USB?
1. Control Transfer
2. Bulk Transfer
3. Isochronous transfer
4. Interrupt Transfer
41. What are different types of frames in CAN?
Data Frame
Remote Frame
42. What are the layers present in CAN Protocol?
Physical layer
Transfer layer
Object layer
Application layer
UNIT-II
1. What is the advantage of data type declaration?
Data types refers to an extensive system for declaring variables of different types. The
language itself provides basic arithmetic types and syntax to build array and compound types. Each
data type provides an abstraction of the
(i) methods to use, manipulate and represent
(ii) set of permissible operations.
Eg: char, int, unsignedshort, long, float, double, Boolean
Data types available in c:
S.no Types Data Types
1 Basic data types int, char, float, double
2 Enumeration data type enum
3 Derived data type pointer, array, structure, union
4 Void data type void
3. What is the most important feature in C that makes it a popular HLL for an
embedded system?
Inline assembly
Readily available modules and library functions.
4. Define In-line assembly
C is a language between low and high level language. Inserting the assembly language
codes in between is called in line assembly.
5. Distinguish the interpreter and compiler?
Compiler Interpreter
Translation by the whole at a time. Translation goes by line to line.
Faster operation. Slower operation comparatively.
Error less program helps easier work There is no compilation stage.
of compilation.
6. Difference between assembly level language and high level language?
ASSEMBLY LEVEL LANGUAGE HIGH LEVEL LANGUAGE
It is low level programming language in A high-level programming language is
which the sequence of 0s and 1s are a programming language with
replaced by mnemonic codes. Typical strong abstraction from the details of
instruction for addition and subtraction. the computer.
Example :- ADD for addition , SUB for
subtraction etc
It gives the precise control of the processor It may use natural language elements, be
internal devices and full use of processor easier to use, or may automate (or even hide
specific features in its instruction sets and entirely) significant areas of computing
addressing modes. systems (e.g. memory management).
The machine codes are compact, which It makes the process of developing a program
requires only small memory. simpler and more understandable relative to a
lower-level language
Device drivers need only few assembly Translator program called compiler used to
instructions. convert High level languages into Machine
language.
7. List out some ‘Include’ header files used in ‘C’ language in embedded system?
#include<vxwork.h>
#include<semlib.h>
#include<tasklib.h>
#include<syslib.h>
8. What is a Preprocessor Directive?
Program statements and directives for the compiler before the main function to define
global variable, global macro, new data type and global constants.
9. List the uses of Queues?
Print buffer
Image frames in a sequence
Frames on a network
10. What is list? Give two examples of list data structure.
Contain nodes (element).Each element has a pointer to its next element. Only the first
element is identifiable and it is done by list top pointer. No other element is dentifiable
and hence is not accessible directly.
A series of tasks which are active.
Menu that point to a sub menu.
11. What is tree? Give an example
There is a root element It has two are more branches each having a daughter
element. Each daughter element has two or more daughter elements. The last one does not
have daughters.
Directory
12. Why do you use infinite loop in embedded system?
Infinite loop is used in embedded system in order to make the main program to execute
continuously with out having a halt state since an exit from the loop will make the system hardware
redundant.
13. Define NULL pointers
When a pointer points to NULL it means there is no reference to the memory. A memory
occupied by an element or object or data structure can be freed by pointing it to the NULL.
14. What are the advantages of reentrant functions?
Reentrant function is usable by several task and routines synchronously.
15. Difference between macro and function?
No Macro Function
1 Macro is Preprocessed Function is Compiled
2 No Type Checking Type Checking is Done
3 Code Length Increases Code Length remains Same
4 Use of macro can lead No side Effect
to side effect
5 Speed of Execution is Speed of Execution is Slower
Faster
6 Before Compilation macro name is replaced by During function call , Transfer of Control
macro value takes place
7 Useful where small code appears many time Useful where large code appears many
time
8 Generally Macros do not extend beyond one line Function can be of any number of lines
9 Macro does not Check Compile Errors Function Checks Compile Errors
16. How can optimization be used to eliminate the disadvantages in embedded C++
programs?
• Declare private as many as possible. Ithelps in optimizing the generated codes.
• Use char, int and Boolean in place of the objects as arguments and use local variablesas
much as possible.
• Recover memory already used once by changing the reference to an objects to NULL.
17. Why C language is used in embedded system?
• It is a procedure oriented language.
• Provision of inserting the assembly language codes in between to obtain a direct
hardware control.
• A large program in c’ splits into the declaration for variables, functions and data
structure, simpler functional blocks and statements.
18. What are the advantages and disadvantages of c++?
ADVANTAGES:C++ is an object oriented program (OOPs) language, which in addition,
supports the procedure oriented codes of c.
• Program coding in C++ codes provides the advantage of object oriented
programming as well as the advantage of c and in-line assembly.
DISADVANTAGES:
• Lengthier code when using template.
• Multiple Inheritances.
• Exception handling.
• Virtual base classes and classes for IO streams.
19. What is the difference between pointers and null pointers?
pointers Null pointers
• A pointer is a variable which contains •
A null pointer is a regular pointer of
the address in memory of another any pointer type which has a special
variable. value that indicates that it is not
• We can have pointer to any variable pointing to any valid reference.
type. • This value is the result of type casting
• Int*pointer the integer value zero to any pointer
type.
• Int*p , p=0.
20 . What are the conditions that a reentrant functions must satisfy?
All the arguments pass the values and none of the argument is a pointer, whenever a calling
function calls that function.
When an operation is not atomic that function should not operate on any variable which is
declared outside the function or which an interrupt service routine uses or which is a
global variable but passed by reference and not passed by value as an argument in to the
function.
Reentrant function doesn’t call any other function that is not itself reentrant
21. What are the advantages of building ISR queues?
Multiple function pointers are queued during ISRs. Each ISR is designed with short set of
codes. It doesn’t execute any unessential codes with in the ISR.
21. What is meant by optimization of memory?
• Certain steps changed to reduce the need for memory and having a compact code.
• It reduces the total size of the memory needed. It also reduces the total number of CPU cycles,
and thus total energy requirements.
22. Mention the advantages of High Level Language?
• It Increase the no. of character representation like ASCII,UNICODE etc.
• Efficient programming in human readable language.
• Maximum part of compilers are International language(English).
• No need to remember code, symbols like Assembly or machine language.
• It increase individual performance among programmers.
• 80 countries languages are part of java language provide dynamic nature in LOC.
• Increase possibility to do work within deadline.
23. Name the C Program Elements?
A C Program has following structural elements
1. Preprocessor Declarations, definitions, and Statements.\
2. Main Functions,
3.Functions , exceptions. and ISR'S
It also has the Preprocessor Structural elements
1.Include directive for the file inclusion.
2.Definiton for preprocessor global variables.
3.Definitions of constants.
4.Declaration for global data type,type declaration and data structures,macros and
functions.
24. What is the necessity of macro instruction?
The codes for the macro are compiled for every function wherever the macro name is used,
as the compiler before the compilation, puts the codes at the places wherever the macro is
used . On using the macro the processor does not have to restore the context, as there is no
return.
Macro are used when short functional codes are to be inserted in a number of places or
functions.
25. What is an object in C Program?
An "object" refers to a particular instance of a class where the object can be a combination
of variables, functions, and data structures.
26. Define DFG model with an example?
A data flow means that a program flow and all program execution steps are determined
specifically by data.
The software designer pre determines the data input and design the programming steps to
generate the data output. eg. a program for finding an average of the grades in various
subject will have the data inputs of the grades and data output of the averages.
27. Define Bottom-Up Design and Top-Down Approach?
Bottom-up-design approach is used. It is an approach in which programming is first done for
the sub modules of the specific and distinct sets of actions.
Top-down design is another programming approach, in which the main program is first
designed, then its modules, sub-modules, and finally, the functions.
28. Define Macro?
A macro is a collection of codes that is defined in a C program by a name. It differs from a
function in the sense that once a macro is defined by a name, the compiler puts the
corresponding codes for it at every place where that macro name appears. For example,
consider the macros, enable_Maskable_Intr( ) and disable_Maskable_ Intr( ).
29. What are the types of programming model?
Polling for events model
Sequential program model.
Data flow model.
State machine model.
Concurrent process and inter process communication model.
30. State application of the graphics to Multiprocessor System?
There are minimum number of IPCs so that the total time of IPC delays minimized.
There is load balancing. Each processor has the least waiting time.
The performance cost minimizes.
31. what is meant by Performance Cost?
Performance cost means the execution time required
o delays at the edge
o the Computation time
o context switching time
UNIT-III
1. Define process, task and task states.
A process is a program that performs a specific function.
A task is a program that is within a process. It has the following states:
1. Ready
2. Running
3. Blocked
4. Idle
2. Define (TCB)
The TCB stands for Task Control Block which holds the control of all the tasks within
the block. It has separate stack and program counter for each task.
3. What is a thread?
A thread otherwise called a lightweight process (LWP) is a basic unit of CPU utilization,
it comprises of a thread id, a program counter, a register set and a stack. It shares with other threads
belonging to the same process its code section, data section, and operating system resources such
as open files and signals.
4. What are the benefits of multithreaded programming?
The benefits of multithreaded programming can be broken down into four major categories:
• Responsiveness
• Resource sharing
• Economy
• Utilization of multiprocessor architectures
5. Compare user threads and kernel threads.
• User threads are supported above the kernel and are implemented by a thread library at the user
level.
• Kernel threads are supported directly by the operating system .
• Thread creation & scheduling are done in the user space, without kernel intervention.
• Therefore they are fast to create and manage
• thread creation; scheduling and management are done by the operating system. Therefore they
are slower to create & manage compared to user threads Blocking system call will cause the
entire process to block if the thread performs a blocking system call, the kernel can schedule
another thread in the application for execution
6. Define RTOS.
A real-time operating system (RTOS) is an operating system that has been developed for
real-time applications. It is typically used for embedded applications, such as mobile telephones,
industrial robots, or scientific research equipment.
7. Define CPU scheduling.
CPU scheduling is the process of switching the CPU among various processes. CPU
scheduling is the basis of multi-programmed operating systems. By switching the CPU among
processes, the operating system can make the computer more productive.
8. Define Synchronization.
Message passing can be either blocking or non-blocking. Blocking is considered to be
synchronous and non-blocking is considered to be asynchronous.
9. Define Inter process communication.
Inter-process communication (IPC) is a set of techniques for the exchange of data among
multiple threads in one or more processes. Processes may be running on one or more computers
connected by a network. IPC techniques are divided into methods for message passing,
synchronization, shared memory, and remote procedure calls (RPC).
10. Define Semaphore.
• A semaphore is a variable or abstract data type that is used for controlling access, by
multiple processes, to a common resource in a parallel programming or a multi user
environment.
• A semaphore ‘S’ is a synchronization tool which is an integer value that, apart from
initialization, is accessed only through two standard atomic operations; wait and signal.
• Semaphores can be used to deal with the n-process critical section problem. It can be
alsoused to solve various synchronization problems.
The classic definition of ‘wait’
wait (S){
while (S<=0)
;
S--;
Embedded Systems
SCT-DEPARTMENT OF ECE
}
The classic definition of ‘signal’
signal (S){
S++;
}
11. When the error will occur when we use the semaphore?
i. When the process interchanges the order in which the wait and signal operations on the
semaphore mutex.
ii. When a process replaces a signal (mutex) with wait (mutex).
iii. When a process omits the wait (mutex), or the signal (mutex), or both.
12. Differentiate counting semaphore and binary semaphore.
Binary Semaphore:
The general-purpose binary semaphore is capable of addressing the requirements of both
forms of task coordination: mutual exclusion and synchronization. A binary semaphore can be
viewed as a flag that is available (full) or unavailable (empty).
Counting Semaphore:
The counting semaphore works like the binary semaphore except that it keeps track of the
number of times a semaphore is given. Every time a semaphore is given, the count is incremented;
every time a semaphore is taken, the count is decremented. When the count reaches zero, a task
that tries to take the semaphore is blocked. As with the binary semaphore,
13. What is priority inheritance?
Priority inheritance is a method for eliminating priority inversion problems. Using this
programming method, a process scheduling algorithm will increase the priority of a process to the
maximum priority of any process waiting for any resource on which the process has a resource
lock.
14. Define Message Queue.
A message queue is a buffer managed by the operating system. Message queues allow a
variable number of messages, each of variable length, to be queued. Tasks and ISRs send messages
to a message queue, and tasks can receive messages from a message queue (if it is nonempty).
Queues can use a FIFO (First In, First Out) policy or it can be based on priorities.
15. Define Mailbox and Pipe.
A mailboxes are software-engineering components used for inter process communication,
or for inter-thread communication within the same process. A mailbox is a combination of a
semaphore and a message queue (or pipe).
Message queue is same as pipe with the only difference that pipe is byte oriented while
queue can be of any size.
16. Define Socket.
A socket is an endpoint for communications between tasks; data is sent from one socket to
another.
17. Define deadlock.
A process requests resources; if the resources are not available at that time, the process
enters a wait state. Waiting processes may never again change state, because the resources they
have requested are held by other waiting processes. This situation is called a deadlock.
18. What are conditions under which a deadlock situation may arise?
A deadlock situation can arise if the following four conditions hold simultaneously in a system:
1. Mutual exclusion
2. Hold and wait
3. No pre-emption
4. Circular wait
19. What are the various shared data operating system services?
• explain how operating systems provide abstraction from the computer hardware.
• describe the meaning of processes, threads and scheduling in a multitasking operating
system.
• describe the role of memory management explaining the terms memory swapping,
memory paging, and virtual memory.
• contrast the way that MS-DOS and Unix implement file systems compare the design of
some real operating systems.