You are on page 1of 83

FPGA/ASIC Memory SOFTWARE

PS

Sensors ADC CPU DAC Actuators

Human Diagnostic Auxilliary


Interface Tools Systems/
Cooling/Packing

Electromechanical Backup
and safety

External environment
System

• A system is an arrangement in which all its unit


assemble work together according to a set of rules.
It can also be defined as a way of working,
organizing or doing one or many tasks according to a
fixed plan.
• For example, a watch is a time displaying system. Its
components follow a set of rules to show time. If
one of its parts fails, the watch will stop working. So
we can say, in a system, all its subcomponents
depend on each other.
Embedded System

• Embedded systems is an encapsulation of H/W and S/W which is designed to perform


specific dedicated task. An embedded system can be thought of as a computer hardware
system having software embedded in it.
• An embedded system can be an independent system or it can be a part of a large system.
• An embedded system is a microcontroller or microprocessor based system which is
designed to perform a specific task. For example, a fire alarm is an embedded system; it
will sense only smoke.

• An embedded system has three components −


• It has hardware.
• It has application software.
• It has Real Time Operating system (RTOS) that supervises the application software and
provide mechanism to let the processor run a process as per scheduling by following a
plan to control the latencies. RTOS defines the way the system works. It sets the rules
during the execution of application program. A small scale embedded system may not
have RTOS.
Building Blocks of an ES
• Sensor − It measures the physical quantity and converts it to an
electrical signal which can be read by an observer or by any electronic
instrument like an A2D converter. A sensor stores the measured
quantity to the memory.
• A-D Converter − An analog-to-digital converter converts the analog
signal sent by the sensor into a digital signal.
• Processor & ASICs − Processors process the data to measure the output
and store it to the memory.
• D-A Converter − A digital-to-analog converter converts the digital data
fed by the processor to analog data
• Actuator − An actuator compares the output given by the D-A
Converter to the actual (expected) output stored in it and stores the
approved output.
Peripherals in Microcontrollers
SENSORS
Power Source
Raspberry Pi-4 B+
Raspberry Pi 4-B+
• Broadcom BCM2711, Quad core Cortex-A72 (ARM v8) 64-bit SoC @ 1.5GHz
• 1GB, 2GB, 4GB or 8GB LPDDR4-3200 SDRAM (depending on model)
• 2.4 GHz and 5.0 GHz IEEE 802.11ac wireless, Bluetooth 5.0, BLE
• Gigabit Ethernet
• 2 USB 3.0 ports; 2 USB 2.0 ports.
• Raspberry Pi standard 40 pin GPIO header (fully backwards compatible with previous boards)
• 2 × micro-HDMI ports (up to 4kp60 supported)
• 2-lane MIPI DSI display port
• 2-lane MIPI CSI camera port
• 4-pole stereo audio and composite video port
• H.265 (4kp60 decode), H264 (1080p60 decode, 1080p30 encode)
• Micro-SD card slot for loading operating system and data storage
• 5V DC via USB-C connector (minimum 3A*)
• 5V DC via GPIO header (minimum 3A*)
• Power over Ethernet (PoE) enabled (requires separate PoE HAT)
• Operating temperature: 0 – 50 degrees C ambient
ARDUINO UNO
Arduino Uno Specifications
• Microcontroller: ATmega328P 
• Operating Voltage: 5V 
• Input Voltage (recommended): 7-12V 
• Inout Voltage (limit): 6-20V 
• Digital I/O Pins: 14 (of which 6 provide PWM output) 
• PWM Digital I/O Pins: 6 
• Analog Input Pins: 6 
• DC Current per I/O Pin: 20 mA 
• DC current for 3.3V Pin: 50 mA 
• Flash Memory: 32 KB (ATmega328P) of which 0.5 KB used by bootloader
• SRAM: 2 KB (ATmega328P)
• EEPROM: 1 KB (ATmega328P)
• Clock Speed: 16 MHz
• LED_BUILTIN: 13
• Length: 68.6 mm 
• Width: 58.4 mm 
• Weight: 25 g 
ARM7 LPC 2148 FEATURES
• Advanced RISC Machine (ARM) is a PERFORMANCE ORIENTED processor architecture based on a 32-bit reduced instruction set (RISC)
computer.
• ARM features include:

