Advanced MC
Advanced MC
1. Register File:
o Contains 16 general-purpose registers (R0-R15).
o R13 is used as the Stack Pointer (SP).
o R14 is the Link Register (LR) for storing return addresses.
o R15 is the Program Counter (PC).
2. ALU (Arithmetic Logic Unit):
o Performs arithmetic and logical operations.
o Supports operations like addition, subtraction, AND, OR, etc.
3. Barrel Shifter:
o Allows efficient bit manipulation and shifting operations.
o Works in tandem with the ALU to perform complex operations in a single
instruction.
4. Instruction Decoder:
o Decodes instructions fetched from memory.
o Determines the type of operation to be executed (e.g., data processing,
branching).
5. Control Unit:
o Coordinates all internal operations of the processor.
o Generates control signals for data flow, instruction execution, and memory
access.
6. Pipeline:
o The ARM7 processor uses a 3-stage pipeline:
1. Fetch: Fetches instructions from memory.
2. Decode: Decodes the fetched instruction.
3. Execute: Executes the instruction.
o Enhances performance by allowing multiple instructions to be processed
simultaneously.
7. Bus Interface Unit (BIU):
o Interfaces the processor with memory and I/O.
o Manages instruction and data buses.
8. Memory:
o Divided into instruction memory and data memory.
o Supports Harvard architecture for faster execution (separate buses for
instructions and data).
9. Interrupt Controller:
o Manages external and internal interrupts.
o Supports fast interrupt requests (FIQ) and normal interrupt requests (IRQ).
10. Coprocessor Interface:
o Provides an interface for additional coprocessors.
o Enhances the processor's capabilities (e.g., floating-point operations).
Q2. Discuss the key features of the ARM instruction set architecture (ISA).
The ARM Instruction Set Architecture (ISA) has many key features, including:
Fixed-length instructions: All instructions are 32 bits long.
Load/store architecture: Load and store instructions access memory, with load reading data
and store writing data.
Single-cycle execution: Most instructions execute in a single cycle.
Conditional execution: Every instruction can be conditionally executed.
Shift and ALU operations: Shift and ALU operations are performed in a single instruction.
Instruction set extension: Instruction set extension is possible through coprocessors.
Thumb instruction set: A dense 16-bit compressed instruction set.
Jazelle instruction set: An 8-bit instruction set used for hardware implementation of Java
Byte code.
Armv8-A instruction sets: Armv8-A supports three instruction sets: A32, T32, and A64.
Q3. Compare the RISC and CISC architectures with suitable block diagram.
RISC CISC
1) 2)
10) It has fixed format instruction. 10) It has variable format instruction.
11) The program written for RISC 11) Program written for CISC architecture
architecture needs to take more space in tends to take less space in memory.
memory.
12) Example of RISC: ARM, PA-RISC, 12) Examples of CISC: VAX, Motorola 68000
Power Architecture, Alpha, AVR, ARC and family, System/360, AMD and the Intel x86
the SPARC. CPUs.
Q4. Explain in detail the embedded system software and hardware used.
1. Power Supply We are aware that to operate any system, electricity is necessary. There are
three ways to supply power to a system:
The system will either have its power supply or, if it is a component of a larger
system, it will draw power from that system.
Donate to a system that the embedded system interfaces with, like a network card.
In some instances, the charge pump principle is used in an embedded device that uses
little power and accepts ATM cards. As soon as we put the ATM card in, the machine
will start to receive electricity, which is why we termed the charge pump. This charge
pump will thus supply the required power.
2. Processor Any embedded system's core component is the CPU. It determines how well the
system works. There are three different processor types: 8-bit, 16-bit, and 32-bit CPUs. For
embedded systems, smaller applications require fewer bits. Large applications call for
embedded systems with larger bit processors. The embedded system's brain is its processor.
The following categories of processors are possible:
3. Timers Counter/ Timer Some applications need a delay, such as LED display apps,
which need one so that the LED can keep blinking. In embedded systems, timers are
employed for this reason. Mechanisms are often required in embedded systems to count the
occurrence of things and carry out actions at regular intervals. Time boundaries apply to
embedded systems when counting the number of events or the interval between them. The
method for executing the tasks on a regular schedule is needed by the embedded system.
Tasks must be finished within a certain time frame. The timer is used to create waveforms
with specific delays and to create delays in general. As a result, these are the timers' primary
tasks or actions.
4. Memory The microcontroller itself contains two different types of memory. RAM and
ROM are these. ROM is a code memory, whereas RAM is a volatile memory. In embedded
systems, there are several types of system memory, including:-
Internal memory at the microcontroller
RAM at the system on a chip or external RAM
Internal caches at the microprocessor
External RAM chips
ROM / PROM
Flash / EEPROM
5. The Communication Port You can communicate with other embedded systems via this
interface. In embedded systems, various communication interfaces are available, including
UART, USB, Ethernet, RS-485, and many more. A serial port is an interface for serial
communication in which data is transferred one bit at a time. The serial protocols UART,
SPI, SCI, and I2C are often used. Below are various communication ports in embedded
systems:-
UART
CAN
RS-232
RS-423
RS-485
SPI
I2C
USB
Ethernet
6. Parallel Port Peripheral connections are made via a parallel port. The term alludes to the
method of data transmission, where parallel ports send several bits of data simultaneously. In
comparison to modern serial ports, parallel ports have more data lines and require longer
cables and port connectors.
7. Output And Input Input is necessary to communicate with the embedded system. An
input source for the system could be a sensor. The system's microcontroller has an input port
and an output port that may be set up. You can use the fixed number of input and output ports
on the microcontroller under your needs. We require input to engage with embedded devices.
The input could come from the user or a sensor. Occasionally, some systems require more
input or output. I/O will be used to determine the processor. The ports P0, P1, P2, and P3 in
8051 microcontrollers are typical divisions of this input and output. And the microcontrollers
in the ATmega series PA, PB, PC, and PD. The given register must be used to set up the I/O
for input or output. We must consult the manufacturer's datasheet to do it. An Embedded
Systems Course is the best place to learn about these hardware and software components.
Hardware and software modules come together to form an embedded system. The hardware-
embedded system components have been outlined above. Embedded system software
components are the focus of this section. Software for computers and embedded systems
serves quite distinct functions. Computer software can be placed on various devices to
accomplish the desired goals. However, embedded system software is created for a given
device to accomplish a given goal.
1. Editor The first tool you need for embedded system software is an editor. The text file you
create in the editor will contain the code you write in the C and C++ programming languages.
Geany is a nice illustration of a text editor. Many languages, including Java, C, HTML,
Python, PHP, Pascal, and Pearl, are supported by this editor.
2. Emulator An emulator is a piece of software that enables you to use the features of the
host system. All the parts are controllable through the emulator tool. The emulator is also
used to debug applications and find bugs. The emulator was also used to transmit code from
the host system to the target machine. The primary function of the emulator is to simulate a
genuine system's behavior in the embedded system. You may simulate how the code will
operate in real time by using an emulator. It is employed to simulate software performance
and aids in obtaining the written code's optimal performance. One operating system can be
run on another device using an emulator. For instance, you might run the Mac operating
system on your Windows operating system using an emulator.
3. Assembler A machine language is created from written code by the assembler tool. It is
briefly distinct from a compiler. The assembler transforms source code first into object code
and then into the language that the machine can understand, whereas the compiler transforms
written code into machine language. The assembler works when the programming language
used to create the application is assembly language. After that, the assembly language
program is converted to HEX code so it may be processed further. After the code is written,
the programmer is used to write the program into the chip.
4. Compiler A text editor writes the code but how does a computer comprehend this code?
This written code is converted into machine language by a compiler so that the machine can
understand it. The creation of an executable application is the major goal of this tool. The
written programs that translate source code from a high-level programming language into a
low-level programming language are referred to as "compilers." A compiler is a piece of
software that transforms a programming language into a language the target machine can
comprehend and use to execute the functions. The main job of the compiler is to convert
high-level code to a low-level language. Low-level languages include those used in machine
code, object code, and assembly language. An embedded system's cost and intricate design
are correlated with the increased number of components in the system.
5. Linker Software is written in discrete modules and components called "linkers." A linker,
often known as a link editor, is a program that merges one or more object files into a single
executable code.
6. Debugger A debugger is a tool used for testing and debugging. It examines the code, finds
where errors and problems are present, removes them, and notes their locations. Programmers
can confront and correct mistakes rapidly.
Q5. What is pipelining in a processor? Explain in brief about various stages of
pipelining in ARM processors.
3 stage pipelining
3-Stage Pipelining
Pipelining is a form of instruction counterpart or execution in stages and a 3-stage
pipeline is a basic version of the same. It splits the instruction cycle into three
stages:
It splits the instruction cycle into three stages:
Fetch: It is to note that the instruction is retrieved from the memory.
Decode: This instruction is fetched and then the instruction is decoded where
it is understood on which operation is required to be performed.
Execute: The instruction, in turn, gets decoded and the resultant calculated
value is stored.
5 stage pipelining
5 Stage Pipelining
A 5- stage pipeline is an enhanced form of pipelining used in today’s CPU or
computer processors. It breaks the instruction cycle into five stages:
It breaks the instruction cycle into five stages:
Fetch: Thus the instruction is fetched from memory.
Decode: Information is fetched using cache control instructions; the fetched
instruction is in turn decoded.
Execute: As instructed the operation described in the instruction is performed.
Memory Access: Read any registers needed by the instruction.
Write-back: To the register the result of the operation is then written back.
6 stage pipelining
The stages of pipelining may increase or decrease on the basis of the instruction
sets processed per cycle (In maximum situations, stages tend to increase to
increase efficiency).
Q6. Explain in detail the various registers used in an ARM device.
1) Basically there are two types of registers – General purpose registers and Special purpose
registers.
3) Figure depicts the active registers that are available in user mode, which is a protected
state that is often utilized for running programmes.
5) Up to 18 active registers are available: 16 data registers and 2 processor status registers.
7) The ARM processor contains three registers: r13, r14, and r15, each of which is allocated
to a specific duty or unique function.
8) Register 13 is traditionally used as the stack pointer (SP) and stores the head of the stack in
the current processor mode.
9) Register r14 is called the link register (LR) and is where the core puts the return address
whenever it calls a subroutine.
10) Register 15 is the program counter (PC) and contains the address of the next instruction
to be fetched by the processor.
11) Current processor status register (CPSR) contains the current status of the processor.
•This includes various conditional code flags, Interrupt Status Processor mode and other
status and control information.
•The exception modes also have a saved processor status register (SPSR), that is used to
preserve the value of CPSR when the associated exception occurs.
•Because the User and System modes are not exception modes, there is no SPSR available.
In the exception modes there is an additional Saved Processor Status register (SPSR) which
holds information on the processor’s state before the system changed into this mode i.e. the
processor status just before an exception.