ESD Solved PDF
ESD Solved PDF
USN
Note: Answer any FIVE full questions, choosing at least ONE question from each MODULE.
*Bloom’s COs
Module -1 Taxonomy Marks
Level
Q.01 a Define Embedded System. Classify an embedded system based on L1 CO1 10
(i) generation (ii) Complexity (iii) Triggering
b Explain the following: L2 CO1 10
(i) Optocoupler (ii) Zig-Bee (iii) Wi-Fi (iv)SPI bus (v) USB
OR
Q.02 a List the features of the following : (i)I2C Bus (ii)IrDA (iii)1-wire
L1 CO1 10
Interface (iv)keyboard (v)UART
b Illustrate the architectural block diagram of embedded system and
L2 CO1 10
mention the components used.
Module-2
Q. 03 a Discuss the Operational and Non-Operational Quality Attributes L2 CO2 10
of an Embedded System.
b Compare (i) DFG and CDFG models with an example. L2 CO2 10
(ii) C v/s Embedded C (iii) Compiler v/s Cross-Compiler
OR
Q.04 a Explain the assembly language based embedded firmware
development with a diagram and mention its advantages and L2 CO2 10
disadvantages.
b Demonstrate coin operated telephone system with a FSM , CO2
L2 10
function of states and state transition diagram.
Module-3
Q. 05 a Explain monolithic and micro kernels with suitable example for L2 CO3 06
each.
b Discuss the terms tasks, process and threads. L2 CO3 08
c Three processes with process IDs P1, P2 and P3 with estimated L3 CO3 06
completion time 10,5,7 ms respectively enter the ready queue
together in order P1, P2 , P3. Calculate waiting time and turn
around time for each process and average waiting time and
TAT.(Assume there is no I/O waiting for the processes.
OR
Q. 06 a Write a note on IAP [In Application Programming] and In System L2 CO3 04
Programming.
b Demonstrate a block schematic of IDE environment for embedded CO3
L2 08
system design and explain their functions in brief. - 08
c Illustrate the concept of ‘deadlock’ with a neat diagram. Mention L3 CO3 08
the different conditions which favors a deadlock situation.
Module-4
Q. 07 a List the different registers of ARM CORTEX – M3 and mention CO4
L1,L2 08
their use. Explain the use of R13, R14 and R15 registers.
Page 01 of 02
BEC601
b Summarize the CPSR configuration. Illustrate how to access L2 CO4 06
different subdivisions of PSR.
c Explain exceptions and interrupts of ARM CORTEX – M3. L2 CO4 06
OR
Q. 08 a Describe with a block schematic, explain the function of various CO4
L1,L2 10
units in ARM Cortex M3 processor architecture in brief.
b Discuss any 5 applications of ARM cortex M3 based on its
L2 CO4
05
features.
c Explain all the processor modes of ARM Cortex M3 along with a CO4
L2 05
diagram.
Module-5
Q. 09 a Explain the following 32 bit instructions with an example for each L2 CO5 08
: ADC, BIC, LSL and PUSH.
b Describe CMSIS with diagram and its functions, organization and L2 CO5 07
scope.
c Write an ALP to add the first 10 integer numbers using Cortex M3 CO5
L3 05
processor.
OR
Q. 10 a Explain the operation of following instruction with syntax and an CO5
example for each : (i)ADD.W (ii)LDMIA (iii)BEQ (iv) LSR L2 10
(v)IF-THEN
b Explain different rotate and reverse instructions of Cortex M3 with L3 CO5 10
example for each.
*Bloom’s Taxonomy Level: Indicate as L1, L2, L3, L4, etc. It is also desirable to indicate the COs and POs to be
attained by every bit of questions.
Page 02 of 02
Answers
1]a)Ans- An embedded system is a combination of 3 types of components: a. Hardware b.
Software c. Mechanical Components and it is supposed to do one specific task only.
Based on generation
First Generation:
➢ The early embedded systems built around 8bit microprocessors like 8085 and Z80 and 4bit
microcontrollers.
➢ Examples: Digital telephone keypads.
Second Generation:
➢ Embedded Systems built around 16 bit microprocessors and 8 or 16bit microcontrollers,
following the first generation embedded systems.
➢ Examples: SCADA systems
Third Generation:
➢ Embedded Systems built around high performance 16/32 bit Microprocessors/controllers.
➢ Application Specific Instruction set processors like Digital Signal Processors (DSPs), and
Application Specific Integrated Circuits (ASICs).
➢ Examples: Robotics, Media, etc.
Fourth Generation:
➢ Embedded Systems built around System on Chips (SoCs), Re configurable processors and
multicore processors.
➢ Highly complex & very powerful.
➢ Examples: Smart Phones.
Based on Complexity & performance requirements
Small-scale:
➢ Simple in application need
➢ Performance not time-critical.
➢ Built around low performance& low cost 8 or 16 bit μp/μc. Example: an electronic toy
Medium-scale:
➢ Slightly complex in hardware & firmware requirement.
➢ Built around medium performance & low cost 16 or 32 bit μp/μc.
➢ Usually contain operating system.
➢ Examples: Industrial machines.
Large-scale:
➢ Highly complex hardware & firmware.
➢ Built around 32 or 64 bit RISC μp/μc or PLDs or Multicore-Processors.
➢ Response is time-critical
➢ Examples: Mission critical applications.
Based on triggering
Embedded systems which are “Reactive” in nature can be classify based on triggering.
Reactive systems can be:
➢ Event triggered
➢ Time triggered
1]b)An-a)Optocoupler
➢ Optocoupler is a solid state device to isolate two parts of a circuit.
➢ Optocoupler combines an LED and a photo-transistor in a single housing (package)
➢ In electronic circuits, optocoupler is used for suppressing interference in data
communication, circuit isolation, High voltage separation, simultaneous separation and
intensification signal etc.
b)ZigBee
➢ ZigBee is targeted for low power, low cost, low data rate and secure applications for
Wireless Personal Area Networking (WPAN)
➢ The ZigBee specifications support a robust mesh network containing multiple nodes. This
networking strategy makes the network reliable by permitting messages to travel through a
number of different paths to get from one node to another.
➢ ZigBee operates worldwide at the unlicensed bands of Radio spectrum, mainly at 2.400 to
2.484 GHz, 902 to 928 MHz and 868.0 to 868.6 MHz
➢ ZigBee Supports an operating distance of up to 100 meters and a data rate of 20 to
250Kbps
➢ ZigBee is primarily targeting application areas like Home & Industrial Automation, Energy
Management, Home control/security, Medical/Patient tracking, Logistics & Asset tracking and
sensor networks & active RFID
➢ In the ZigBee terminology, each ZigBee device falls under any one of the following ZigBee
device category:
➢ ZigBee Coordinator (ZC)/Network Coordinator. The ZigBee coordinator acts as the root of
the ZigBee network. The ZC is responsible for initiating the ZigBee network and it has the
capability to store information about the network.
➢ ZigBee Router (ZR)/Full function Device (FFD) Responsible for passing information from
device to another device or to another ZR.
➢ ZigBee End Device (ZED)/Reduced Function Device (RFD): End device containing ZigBee
functionality for data communication. It can talk only with a ZR or ZC and doesn't have the
capability to act as a mediator for transferring data from one device to another
c)Wi-Fi
➢ Wi-Fi or Wireless Fidelity is the popular wireless communication technique for networked
communication of devices.
➢ Wi-Fi follows the IEEE 802.11 standard.
➢ Wi-Fi is intended for network communication and it supports Internet Protocol (IP) based
communication.
➢ It is essential to have device identities in a multipoint communication to address specific
devices for data communication.
➢ In an IP based communication each device is identified by an IP address, which is unique
to each device on the network.
➢ Wi-Fi based communications require an intermediate agent called Wi-Fi router/Wireless
Access point to manage the communications.
➢ The Wi-Fi router is responsible for restricting the access to a network, assigning IP address
to devices on the network, routing data packets to the intended devices on the network.
➢ Wi-Fi enabled devices contain a wireless adaptor for transmitting and receiving data in the
form of radio signals through an antenna.
➢ The hardware part of it is known as Wi-Fi Radio.
➢ Wi-Fi operates at 2.4 GHz or 5 GHz of radio spectrum and they co-exist with other ISM
band devices like Bluetooth.
➢ Figure illustrates the typical interfacing of devices in a Wi-Fi network
d)Serial Peripheral Interface (SPI) Bus:
➢ The Serial Peripheral Interface Bus (SPI) is a synchronous bi-directional full duplex four
wire serial interface bus.
➢ The concept of SPI is introduced by Motorola.
➢ SPI is a single master multi-slave system. It is possible to have a system where more than
one SPI device can be master, provided the condition only one master device is active at any
given point of time, is satisfied.
➢ SPI requires four signal lines for communication. ▪ Master Out Slave In (MOSI): Signal line
carrying the data from master to slave device. It is also known as Slave Input/Slave Data In
(SI/SDI)
▪ Master In Slave Out (MISO): Signal line carrying the data from slave to master device. It is
also known as Slave Output (SO/SDO)
▪ Serial Clock (SCLK) : Signal line carrying the clock signals
▪ Slave Select (SS/) : Signal line for slave device select. It is an active low signal
➢ The bus interface diagram shown in the figure illustrates the connection of master and
slave devices on the SPI bus.
➢ The master device is responsible for generating the clock signal.
➢ Master device selects the required slave device by asserting the corresponding slave
device’s slave select signal ‘LOW’. The data out line (MISO) of all the slave devices when not
selected floats at high impedance state
➢ The serial data transmission through SPI Bus is fully configurable.
➢ The Serial Peripheral Control Register holds the various configuration parameters like
master/slave selection for the device, baudrate selection for communication, clock signal
control etc. The status register holds the status of various conditions for transmission and
reception.
➢ SPI works on the principle of ‘Shift Register’. The master and slave devices contain a
special shift register for the data to transmit or receive. The size of the shift register is device
dependent. Normally it is a multiple of 8.
➢ During transmission from the master to slave, the data in the master’s shift register is
shifted out to the MOSI pin and it enters the shift register of the slave device through the
MOSI pin of the slave device. At the same time the shifted out data bit from the slave
device’s shift register enters the shift register of the master device through MISO pin
f)Universal Serial Bus (USB)
Universal Serial Bus (USB) is a wired high speed serial bus for data communication. The first
version of USB (USB 1.0) was released in 1995.
The USB communication system follows a star topology with a USB host at the centre and
one or more USB peripheral devices/USB hosts connected to it.
A USB host can support connections up to 127, including slave peripheral devices and other
USB hosts.
Figure illustrates the star topology for USB device connection.
➢ USB transmits data in packet format. Each data packet has a standard format. The USB
communication is a host initiated one.
➢ The USB host contains a host controller which is responsible for controlling the data
communication, including establishing connectivity with USB slave devices, packetizing and
formatting the data.
➢ There are different standards for implementing the USB Host Control interface:
• Open Host Control Interface (OHCI)
• Universal Host Control Interface (UHCI)
➢ The physical connection between a USB peripheral device and master device is
established with a USB cable.
➢ The USB cable supports communication distance of up to 5 metres.
➢ The USB standard uses two different types of connector at the ends of the USB cable for
connecting the USB peripheral device and host device.
➢ 'Type A' connector is used for upstream connection (connection with host) and Type B
connector is used for downstream connection (connection with slave device).
➢ The USB connector present in desktop PCs or laptops are examples for 'Type A' USB
connector.
➢ Both Type A and Type B connectors contain 4 pins for communication
➢ Each USB device contains a Product ID (PID) and a Vendor ID (VID).
• Embedded into the USB chip by the USB device manufacturer.
• The VID for a device is supplied by the USB standards forum.
• PID and VID are essential for loading the drivers corresponding to a USB device for
communication.
➢ USB supports four different types of data transfers:
➢ Control transfer : Used by USB system software to query, configure and issue commands
to the USB device.
➢ Bulk transfer : Used for sending a block of data to a device.
• Supports error checking and correction.
• Transferring data to a printer is an example for bulk transfer.
➢ Isochronous data transfer : Used for real-time data communication.
• Data is transmitted as streams in real-time.
• Doesn't support error checking and re-transmission of data in case of any transmission loss.
• All streaming devices like audio devices and medical equipment for data collection make
use of the isochronous transfer.
➢ Interrupt transfer : Used for transferring small amount of data.
• Interrupt transfer mechanism makes use of polling technique to see whether the USB
device has any data to send.
• The frequency of polling is determined by the USB device and it varies from 1 to 255
milliseconds.
• Devices like Mouse and Keyboard, which transmits fewer amounts of data, uses Interrupt
transfer.
➢ The concept of I2C bus was developed by Philips Semiconductors in the early 1980s.
➢ The original intention of I2C was to provide an easy way of connection between a
microprocessor/microcontroller system and the peripheral chips in television sets.
➢ The I2C bus comprise of two bus lines:
• (Half duplex - one-directional communication at a given point of time)
▪ Serial Clock (SCL line) – responsible for generating synchronisation clock pulses
▪ Serial Data (SDA line) – responsible for transmitting the serial data across devices
➢ I2C bus is a shared bus system to which many number of I2C devices can be connected.
Devices connected to the I2C bus can act as either ‘Master’ device or ‘Slave’ device
➢ The ‘Master’ device is responsible for controlling the communication by
initiating/terminating data transfer, sending data and generating necessary synchronization
clock pulses
➢ ‘Slave’ devices wait for the commands from the master and respond upon receiving the
commands
➢ ‘Master’ and ‘Slave’ devices can act as either transmitter or receiver
➢ Regardless whether a master is acting as transmitter or receiver, the synchronization clock
signal is generated by the ‘Master’ device only
➢ I2C supports multi masters on the same bus
The following bus interface diagram illustrates the connection of master and slave devices on
the I2C bus
➢ The I2C bus interface is built around an input buffer and an open drain or collector
transistor.
➢ When the bus is in the idle state, the open drain/collector transistor will be in the floating
state and the output lines (SDA and SCL) switch to the 'High Impedance' state.
➢ For proper operation of the bus, both the bus lines should be pulled to the supply voltage
(+5 V for TTL family and +3.3V for CMOS family devices) using pull-up resistors.
➢ With pull-up resistors, the output lines of the bus in the idle state will be 'HIGH'➢ The
address of a I2C device is assigned by hardwiring the address lines of the device to the
desired logic level. Done at the time of designing the embedded hardware.
➢ The sequence of operations for communicating with an I2C slave device is listed below: 1.
The master device pulls the clock line (SCL) of the bus to 'HIGH'
2. The master device pulls the data line (SDA) 'LOW', when the SCL line is at logic 'HIGH' (This
is the 'Start' condition for data transfer)
3. The master device sends the address (7 bit or 10 bit wide) of the 'slave' device to which it
wants to communicate, over the SDA line. ▪ Clock pulses are generated at the SCL line for
synchronizing the bit reception by the slave device.
▪ The MSB of the data is always transmitted first.
▪ The data in the bus is valid during the 'HIGH' period of the clock signal
4. The master device sends the Read or Write bit (Bit value = 1 Read operation; Bit value = 0
Write operation) according to the requirement
5. The master device waits for the acknowledgement bit from the slave device whose
address is sent on the bus along with the Read/ Write operation command.
Slave devices connected to the bus compares the address received with the address assigned
to them
6. The slave device with the address requested by the master device responds by sending an
acknowledge bit (Bit value 1) over the SDA line
7. Upon receiving the acknowledge bit, the Master device sends the 8 bit data to the slave
device over SDA line, if the requested operation is 'Write to device’.
If the requested operation is 'Read from device', the slave device sends data to the master
over the SDA line
8. The master device waits for the acknowledgement bit from the device upon byte transfer
complete for a write operation and sends an acknowledge bit to the Slave device for a read
operation
9. The master device terminates the transfer by pulling the SDA line 'HIGH' when the clock
line SCL is at logic 'HIGH' (Indicating the 'STOP' condition
Infrared (IrDA)
➢ Infrared (IrDA) is a serial, half duplex, line of sight based wireless technology for data
communication between devices.
➢ It is in use from the olden days of communication and you may be very familiar with it.
E.g.: The remote control of TV, VCD player, etc. works on Infrared.
➢ Infrared communication technique uses infrared waves of the electromagnetic spectrum
for transmitting the data.
➢ It supports point-point and point-to-multipoint communication, provided all devices
involved in the communication are within the line of sight.
➢ The typical communication range for IrDA lies in the range 10 cm to 1 m. The range can be
increased by increasing the transmitting power of the IR device.
➢ IR supports data rates ranging from 9600bits/second to 16Mbps.
➢ Depending on the speed of data transmission IR is classified into:
• Serial IR (SIR) – supports data rates ranging from 9600bps to 115.2kbps.
• Medium IR (MIR) – supports data rates of 0.576Mbps and 1.152Mbps.
• Fast IR (FIR) – supports data rates up to 4Mbps.
• Very Fast IR (VFIR) – supports high data rates up to 16Mbps.
• Ultra Fast IR (UFIR) – targeted to support a data rate up to 100Mbps.
➢ IrDA communication involves a transmitter unit for transmitting the data over IR and a
receiver for receiving the data.
➢ Infrared Light Emitting Diode (LED) is the IR source for transmitter and at the receiving end
a photodiode acts as the receiver.
➢ Both transmitter and receiver unit will be present in each device supporting IrDA
communication for bidirectional data transfer. Such IR units are known as 'Transceiver’.
➢ Certain devices like a TV remote control always require unidirectional communication and
so they contain either the transmitter or receiver unit. The remote control unit contains the
transmitter unit and TV contains the receiver unit.
➢ Infrared Data Association (IrDA) is the regulatory body responsible for defining and
licensing the specifications for IR data communication.
➢ IR communication has two essential parts: a physical link part and a protocol part.
➢ The physical link is responsible for the physical transmission of data between devices
supporting IR communication. Protocol part is responsible for defining the rules of
communication.
➢ The physical link works on the wireless principle making use of Infrared for
communication.
➢ IrDA is a popular interface for file exchange and data transfer in low cost devices.
➢ IrDA was the prominent communication channel in mobile phones before Bluetooth's
existence.
1-Wire Interface
➢ 1-wire interface is an asynchronous half-duplex communication protocol developed by
Maxim Dallas Semiconductor.
➢ It is also known as Dallas 1-Wire protocol.
➢ It makes use of only a single signal line (wire) called DQ for communication and follows
the master-slave communication model.
➢ One of the key feature of 1-wire bus is that it allows power to be sent along the signal wire
as well.
➢ The slave devices incorporate internal capacitor (typically of the order of 800 pF) to power
the device from the signal line.
➢ The 1-wire interface supports a single master and one or more slave devices on the bus.
➢ The bus interface diagram shown in the figure illustrates the connection of master and
slave devices on the 1-wire bus.
➢ Every 1-wire device contains a globally unique 64bit identification number stored within it.
➢ This unique identification number can be used for addressing individual devices present
on the bus in case there are multiple slave devices connected to the 1-wire bus.
➢ The identifier has three parts: an 8-bit family code, a 48-bit serial number and an 8-bit
CRC computed from the first 56 bits.
➢ The sequence of operation for communicating with a 1-wire slave device is listed below:
1. The master device sends a 'Reset' pulse on the 1-wire bus.
2. The slave device(s) present on the bus respond with a 'Presence' pulse.
3. The master device sends a ROM command (Net Address Command followed by the 64 bit
address of the device). This addresses the slave device(s) to which it wants to initiate a
communication.
4. The master device sends a read/write function command to read/write the internal
memory or register of the slave device.
5. The master initiates a Read data/Write data from the device or to the device.
➢ All communication over the 1 -wire bus is master initiated.
➢ The communication over the 1-wire bus is divided into timeslots of 60 microseconds.
➢ The 'Reset' pulse occupies 8 time slots. For starting a communication, the master asserts
the reset pulse by pulling the 1-wire bus 'LOW' for at least 8 time slots (480 μs).
➢ If a 'slave' device is present on the bus and is ready for communication it should respond
to the master with a 'Presence' pulse, within 60 μs of the release of the 'Reset' pulse by the
master.
➢ The slave device(s) responds with a 'Presence' pulse by pulling the 1-wire bus 'LOW' for a
minimum of 1 time slot (60 μs).
➢ For writing a bit value of 1 on the 1-wire bus, the bus master pulls the bus for 1 to 15 μs
and then releases the bus for the rest of the time slot.
➢ A bit value of ‘0' is written on the bus by master pulling the bus for a minimum of 1 time
slot (60 μs) and a maximum of 2 time slots (120 μs).
➢ To Read a bit from the slave device, the master pulls the bus 'LOW' for 1 to 15 μs.
➢ If the slave wants to send a bit value ‘1' in response to the read request from the master, it
simply releases the bus for the rest of the time slot.
➢ If the slave wants to send a bit value '0', it pulls the bus 'LOW' for the rest of the time slot.
Security
➢ Confidentiality, Integrity, and Availability are the three major measures of information
security.
➢ Confidentiality deals with the protection of data and application from unauthorised
disclosure.
➢ Integrity deals with the protection of data and application from unauthorised
modification.
➢ Availability deals with protection of data and application from unauthorized users.
➢ A very good example of the 'Security' aspect in an embedded product is a Personal Digital
Assistant (PDA). The PDA can be either a shared resource (e.g. PDAs used in LAB setups) or an
individual one.
➢ If it is a shared one there should be some mechanism in the form of a user name and
password to access into a particular person's profile—This is an example of 'Availability’.
➢ Also, all data and applications present in the PDA need not be accessible to all users.
➢ Some of them are specifically accessible to administrators only.
➢ For achieving this, Administrator and user levels of security should be implemented —An
example of Confidentiality.
➢ Some data present in the PDA may be visible to all users but there may not be necessary
permissions to alter the data by the users.
➢ That is Read Only access is allocated to all users—An example of Integrity.
Safety
➢ Safety deals with the possible damages that can happen to the operators, public and the
environment due to the breakdown of an embedded system or due to the emission of
radioactive or hazardous materials from the embedded products.
➢ The breakdown of an embedded system may occur due to a hardware failure or a
firmware failure.
➢ Safety analysis is a must in product engineering to evaluate the anticipated damages and
determine the best course of action to bring down the consequences of the damages to an
acceptable level.
➢ Some of the safety threats are sudden (like product breakdown) and some of them are
gradual (like hazardous emissions from the product)
Non-Operational Quality Attributes
➢ The quality attributes that needs to be addressed for the product 'not’ on the basis of
operational aspects are grouped under this category.
➢ The important non-operational quality attributes are:
1. Testability & Debug-ability
2. Evolvability
3. Portability
4. Time-to-prototype and market
5. Per unit and total cost
Testability & Debug-ability
➢ Testability deals with how easily one can test his/her design, application and by which
means he/she can test it.
➢ For an embedded product, testability is applicable to both the embedded hardware and
firmware.
➢ Embedded hardware testing ensures that the peripherals and the total hardware
functions in the desired manner, whereas firmware testing ensures that the firmware is
functioning in the expected way.
➢ Debug-ability is a means of debugging the product as such for figuring out the probable
sources that create unexpected behaviour in the total system.
➢ Debug-ability has two aspects in the embedded system development context, namely,
hardware level debugging and firmware level debugging.
➢ Hardware debugging is used for figuring out the issues created by hardware problems
whereas firmware debugging is employed to figure out the probable errors that appear as a
result of flaws in the firmware.
Evolvability
➢ For an embedded system, the quality attribute 'Evolvability’ refers to the ease with which
the embedded product (including firmware and hardware) can be modified to take
advantage of new firmware or hardware technologies.
Portability
➢ Portability is a measure of 'system independence’.
➢ An embedded product is said to be portable if the product is capable of functioning 'as
such' in various environments, target processors/controllers and embedded operating
systems.
➢ A standard embedded product should always be flexible and portable.
➢ In embedded products, the term 'porting' represents the migration of the embedded
firmware written for one target processor (e.g. Intel x86) to a different target processor (say
Hitachi SH3 processor).
➢ If the firmware is written in a high level language like ‘C’, it is very easy to port the
firmware
➢ If the firmware is written in Assembly Language for a particular family of processor (say
x86 family), the portability is poor.
Time-to-Prototype and Market
➢ Time-to-market is the time elapsed between the conceptualisation of a product and the
time at which the product is ready for selling (for commercial product) or use (for non
commercial products).
➢ The commercial embedded product market is highly competitive and time-to-market the
product is a critical factor in the success of a commercial embedded product.
• Competitor might release their product before you do.
• The technology used might have superseded with a new technology.
➢ Product prototyping helps a lot in reducing time-to-market.
➢ Prototyping is an informal kind of rapid product development in which the important
features of the product under consideration are developed.
➢ The time-to-prototype is also another critical factor.
• If the prototype is developed faster, the actual estimated development time can be
brought down significantly.
• In order to shorten the time to prototype, make use of all possible options like the use of
off-the-shelf components, re-usable assets, etc.
Per Unit Cost and Revenue
➢ Cost is a factor which is closely monitored by both end user and product manufacturer.
➢ Cost is a highly sensitive factor for commercial products.
➢ Any failure to position the cost of a commercial product at a nominal rate, may lead to the
failure of the product in the market.
➢ Proper market study and cost benefit analysis should be carried out before taking a
decision on the per-unit cost of the embedded product.
➢ The budget and total system cost should be properly balanced to provide a marginal
profit.
➢ The product life cycle of every embedded product has different phases: Design and
Development Phase:
➢ The product idea generation, prototyping, Roadmap definition, actual product design and
development are the activities carried out during this phase. There is only investment and no
returns.
Product Introduction Phase:
➢ Once the product is ready to sell, it is introduced to the market. During the initial period
the sales and revenue will be low. There won't be much competition and the product sales
and revenue increases with time. Growth Phase
➢ The product grabs high market share.
Maturity Phase:
➢ The growth and sales will be steady and the revenue reaches at its peak. Product
Retirement/Decline Phase:
➢ Drop in sales volume, market share and revenue.
➢ The decline happens due to various reasons like competition from similar product with
enhanced features or technology changes, etc.
➢ At some point of the decline stage, the manufacturer announces discontinuing of the
product.
➢ The different stages of the embedded products life cycle—revenue, unit cost and profit in
each stage are represented in the following Product Life-cycle graph
➢ From the graph, it is clear that the total revenue increases from the product introduction
stage to the product maturity stage.
➢ The revenue peaks at the maturity stage and starts falling in the decline/retirement Stage.
➢ The unit cost is very high during the introductory stage. A typical example is cell phone; if
you buy a new model of cell phone during its launch time, the price will be high and you will
get the same model with a very reduced price after three or four months of its launching).
➢ The profit increases with increase in sales and attains a steady value and then falls with a
dip in sales.
➢ You can see a negative value for profit during the initial period.
➢ It is because during the product development phase there is only investment and no
returns.
5]a)Ans-
Monolithic Kernel
All kernel services run in the kernel space
All kernel modules run with in the same memory space under a single kernel thread
The tight internal integration of kernel modules in monolithic kernel architecture allows the
effective utilization of the low-level features of the underlying system
The major drawback of monolithic kernel is that any error or failure in anyone of the kernel
modules leads to the crashing of the entire kernel application
LINUX,SOLARIS,MS-DOS kernels are examples of monolithic kernel
Microkernel
The micro kernel design in corporates only the essential set of Operating System services
into the kernel
Rest of the Operating System services are implemented in programs known as ‘Servers’
which runs in user space
The kernel design is highly modular provides OS-neutral abstraction
Memory management, process management, timer systems and interrupt handlers are
examples of essential services, which forms the part of the microkernel
QNX ,Minix 3 kernels are examples for microkernel
5]b)Ans-
Tasks, Processes &Threads
In the Operating System context, a task is defined as the program in execution and the
related information maintained by the Operating system for the program
Task is also known as ‘Job ’in the operating system context
A program or part of it in execution is also called a ‘Process’
The terms ‘Task’, ‘job’ and ‘Process’ refer to the same entity in the Operating System context
and most often they are used inter changeably
A process requires various system resources like CPU for executing the process, memory for
storing the code corresponding to the process and associated variables, I/O devices for
information exchange etc.
Threads
A thread is the primitive that can execute code
A thread is a single sequential flow of control with in a process
‘Thread’ is also known as light weight process
A process can have many threads of execution
Different threads, which are part of a process, share the same address space; meaning they
share the data memory, code memory and heap memory area
Threads maintain their own thread status (CPU register values), Program Counter (PC) and
stack
5]c)Ans-Given:
Process Burst Time (ms)
P1 10
P2 5
P3 7
Arrival order: P1, P2, P3
All arrive at the same time (t = 0).
SJF is non-pre emptive, so the process with the shortest burst time goes first.
Step 1: Order of Execution (based on burst time)
P2 (5ms) → P3 (7ms) → P1 (10ms)
Step 2: Calculate Waiting Time (WT)
Process Start Time Finish Time Waiting Time = Start Time - Arrival Time
P2 0 5 0
P3 5 12 5
P1 12 22 12
Step 3: Calculate Turnaround Time (TAT)
Turnaround Time = Completion Time - Arrival Time (0 for all)
So, TAT = Completion Time
Process Completion Time Turnaround Time
P2 5 5
P3 12 12
P1 22 22
FINAL TABLE
Process Burst Time Waiting Time Turnaround Time
P2 5 0 5
P3 7 5 12
P1 10 12 22
Averages:
• Average Waiting Time (AWT) = (0 + 5 + 12) / 3 = 5.67 ms
• Average Turnaround Time (ATAT) = (5 + 12 + 22) / 3 = 13.0 ms
The Integrated Development Environment (IDE) and Electronic Design Automation (EDA)
tools are selected based on the target hardware development requirement and they are
supplied as Installable files in CDs by vendors. These tools need to be installed on the host PC
used for development activities. These tools can be either freeware or licensed copy or
evaluation versions
6]c)Ans-DEADLOCK
7]a)Ans-A programmer can think of an ARM core as functional units connected by data
buses, as shown in the following Figure.
Data enters the processor core through the Data bus. The data may be an instruction to
execute or a data item.
o Figure shows a Von Neumann implementation of the ARM—data items and instructions
share the same bus. (In contrast, Harvard implementations of the ARM use two different
buses).
The instruction decoder translates instructions before they are executed. Each instruction
executed belongs to a particular instruction set.
The ARM processor, like all RISC processors, uses load-store architecture—means it has two
instruction types for transferring data in and out of the processor:
The arrows represent the flow of data, the lines represent the buses, and the boxes
represent either an operation unit or a storage area.
* load instructions copy data from memory to registers in the core
* store instructions copy data from registers to memory
There are no data processing instructions that directly manipulate data in memory. Thus,
data processing is carried out in registers.
Data items are placed in the register file—a storage bank made up of 32-bit registers.
* Since the ARM core is a 32-bit processor, most instructions treat the registers as holding
signed or unsigned 32-bit values. The sign extend hardware converts signed 8-bit and 16-bit
numbers to 32-bit values as they are read from memory and placed in a register.
ARM instructions typically have two source registers, Rn and Rm, and a single result or
destination register, Rd. Source operands are read from the register file using the internal
buses A and B, respectively.
The ALU (arithmetic logic unit) or MAC (multiply-accumulate unit) takes the register values
Rn and Rm from the A and B buses and computes a result. Data processing instructions write
the result in Rd directly to the register file.
Load and store instructions use the ALU to generate an address to be held in the address
register and broadcast on the Address bus.
* One important feature of the ARM is that register Rm alternatively can be preprocessed in
the barrel shifter before it enters the ALU. Together the barrel shifter and ALU can calculate a
wide range of expressions and addresses.
After passing through the functional units, the result in Rd is written back to the register
file using the Result bus.
For load and store instructions the Incrementer updates the address register before the
core reads or writes the next register value from or to the next sequential memory location.
The processor continues executing instructions until an exception or interrupt changes the
normal execution flow.
The ARM processor has three registers assigned to a particular task or special function: r13,
r14,and r15. They are given with different labels to differentiate them from the other
registers.
o Register r13 is traditionally used as the stack pointer (sp) and stores the head of the stack
in the current processor mode.
o Register r14 is called the link register (lr) and is where the core puts the return address
whenever it calls a subroutine.
o Register r15 is the program counter (pc) and contains the address of the next instruction to
be fetched by the processor.
The cpsr is divided into four fields, each 8 bits wide: flags, status, extension, and control. In
current designs the extension and status fields are reserved for future use.
The control field contains the processor mode, state, and interrupt mask bits.
The flags field contains the condition flags.
Some ARM processor cores have extra bits allocated. For example, the J bit, which can be
found in the flags field, is only available on Jazelle-enabled processors, which execute 8-bit
instructions.
It is highly probable that future designs will assign extra bits for the monitoring and control of
new features.
7]c)Ans-
When an exception or interrupt occurs, the processor sets the pc to a specific memory
address. The address is within a special address range called the vector table.
*The entries in the vector table are instructions that branch to specific routines designed to
handle a particular exception or interrupt.
* The memory map address 0x00000000 (or in some processors starting at the offset
0xffff0000) is reserved for the vector table, a set of 32-bit words.
When an exception or interrupt occurs, the processor suspends normal execution and
starts loading instructions from the exception vector table (see the following Table).
Each vector table entry contains a form of branch instruction pointing to the start of a
specific routine:
*Reset vector is the location of the first instruction executed by the processor when power is
applied. This instruction branches to the initialization code.
* Undefined instruction vector is used when the processor cannot decode an instruction.
* Software interrupt vector is called when you execute a SWI instruction. The SWI instruction
is frequently used as the mechanism to invoke an operating system routine.
* Prefetch abort vector occurs when the processor attempts to fetch an instruction from an
address without the correct access permissions. The actual abort occurs in the decode stage.
* Data abort vector is similar to a prefetch abort, but is raised when an instruction attempts
to access data memory without the correct access permissions.
* Interrupt request vector is used by external hardware to interrupt the normal execution
flow of the processor. It can only be raised if IRQs are not masked in the cpsr.
* Fast interrupt request vector is similar to the interrupt request, but is reserved for
hardware requiring faster response times. It can only be raised if FIQs are not masked in the
cpsr.
8]c)Ans-Processor Modes:
The processor mode determines which registers are active and the access rights to the cpsr
register itself. Each processor mode is either privileged or non-privileged:
* A privileged mode allows full read-write access to the cpsr.
* A non-privileged mode only allows read access to the control field in the cpsr, but still
allows read-write access to the condition flags.
There are seven processor modes in total:
* six privileged modes (abort, fast interrupt request, interrupt request, supervisor, system,
and undefined)
The processor enters abort mode when there is a failed attempt to access memory.
Fast interrupt request and interrupt request modes correspond to the two interrupt levels
available on the ARM processor.
Supervisor mode is the mode that the processor is in after reset and is generally the mode
that an operating system kernel operates in.
System mode is a special version of user mode that allows full read-write
Access to the cpsr.
Undefined mode is used when the processor encounters an instruction that is undefined or
not supported by the implementation.
* one non-privileged mode (user).
User mode is used for programs and applications
➤ Description:
• Adds two operands and the carry flag (C).
• Used in multi-word arithmetic (e.g., 64-bit addition on a 32-bit processor).
➤ Syntax:
assembly
ADC Rd, Rn, Rm
• Rd = destination register
• Rn = first operand
• Rm = second operand
• Adds: Rd = Rn + Rm + Carry
Example
; Assume R1 = 0xFFFFFFFF, R2 = 0x00000001, carry flag = 1
ADC R0, R1, R2
; R0 = 0xFFFFFFFF + 0x00000001 + 1 = 0x00000001 (with overflow)
2. BIC (Bit Clear)
➤ Description:
• Performs a bitwise AND of a register with the complement of another.
• Equivalent to: Rd = Rn AND (NOT Rm)
➤ Syntax:
assembly
BIC Rd, Rn, Rm
example
; Assume R1 = 0xFFFF00FF, R2 = 0x0000FF00
BIC R0, R1, R2
; R0 = R1 & ~(R2) = 0xFFFF00FF & 0xFFFF00FF = 0xFFFF00FF
3. LSL (Logical Shift Left)
➤ Description:
• Shifts bits left by a specified number.
• Fills with zeroes from the right.
• Often used for multiplication by powers of 2.
➤ Syntax (immediate):
assembly
LSL Rd, Rm, #n
*Rd = Rm << n (shift left by n bits)
Example:
assembly
; Assume R1 = 0x00000002
LSL R0, R1, #2
; R0 = 0x00000002 << 2 = 0x00000008
4. PUSH (Push Register to Stack)
➤ Description:
• Stores register(s) on the stack, decrementing the Stack Pointer (SP).
• Used to save context before function calls or interrupts.
➤ Syntax:
assembly
PUSH {Rn, Rm, ...}
Example:
assembly
PUSH {R4, R5}
; SP = SP - 8 (on 32-bit stack), stores R4 and R5 values at SP
+----------------------------------------------------+
+------------------------+---------------------------+
| CMSIS-RTOS | CMSIS-DSP |
+------------------------+---------------------------+
+----------------------------------------------------+
| - Peripheral definitions |
+----------------------------------------------------+
+----------------------------------------------------+
CMSIS Components Explained
Component Description
CMSIS-Core Access to core registers (e.g., NVIC, SCB, SysTick)
CMSIS-DSP DSP library for Cortex-M (e.g., FFT, FIR filters)
CMSIS-RTOS Standard API for real-time operating systems
CMSIS-SVD System View Description files for peripherals (used by debuggers/tools)
CMSIS-Pack Software pack management (drivers, libraries, and examples)
CMSIS-NN Neural network kernels optimized for Cortex-M
Scope of CMSIS
• Cortex-M0/M0+/M3/M4/M7/M23/M33 support
• Used in:
o IoT devices
o Wearables
o Industrial control
o Medical electronics
o Automotive microcontrollers
ENTRY
LOOP
END
Results:
After execution,
R0 = 1 + 2 + 3 + ... + 10 = 55
10]a)Ans-(i) ADD.W — Add (Wide)
➤ Syntax:
assembly
ADD.W Rd, Rn, Rm
➤ Operation:
• Performs a 32-bit addition:
Rd = Rn + Rm
• The .W ensures the instruction is encoded as a 32-bit instruction, allowing access to
high registers (R8–R15) or specific operand formats.
➤ Example:
assembly
ADD.W R8, R1, R2
; R8 = R1 + R2 (32-bit addition)
(ii) LDMIA — Load Multiple Increment After
➤ Syntax:
assembly
LDMIA Rn!, {Rlist}
➤ Operation:
• Loads multiple registers from memory starting at address in Rn, then increments Rn
after each load.
• ! means write-back: the updated Rn is written back.
➤ Example:
assembly
LDMIA R0!, {R1, R2}
; Loads value at [R0] into R1
; Loads value at [R0+4] into R2
; R0 = R0 + 8 (write-back)
(iii) BEQ — Branch if Equal
➤ Syntax:
assembly
BEQ label
➤ Operation:
• Branches to label if Zero flag (Z) is set (i.e., last comparison was equal).
➤ Example:
assembly
CMP R1, R2
BEQ Equal_ Label
; Branches to Equal_ Label if R1 == R2
(iv) LSR — Logical Shift Right
➤ Syntax:
assembly
LSR Rd, Rm, #n
➤ Operation:
• Shifts Rm right by n bits, filling zeroes from the left:
Rd = Rm >> n
➤ Example:
assembly
; R1 = 0x10 (00010000)
LSR R0, R1, #2
; R0 = 0x04 (00000100)
(v) IF-THEN (IT) — Conditional Execution Block
➤ Syntax:
assembly
IT <condition>
<conditional instruction>
➤ Operation:
• Enables conditional execution of 1–4 instructions based on a flag (e.g., EQ, NE).
➤ Example:
assembly
CMP R1, #0
IT EQ
MOVEQ R0, #1
; If R1 == 0, R0 is set to 1
Component Description
Senses physical data (temperature, light,
1. Sensor
pressure) and sends it as electrical signals.
2. ADC (Analog to Digital Converts analog signals from sensors to
Converter) digital form for processing.
3. DAC (Digital to Analog Converts digital signals to analog form (if
Converter) required by actuators).
4. Processor The brain of the system. Processes input data
(Microcontroller/Microprocessor) and controls other parts.
Stores data, programs, and results temporarily
5. Memory (RAM/ROM/Flash)
or permanently.
Used for scheduling, delays, or counting
6. Timer/Counters
events. Crucial for real-time systems.
Interface between processor and external
7. I/O Ports
world (switches, LEDs, etc.).
Performs physical action based on output
8. Actuator
(e.g., motor, relay, display).
9. Communication Interfaces Allow data exchange between processor and
(I2C, SPI, UART, CAN) other components or devices.
Example Applications:
• Home Automation System → Sensors (motion), MCU, relay (actuator)
• Medical Device → Heart rate sensor, display, memory
• Automotive System → Speed sensor, brake actuator, CAN bus interface