• 32 BIT UC
• 32 BIT ALU
• 32 BIT DATABUS
• 32 BIT ADDRESS BUS
• 32 BIT INSTRUCTIONS
• Von Neumann model
• 3 stage pipelining- EACH instruction has same size
• 37 register 32 bit each
• 7 operating modes
• 7 Interrupts / Exceptions
• 7 addressing modes
• 3 data formats
• Load/store-based architecture
• Single-cycle instruction execution
• Link register
• Easy decoding and pipelining
• Power-indexed addressing modes
• Fixed 32-bit instruction set
ARM Instruction set
• ARM mostly comes with 2 instruction set
• 32 bit ARM instruction set
• 16 bit thumb instruction set
• In addition to above 2 instructions sets
ARM also implements JAZELLE instruction
set that is used in concepts that use JAVA.
Von neumann model
RISC VS CISC
RISC VS CISC
• At first, this may seem like RISC is much
less efficient way of completing the
operation. Because there are more lines
of code, more RAM is needed to store the
assembly level instructions.
• The compiler must also perform more
work to convert a high-level language
statement into code of this form.
Advantages of RISC
• However, the RISC strategy also brings some very
important advantages. Because each instruction requires
only one clock cycle to execute, the entire program will
execute in approximately the same amount of time as the
multi-cycle "MULT" command.
• These RISC "reduced instructions" require less transistors
of hardware space than the complex instructions, leaving
more room for general purpose registers.
• In RISC Architecture all instructions are same size.
• Because all of the instructions execute in a uniform
amount of time (i.e. one clock), pipelining is possible with
RISC Architecture.
Advantages of RISC
• Separating the "LOAD" and "STORE" instructions
actually reduces the amount of work that the
computer must perform.
• After a CISC-style "MULT" command is executed,
the processor automatically erases the registers.
If one of the operands needs to be used for
another computation, the processor must re-load
the data from the memory bank into a register.
• In RISC, the operand will remain in the register
until another value is loaded in its place.
PIPELINING
PIPELINING
• The four stages are Instruction fetch (IF) from memory, Instruction decode (ID) in
CPU, Instruction execution (IE) in ALU and Result writing (RW) in memory or
Register. Since there are four stages, all the instructions pass through the four stages
to complete the instruction execution.
• Instruction 1 gets completed in t4.
• At t1, while Instruction1 is in IF stage, that being the first stage for any execution,
there is no possibility of overlapping another instruction.
• Thus when Instruction1 moves on to stage 2 (ID)at t2, second instruction enters the
pipeline at IF stage.
• You may observe at t2, there are two stages busy with one each instruction.
Similarly, at t3, I1 and I2 move on to IE and ID stages respectively and I3 enters IF and
so on.
• You may observe that from t4 onwards maximum stages are utilised until the
instruction in-flow.
• After t4, executed instructions leave the pipeline one in each timing state. Refer to
the phase diagram to observe that from timing state t5, one each instruction
completes the execution and out of pipeline paving way for new instructions if any to
enter in.
The family of ARM processors is based on the RISC architecture

ARM solutions are dedicated to the needs of:


– system-on-chips architecture-built products
– system-on-modules architecture-built products.
ARM Holdings offers users the following types of processors:
– Cortex-A: built for advanced operating systems and exhibits the
highest possible performance;
– Cortex-R: caters perfectly to the needs of real-time applications and
provides its users with the fastest response times;
– Cortex-M: mainly built for microcontrollers;
– SecurCore: takes care of security applications;
– Machine Learning: for ML application purposes.
• We will highlight general information, areas of application,
and the main characteristics of representatives of the A, R, and
M types of processors.
8086
Basic Functionalities of a Microprocessor
• 1. The Bus Interface Unit (BIU):
• It provides the interface of 8086 to external memory and I/O devices via the System Bus.
• It performs various machine cycles such as memory read, I/O read, etc. to transfer data between memory
and I/O devices. 
• BIU performs the following functions are as follows: 
• It generates the 20-bit physical address for memory access.
• It fetches instructions from the memory.
• It transfers data to and from the memory and I/O.
• Maintains the 6-byte pre-fetch instruction queue(supports pipelining).

• BIU mainly contains the 4 Segment registers, the Instruction Pointer, a pre-fetch queue, and an Address
Generation Circuit. 
• Instruction Pointer (IP): 
• It is a 16-bit register. It holds offset of the next instructions in the Code Segment.
• IP is incremented after every instruction byte is fetched.
• IP gets a new value whenever a branch instruction occurs.  
• CS is multiplied by 10H to give the 20-bit physical address of the Code Segment.
• The address of the next instruction is calculated by using the formula CS x 10H + IP.
The Execution Unit (EU):

• The main components of the EU are General purpose registers,


