Micro
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
Data loggers: The RTC can be used to log data at regular intervals.
system hangs and crashes by resetting the system if the software
becomes unresponsive. This can be helpful in situations where the
software is running a critical application, such as a medical device or a Backup power systems: The RTC can be used to keep track of the time
control system. and date of the last power outage.
Protects against power failures. The WDT can help to protect against
power failures by resetting the system before the software is lost. This
can be helpful in situations where the system is running on battery
power or where the power supply is not reliable.
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
Limited resources: Embedded systems typically have limited resources, expression.
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
and avionics systems. CMP: This instruction compares two registers and sets the condition code flags
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
any other systems. Examples of stand-alone embedded systems BEQ: This instruction branches to a label if the condition code flags are equal.
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.
First generation: These systems were built around 4- and 8-bit Security: Embedded systems are often connected to other systems,
microprocessors/microcontrollers with firmware developed in such as the internet. This makes them vulnerable to security attacks.
Assembly code. BCC: This instruction branches to a label if the condition code flags are carry
clear.
Maintainability: Embedded systems are often designed to be used for
Second generation: These systems were built around 8- and 16-bit many years. This makes it important to design a system that is easy to
microprocessors/microcontrollers with firmware developed in high- maintain and upgrade.
Here is a example of a conditional statement in ARM assembly language:
level languages such as C and C++.
These are just some of the challenges in embedded system design. The
Third generation: These systems were built around more powerful 16- specific challenges will vary depending on the application and the MOV R0, #1
and 32-bit microprocessors supporting operating systems such as Linux environment in which the system will be used. CMP R0, #5
and Windows. BGT label_greater
Idle mode: In idle mode, the CPU is still running, but it is in a low-
STRB Rd, [Rm, #imm5] power state. This mode is typically used when the system is waiting for
an event to occur.
4) The ADR instruction in ARM assembly language is used to load
the address of a label or variable into a register. The instruction
Sleep mode: In sleep mode, the CPU is turned off, but the memory is
has the following format:
still powered on. This mode is typically used when the system is not
actively processing data.
ADR r4, x
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
System design: In this phase, the system is designed. This includes the
instruction decoding and improves performance by leveraging existing
hardware design, the software design, and the system architecture.
memory access mechanisms. It simplifies software development and
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
continues to meet the requirements. This includes bug fixes, updates, and
Serial memory interfacing: In serial memory interfacing, the address, enhancements.
data, and control signals are connected to the memory chips one at a
time. This is a more complex way to implement multichip memory
interfacing, but it requires fewer pins on the CPU and the memory The embedded system design and development life cycle model is a cyclical
chips. 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.
The importance of cache memory in embedded systems is that it can
Limited resources: Embedded systems typically have limited resources,
improve the performance of the system by reducing the number of times
such as memory, processing power, and power. This is because they are
the CPU has to access the main memory. This is because the cache
designed to be small and cost-effective.
memory can store the data and instructions that the CPU is most likely to
need next.
Real-time constraints: Many embedded systems have real-time Here are some of the benefits of using cache memory in embedded
constraints. This means that they must respond to events within a certain systems:
time period. Improved performance:
Reduced latency:
Increased throughput:
Complexity: Embedded systems can be very complex, especially as they Reduced power consumption:
become more powerful and capable. This can make it difficult to design, C) Write a code to add and subtract two numbers using ARM assembly.
test, and debug the system. Ans:here is a code to add and subtract two numbers using ARM assembly:
Cost: Embedded systems are often designed to be low-cost, which can // Add two numbers
make it difficult to use the latest and greatest technologies. mov r0, #10 // Load the first number into register r0
mov r1, #5 // Load the second number into register r1
add r2, r0, r1 // Add the two numbers and store the result in register r2
Security: Embedded systems are often connected to other systems, such as
the internet. This makes them vulnerable to security attacks. // Subtract two numbers
mov r0, #10 // Load the first number into register r0
mov r1, #5 // Load the second number into register r1
Maintainability: Embedded systems are often designed to be used for
sub r2, r0, r1 // Subtract the two numbers and store the result in register
many years. This makes it important to design a system that is easy to
r2
maintain and upgrade.
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.