aes ia2 (1)
aes ia2 (1)
1) Explain single-register load-store addressing modes i)Pre index with write back ii)Pre index
iii)Post index
Q. No. 2) Explain the following ARM instructions i)SWP ii)SWPB iii)MRS iv)MSR
Example for SWPB is
Initial Setup:
Assume:
Instruction:
BX r1
Execution Steps:
• The instruction loads values from memory into multiple registers one by one.
• After loading, the base address register (r0) is updated to point to the next memory
location.
Syntax:
LDMIA Rn!, {register_list}
• LDMIA: Load Multiple Increment After.
• Rn: Base register holding the starting memory address.
• !: Write-back, updates Rn with the new address after the instruction.
• {register_list}: List of registers to load values into, e.g., {r0-r3}.
Ex
Memory:
• Memory[0x1000] = 10
• Memory[0x1004] = 20
• Memory[0x1008] = 30
• Memory[0x100C] = 40
Instruction:
LDMIA r0!, {r1-r3}
Q. No. 4) Explain the following ARM instructions i)LDR r0,[r1] ii)STR r0,[r1] ii)LDR r0,[r1,#2] iii)STR
r0,[r1,#4]
The LDR (Load Register) instruction loads a word (32-bit value) from memory into a
register. The address is specified in the base register (r1 in this case).
Syntax:
Example:
Instruction:
LDR r0, [r1]
Execution:
1. r0 = Memory[0x1000] = 0x12345678.
• r1 = 0x1000 (unchanged)
• r0 = 0x12345678.
The STR (Store Register) instruction stores a word (32-bit value) from a register into
memory. The address is specified in the base register (r1).
Syntax:
Example:
Instruction:
STR r0, [r1]
Execution:
1. Memory[0x2000] = r0 = 0x87654321.
• r1 = 0x2000 (unchanged).
• Memory (After Execution): Memory[0x2000] = 0x87654321.
The LDR instruction here loads a word from an offset address. The offset value #2 is added
to the base address (r1) before accessing the memory.
Syntax:
Example:
Instruction:
LDR r0, [r1, #2]
Execution:
The STR instruction here stores a word from a register to memory at an offset address. The
offset value #4 is added to the base address (r1) before storing.
Syntax:
Example:
Instruction:
STR r0, [r1, #4]
Execution:
• r1 = 0x2000 (unchanged).
• Memory (After Execution): Memory[0x2004] = 0xABCDEF01
Q. No. 5) Explain the elements of an embedded system with neat block diagram
1. System Core
• The central part of the embedded system, which processes data and coordinates all
activities.
• It usually includes:
o Processor: Executes instructions and performs computations.
o Controller: Manages and controls the flow of data between other components.
2. Memory
3. Input Ports
• These allow the system to receive data or signals from external sources such as sensors,
buttons, or other devices.
• Example: A temperature sensor providing input to the system.
4. Output Ports
5. Other Devices
• Includes additional components or peripherals required for specific tasks, such as:
o Timers: For scheduling tasks.
o Communication Modules: To interact with other systems (e.g., UART, SPI, or I2C).
o Power Supply: Ensures all components receive the necessary electrical power.
Flow of Operation
In computer architecture, Endianness refers to the order in which bytes are arranged in
memory. There are two primary formats for this arrangement: Big-Endian and Little-
Endian.
1. Big-Endian Format
In the Big-Endian format, the most significant byte (MSB) of a word is stored at the lowest
memory address.
Illustration:
For the 32-bit hexadecimal number 0x12345678, the bytes will be stored as:
0x00 0x12
0x01 0x34
0x02 0x56
0x03 0x78
In this case, the most significant byte (0x12) is stored at the lowest address.
2. Little-Endian Format
In the Little-Endian format, the least significant byte (LSB) of a word is stored at the
lowest memory address.
Illustration:
For the 32-bit hexadecimal number 0x12345678, the bytes will be stored as:
0x00 0x78
0x01 0x56
0x02 0x34
0x03 0x12
In this case, the least significant byte (0x78) is stored at the lowest address.
Q. No. 8) Explain different types storage devices used in the embedded system (both ROM and RAM)
ROM is a non-volatile memory, meaning it retains its data even when the power is turned
off. It is primarily used to store the firmware (permanent software programmed into the
system) in embedded systems. There are several types of ROM used in embedded systems:
Types of ROM:
RAM is a volatile memory, meaning it loses its contents when the power is turned off. It is
used to store data and variables that are actively used by the system during operation.
Types of RAM:
Power
Low power consumption Higher power consumption
Consumption
Real-Time
Often real-time Not real-time, non-strict timing
Operation
Examples Washing machines, medical devices PCs, laptops, servers, gaming consoles