the ALU, Special purpose registers, the Instruction Register and
Instruction Decoder, and the Flag/Status Register. 
• Fetches instructions from the Queue in BIU, decodes, and
executes arithmetic and logic operations using the ALU.
• Sends control signals for internal data transfer operations
within the microprocessor.(Control Unit)
• Sends request signals to the BIU to access the external
module.
• It operates with respect to T-states (clock cycles) and not
machine cycles.
• https://www.digikey.in/en/products/filter/
microcontrollers-microprocessor-fpga-
modules/721
Embedded Development Life Cycle
• https://slideplayer.com/slide/12714559/
• Microprocessor
• A microprocessor is a single VLSI chip having a CPU.
In addition, it may also have other units such as
coaches, floating point processing arithmetic unit,
and pipelining units that help in faster processing of
instructions.
• Earlier generation microprocessors’ fetch-and-
execute cycle was guided by a clock frequency of
order of ~1 MHz. Processors now operate at a clock
frequency of 2GHz
• A microcontroller is a single-chip VLSI unit
(also called microcomputer) which, although
having limited computational capabilities,
possesses enhanced input/output capability
and a number of on-chip functional units.
• Microcontrollers are particularly used in
embedded systems for real-time control
applications with on-chip program memory
and devices
Compilation process in an ES
Locator
• It gives information of memory of target
board.
• It uses information to assign physical address
to code.
• It produces output file that contains binary
memory image which can be loaded into
memory
The compilation process in an embedded
system
• The compilation process in an embedded system refers to the transformation of source code
written in a high-level programming language into machine code that can be executed by the
microcontroller or processor of the embedded system.
• The process typically involves the following steps:

• Preprocessing: The source code is processed by a preprocessor, which handles any macro
definitions, file inclusion, and conditional compilation directives.
• Compilation: The preprocessed code is then passed to a compiler, which converts the high-level
code into an intermediate representation called assembly code.
• Assembly: The assembly code is then converted into machine code by an assembler, which
generates an object file that contains the machine code and information needed for linking.
• Linking: The object file generated by the assembler is then passed to a linker, which combines
the object files and resolves any inter-module references to produce a final executable binary.
• Loading: The final binary is then loaded into the memory of the embedded system, ready for
execution by the microcontroller or processor.
• The specific tools used for each step of the compilation process may vary depending on the
embedded system architecture, operating system, and programming language being used.
• Here's a list of some commonly used tools for each step of the compilation process in an embedded
system:
• Preprocessing: The commonly used preprocessor tools are cpp (C Preprocessor) for C language and
cpp for C++ language.
• Compilation: The most commonly used compilers for embedded systems are GCC (GNU Compiler
Collection) and LLVM (Low Level Virtual Machine).
• GCC supports multiple programming languages including C, C++, and Assembly, while LLVM supports
multiple programming languages including C, C++, and Swift.
• Assembly: The commonly used assembler tools are NASM (Netwide Assembler) for x86 architecture
and GAS (GNU Assembler) for multiple architectures.
• Linking: The commonly used linker tools are LD (GNU Linker) and ELF (Executable and Linkable
Format).
• Loading: The commonly used tools for loading the final binary into the memory of the embedded
system are GDB (GNU Debugger) and JTAG (Joint Test Action Group) debugger.
• It's important to note that the specific tools used may vary depending on the architecture, operating
system, and programming language of the embedded system. The tools listed here are some of the
commonly used ones, but others may be used as well.
• Regenerate response
For an embedded system based on an ARM (Advanced RISC Machines) controller, the
following tools are commonly used in each step of the compilation process:

• Preprocessing: GCC preprocessor (cpp) is commonly used for preprocessing source


code written in C or C++.
• Compilation: GCC (GNU Compiler Collection) is widely used as a compiler for ARM
controllers, supporting languages such as C, C++, and Assembly.
• Assembly: The commonly used assembler tool for ARM controllers is GAS (GNU
Assembler), which generates machine code for the ARM architecture.
• Linking: LD (GNU Linker) is a commonly used linker for ARM controllers, which
combines object files and resolves any inter-module references.
• Loading: OpenOCD (Open On-Chip Debugger) is a widely used tool for loading the
final binary into the memory of the ARM controller and for debugging the executed
code.
• It's important to note that the specific tools used may vary depending on the exact
architecture of the ARM controller, the operating system, and the programming
language being used. However, the above-mentioned tools are commonly used in
ARM-based embedded systems.
• For an embedded system based on an 8051 microcontroller, the following tools are
commonly used in each step of the compilation process:
• Preprocessing: The commonly used preprocessor tool for 8051 controllers is the Keil C
preprocessor.
• Compilation: Keil C51 is a widely used compiler for 8051 controllers, supporting languages
such as C, Assembly, and C++.
• Assembly: The commonly used assembler tool for 8051 controllers is the Keil A51
Assembler, which generates machine code for the 8051 architecture.
• Linking: The Keil BL51 Linker is a commonly used linker for 8051 controllers, which
combines object files and resolves any inter-module references.
• Loading: The commonly used tools for loading the final binary into the memory of the
8051 controller are the Keil UVision Debugger and the Silicon Labs Debugger.
• It's important to note that the specific tools used may vary depending on the exact
architecture of the 8051 microcontroller, the operating system, and the programming
language being used. However, the above-mentioned tools are commonly used in 8051-
based embedded systems.

You might also like