Embedded and Real Time Systems-S7 CSE: Unit1
Embedded and Real Time Systems-S7 CSE: Unit1
Embedded and Real Time Systems-S7 CSE: Unit1
PART B
1. Explain the various features if ARM Processor in details. (13)
[Apr-2016, Nov-Dec 2017, Nov-Dec 2018]
ARM is a family of RISC Architecture. It supports Assembly language programming.
ARM instructions are written one per line, starting after the first column. Comments begin with
the semicolon and continue to the end of the line.
A label,which gives to a name to memory location, comes at the beginning of the line, starting in
the first column. Here is an example,
LDR r0,[r8] ; a comment
label ADD r4,r0,r1
Processor and Memory Architecture
ARM comes in two versions.ARM 7 and ARM 9,
ARM 7 is a von Neumann Architecture, while ARM 9 is a hardware Architecture. The ARM
architecture supports two basic types of data:
The standard ARM word is 32 bits long.
The word may be divided into four 8 bit bytes.
The ARM processor can be configured in either little-endian mode (with the lowest order byte
residing in the low-order bits of the word) or big-endian mode(the lowest order byte stored in the
highest bits of the word).
Embedded and Real Time systems-S7 CSE UNIT1
Data Operations :
Arithmetic and logical operations in C are performed in variables. Variables are
implemented in memory locations.
ARM Programming model
ARM is load and store architecture, data operands are must first be loaded into the CPU
and then stored back to main memory to save the results.
ARM has 16 general purpose registers, r0 through r15. The r15 register has the same capabilities
as the other registers, but this also used as the program counter. The program counter should not
be overwritten for use in date operations.
Embedded and Real Time systems-S7 CSE UNIT1
Current Program status Register (CPSR) - This register is set automatically during every
arithmetic, logical, or shifting operation. The top four bits of the CPSR contains the following
information about the results of that arithmetic/ logical operations:
Negative bit (N): is set when the result is negative in two’s complement arithmetic
Zero bit (Z): is bit set when every bit of the result is zero.
Carry bit (C): is set when there is a carry out of the operation.
Overflow bit (V): is set when an arithmetic operation results in an overflow.
Instruction Sets
1. Arithmetic instructions
(List out the instructions and explain one or two examples)
eg) ADD r0,r1,r2 , this instruction set register r0 to the sum of the values stored in
r1 and r2 (r0=r1+r2)
2. Logical instructions
(List out the instructions and explain one or two examples)
3. Shift/ rotate instructions
(List out the instructions and explain one or two examples)
4. Compare instructions
5. Move instructions
6. Load and store instructions
7. Flow of control instructions
Addressing modes
1. Register indirect addressing mode
The value stored in the register is used as the address to be fetched from memory , the
result of that fetch is the desired operand value.
eg) LDR r0,[r1]
(Draw the diagram and explain)
2. Base plus offset addressing
Two types (Explain)
1. Auto indexing
LDR r0, [r1, #16]
2. Post indexing
LDR r0,[r1],#5
Embedded and Real Time systems-S7 CSE UNIT1
2. Describe the different factors involved in embedded system design process. (10 /13)
[Nov-Dec 2017, Apr-May 2018]
Embedded system design process has two objectives:
It will give us an introduction to the various steps in embedded system design in more
detail
It allows us to consider the design methodology.
A Design allows us to develop computer aided design tools.
Two major ways: 1.Top down design
2. Bottom up design
Major levels of abstraction in the design process.
Requirements
DCC
The Digital Command Control (DCC) was created by the National Model Railroad
Association to support interoperable digitally-controlled model trains.
Some packet types are left undefined in the standard but typical uses are given in
Recommended Practices documents. We can write the basic packet format as a regular
expression:
PSA (sD) + E
A baseline packet has three data bytes: an address data byte that gives the intended
receiver of the packet; the instruction data byte provides a basic instruction; and an error
correction data byte is used to detect and correct transmission errors.
The instruction data byte carries several pieces of information. Bits 0–3 provide a 4-bit
speed value. Bit 4 has an additional speed bit, which is interpreted as the least significant speed
bit. Bit 5 gives direction, with 1 for forward and 0 for reverse. Bits 7–8 are set at 01 to indicate
that this instruction provides speed and direction.
The error correction data byte is the bitwise exclusive OR of the address and instruction data
bytes.
Conceptual Specification
A conceptual specification allows us to understand the system a little better.
A train control system turns commands into packets. A command comes from the command unit
while a packet is transmitted over the rails.
Commands and packets may not be generated in a 1-to-1 ratio. In fact, the DCC standard
says that command units should resend packets in case a packet is dropped during transmission.
The basic relationship between them is illustrated in Figure This figure shows a
UML collaboration diagram; we could have used another type of figure, such as a class or
object diagram, but we wanted to emphasize the transmit/receive relationship between these
major subsystems. The command unit and receiver are each represented by objects; the
command unit sends a sequence of packets to the train’s receiver, as illustrated by the arrow.
The notation on the arrow provides both the type of message sent and its sequence in a
flow of messages; since the console sends all the messages, we have numbered the arrow’s
messages as 1..n. Those messages are of course carried over the track.
Embedded and Real Time systems-S7 CSE UNIT1
The console needs to perform three functions: read the state of the front panel on the
command unit, format messages, and transmit messages.
The train receiver must also perform three major functions: receive the message, interpret
the message (taking into account the current speed, inertia setting, etc.), and actually control the
motor. These classes must define some behaviors, but for the moment we will concentrate on the
basic characteristics of these classes:
Embedded and Real Time systems-S7 CSE UNIT1
The Console class describes the command unit’s front panel, which contains the analog
knobs and hardware to interface to the digital parts of the system.
The Formatter class includes behaviors that know how to read the panel knobs and
creates a bit stream for the required message.
The Transmitter class interfaces to analog electronics to send the message along the
track.
Knobs* describes the actual analog knobs, buttons, and levers on the control panel.
Sender* describes the analog electronics that send bits along the track.
Likewise, the Train makes use of three other classes that define its components:
The Receiver class knows how to turn the analog signals on the track into digital form.
The Controller class includes behaviors that interpret the commands and figures out how to
control the motor.
[Nov-Dec 2016]
Cache memory use: Used to improve the performance of memory system
To reduce the average memory access time
Cache controllers:
Diagram
Cache hit, cache miss,
Type of cache miss: compulsory miss, capacity miss, conflict miss.
Memory system performance:
formula: tav=htcache+(1-h)tmain
First and second level cache
Diagram
tav=h1tL1+(h2-h1)tL2+(1-h2)tmain
Cache organization:
Embedded and Real Time systems-S7 CSE UNIT1