Embed Micro
Embed Micro
embedded systems. (c) What are differences between general purpose processors and embedded
embedded systems. systems?
Ans:A watchdog timer (WDT) is a hardware timer that is used to Ans:
monitor the software of an embedded system. It is a safety mechanism Ans:A real-time clock (RTC) is a device that measures the passage of
that can be used to reset the system if the software becomes time. It is used in embedded systems to keep track of the precise time
unresponsive or enters an infinite loop. and date, even when the device is not connected to the network or the
main power is off. This is important for many applications, such as:
Prevents system hangs and crashes. The WDT can help to prevent Backup power systems: The RTC can be used to keep track of the time
system hangs and crashes by resetting the system if the software and date of the last power outage.
becomes unresponsive. This can be helpful in situations where the
software is running a critical application, such as a medical device or a The RTC is an important component in many embedded systems. It
control system. provides a reliable way to keep track of time, even when the device is
not connected to the network or the main power is off.
Q3) (b) What are the challenges in embedded system design? 4. (a) What are the conditional instructions in ARM? Take an example of
(a) Explain the classification of embedded systems with appropriate Ans:Here are some of the challenges in embedded system design in conditional
examples. 150 words: statement and implement the same in ARM assembly language. [6]
Ans: Ans: Conditional instructions in ARM are used to execute instructions based on
the value of a condition. The condition can be a simple comparison, such as "is
register R0 greater than register R1?", or it can be a more complex expression.
Limited resources: Embedded systems typically have limited resources,
By performance and functional requirements: This classification such as memory, processing power, and power. This can make it
divides embedded systems into four categories: difficult to design a system that meets all of the requirements. Some of the most common conditional instructions in ARM include:
Real-time embedded systems: These systems are designed to respond Real-time constraints: Many embedded systems have real-time
to events within a specific time period. Examples of real-time constraints, which means that they must respond to events within a
embedded systems include industrial control systems, medical devices, certain time period. This can be challenging to design a system that CMP: This instruction compares two registers and sets the condition code flags
and avionics systems. meets all of the requirements and still meets the real-time constraints. accordingly.
Stand-alone embedded systems: These systems are not connected to
Complexity: Embedded systems can be very complex, especially as BEQ: This instruction branches to a label if the condition code flags are equal.
any other systems. Examples of stand-alone embedded systems they become more powerful and capable. This can make it difficult to
include digital cameras, microwave ovens, and calculators. design, test, and debug the system. BNE: This instruction branches to a label if the condition code flags are not
By generation: This classification divides embedded systems into four equal.
Cost: Embedded systems are often designed to be low-cost, which can
generations: make it difficult to use the latest and greatest technologies. BCS: This instruction branches to a label if the condition code flags are carry
set.
Security: Embedded systems are often connected to other systems,
First generation: These systems were built around 4- and 8-bit such as the internet. This makes them vulnerable to security attacks. BCC: This instruction branches to a label if the condition code flags are carry
clear.
microprocessors/microcontrollers with firmware developed in Maintainability: Embedded systems are often designed to be used for
Assembly code. many years. This makes it important to design a system that is easy to
Second generation: These systems were built around 8- and 16-bit maintain and upgrade.
Here is a example of a conditional statement in ARM assembly language:
microprocessors/microcontrollers with firmware developed in high- These are just some of the challenges in embedded system design. The
level languages such as C and C++. specific challenges will vary depending on the application and the
Third generation: These systems were built around more powerful 16- environment in which the system will be used. MOV R0, #1
CMP R0, #5
and 32-bit microprocessors supporting operating systems such as Linux
BGT label_greater
and Windows.
Fourth generation: These systems are built around (System on Chip)
SoCs, reconfigurable processors and multicore processors facilitated This code moves the value 1 into register R0. It then compares the value of
high performance, tight integration and miniaturization of embedded register R0 to the value 5. If R0 is greater than 5, the program will branch to
systems. the label label_greater. Otherwise, the program will continue executing the
next instruction.
By size and complexity: This classification divides embedded systems
into three categories:
(b) Explain the following instructions of ARM. [2x4=8] Q6) (a) Explain the following terms [3x4=12] (b) Write any four applications of embedded systems.
i) LSR
ii) MLA i) Bus multiplexing in CPU Ans: here are four applications of embedded systems in 50 words each:
iii) STRB ii) Pipeline in Embedded System.
iv) ADR r4, x
iii) Power saving modes in embedded system.
Home appliances: Embedded systems are used in many home appliances, such
iv) Optimization of program execution time.
Ans: 1) The LSR instruction (Logical Shift Right) in ARM is used to shift as refrigerators, washing machines, and microwave ovens. They control the
ANS: 1) Bus multiplexing in CPU is a technique that allows the same
the bits in a register to the right by a specified number of places. The operation of these appliances and make them more efficient and user-friendly.
set of pins to be used for multiple purposes by transmitting different
number of places to shift is specified in the instruction. The LSR
signals at different times. This can be used to reduce the number of Automotive systems: Embedded systems are used in many automotive
instruction does not affect the sign bit of the register.
pins on a CPU, which can make it smaller and less expensive to systems, such as engine control, braking, and airbags. They ensure the safety
manufacture. and performance of vehicles.
The general format of the LSR instruction is:
Medical devices: Embedded systems are used in many medical devices, such
LSR Rd, Rm, #imm as pacemakers, insulin pumps, and defibrillators. They monitor and control the
patient's health and provide life-saving interventions.
Bus multiplexing is a common technique used in CPUs to reduce the
Industrial control systems: Embedded systems are used in many industrial
number of pins and to increase the number of signals that can be
2)MLA instructions in ARM multiply the values in the registers Rn and transmitted by the bus. It is a useful technique for reducing the cost control systems, such as power plants, factories, and oil rigs. They control the
Rm, adds the value in register Rn, and places the result in Rn. The MLA and complexity of CPUs. operation of these systems and ensure their safety and efficiency.
instruction is typically used to perform multiplication and
accumulation operations.
2)Pipeline in an embedded system is a technique that allows multiple
instructions to be processed simultaneously. This is done by dividing
the MLA instruction in ARM is: the instruction execution into multiple stages, and then allowing each
stage to work on a different instruction.
Deep sleep mode: In deep sleep mode, the CPU is turned off and the
memory is also turned off. This mode is typically used when the system
needs to be in a very low-power state.
7. (a) How do we interface memory chip with CPU? Also explain the b )Differentiate between I/O instructions and memory mapped
multichip memory interfacing. [7] instructions. Why do most CPU architectures use memory-mapped
Ans:The memory chip is interfaced with the CPU using a memory bus. I/O? Explain 8.(a) Draw and Explain the embedded system design and development life
The memory bus is a set of wires that carry the address, data, and Ans:Here are the key differences between I/O instructions and cycle model. [7]
control signals between the CPU and the memory chip. memory-mapped instructions:
I/O instructions: I/O instructions are special instructions that are used
to interact with I/O devices. These instructions typically have a Ans: The embedded system design and development life cycle model is a
The address signal is used to select the memory location that the CPU different format than memory instructions and they are typically process that is used to develop embedded systems. The model consists of the
wants to access. The data signal is used to transfer data between the executed by the CPU in a different way. following phases:
CPU and the memory chip. The control signal is used to control the Memory-mapped I/O: Memory-mapped I/O is a technique where I/O
read/write operation. devices are mapped to memory addresses. This means that the CPU
can access I/O devices using the same instructions that it uses to
Requirements gathering: In this phase, the requirements for the system are
access memory.
gathered from the stakeholders. This includes the functional requirements,
There are two main types of memory buses: synchronous and Most CPU architectures utilize memory-mapped I/O due to its
the non-functional requirements, and the constraints.
asynchronous. Synchronous memory buses use a clock signal to simplicity and efficiency. It treats I/O devices as memory locations,
synchronize the transfer of data between the CPU and the memory allowing the same instructions and data handling techniques to be
chip. Asynchronous memory buses do not use a clock signal. used for both memory and I/O operations. This reduces complexity in
instruction decoding and improves performance by leveraging existing System design: In this phase, the system is designed. This includes the
memory access mechanisms. It simplifies software development and hardware design, the software design, and the system architecture.
enables seamless interaction between the CPU and peripherals, while
Multichip memory interfacing is the technique of connecting multiple
also minimizing the need for specialized I/O instructions.
memory chips to the CPU. This is done to increase the amount of Implementation: In this phase, the system is implemented. This includes the
memory that is available to the CPU. hardware implementation, the software implementation, and the testing.
There are two main ways to implement multichip memory interfacing: Testing: In this phase, the system is tested to ensure that it meets the
requirements. This includes unit testing, integration testing, and system
testing.
Parallel memory interfacing: In parallel memory interfacing, the
address, data, and control signals are connected to all of the memory
Deployment: In this phase, the system is deployed to the target environment.
chips in parallel. This is the simplest way to implement multichip
memory interfacing, but it requires more pins on the CPU and the
memory chips.
Maintenance: In this phase, the system is maintained to ensure that it
Serial memory interfacing: In serial memory interfacing, the address, continues to meet the requirements. This includes bug fixes, updates, and
data, and control signals are connected to the memory chips one at a enhancements.
time. This is a more complex way to implement multichip memory
interfacing, but it requires fewer pins on the CPU and the memory
chips. The embedded system design and development life cycle model is a cyclical
process. The system may go through multiple cycles of development and
deployment as new requirements are identified and as the system evolves.
(b)What is an embedded system? Write down the salient features of 9. (a) Differentiate the RISC and CISC architectures
embedded systems. Ans:RISC (Reduced Instruction Set Computing) architectures have a small
number of simple instructions, while CISC (Complex Instruction Set
Ans:An embedded system is a computer system that is designed to Computing) architectures have a large number of complex instruction.
perform a specific task. Embedded systems are typically used in devices (B) Explain the role of interrupt in embedded systems.
that are not general-purpose computers, such as appliances, vehicles, and An interrupt is a signal that is sent to the processor to indicate that an
industrial control systems. event has occurred. Interrupts are used in embedded systems to handle
events that need to be handled quickly, such as a button press or an
external sensor reading.
The salient features of embedded systems are: The role of an interrupt in an embedded system is to allow the processor
to respond to events without having to poll for them continuously. This
can improve the performance of the system by allowing the processor to
focus on other tasks.
Specific task: Embedded systems are designed to perform a specific task. © Importance of Cache memory in embedded systems.
They are not general-purpose computers and cannot be used for other Ans: Cache memory is a small, fast memory that is used to store
tasks. frequently accessed data and instructions. It is located between the CPU
and the main memory.
Limited resources: Embedded systems typically have limited resources, The importance of cache memory in embedded systems is that it can
such as memory, processing power, and power. This is because they are improve the performance of the system by reducing the number of times
designed to be small and cost-effective. the CPU has to access the main memory. This is because the cache
memory can store the data and instructions that the CPU is most likely to
Real-time constraints: Many embedded systems have real-time constraints. need next.
This means that they must respond to events within a certain time period. Here are some of the benefits of using cache memory in embedded
systems:
Complexity: Embedded systems can be very complex, especially as they
Improved performance:
become more powerful and capable. This can make it difficult to design, Reduced latency:
test, and debug the system. Increased throughput:
Cost: Embedded systems are often designed to be low-cost, which can Reduced power consumption:
C) Write a code to add and subtract two numbers using ARM assembly.
make it difficult to use the latest and greatest technologies.
Ans:here is a code to add and subtract two numbers using ARM assembly:
Security: Embedded systems are often connected to other systems, such as
the internet. This makes them vulnerable to security attacks.
// Add two numbers
Maintainability: Embedded systems are often designed to be used for mov r0, #10 // Load the first number into register r0
many years. This makes it important to design a system that is easy to mov r1, #5 // Load the second number into register r1
maintain and upgrade. add r2, r0, r1 // Add the two numbers and store the result in register r2
(d) b).
Q(5)(a) Explain the all steps of compilation techniques with (b) Discuss the debugging techniques in short. (c) Discuss the different types of code optimization used while assembly code
appropriate examples. compilation.
Semantic analysis: This step checks the semantics of the source code. It Constant folding: This technique replaces expressions that evaluate to
ensures that the source code makes sense and that it does not contain constants with the actual constant value.
any errors. For example, the semantic analyzer would ensure that the
variable "x" is declared before it is used.
Strength reduction: This technique replaces expensive operations with
cheaper ones. For example, an multiplication can be replaced with a shift if
Code generation: This step generates the machine code for the target the operands are powers of two.
architecture. The machine code is the low-level instructions that the
CPU can understand. For example, the code generator would generate
the instruction "ADD R0, R1, R2" to add the contents of registers R1 Code hoisting: This technique moves code that is executed frequently to a
and R2 and store the result in register R0. higher location in the code. This can improve performance by reducing the
number of times the code is executed.
Loop unrolling: This technique divides a loop into multiple smaller loops. This
can improve performance by reducing the number of times the loop condition
is evaluated.