You are on page 1of 5

INSTRUCTION SET ARCHITECTURE (ISA) - is a instructions together into a single long

collection of machine-level instructions that a instruction word. VLIW architectures shift the
microprocessor or microcontroller can execute It burden of instruction scheduling from the
defines the set of operations that the processor hardware to the compiler. It allows for potential
can perform, the format of the instructions, and performance gains but requires sophisticated
how the instructions are encoded and executed by compiler support.
the hardware.
DIFFERENCES BETWEEN MPU AND MCU ISA
Three main ways instruction set command
used: MCU ISA:
1. Data handling and memory • Designed for embedded systems.
management. Instruction set commands • Simple and specialized instructions.
are used when setting a register to a • Emphasizes code size efficiency, low
specific value, copying data from memory power consumption, and real-time control.
to a register or vice versa, and reading and MPU ISA:
writing data. • More general-purpose processors.
• Complex and versatile instructions.
• Emphasizes computational power,
2. Arithmetic and logic operations and flexibility, and support for high-level
activities. These commands include add, programming languages.
subtract, multiply, divide and compare,
which examines values in two registers to
see if one is greater or less than the other.

3. Control flow activities. One example


is branch, which instructs the system to go
to another location and execute commands
4. there. Another is jump, which moves to a
specific memory location or address.

Instruction Set Architecture - It refers to the


entire infrastructure and specifications surrounding
the instruction set of a processor. It encompasses
not only the instructions themselves but also the
design principles, registers, memory organization,
addressing modes, data types, and other
architectural features of the processor.

CATEGORIES OF ISA (RISC, CISC, ETC.)

• Complex Instruction Set Computer (CISC):


CISC architectures have a rich set of complex
instructions that can perform a variety of
operations. CISC architectures aim to reduce
the number of instructions required to perform
complex tasks
• Reduced Instruction Set Computer (RISC):
RISC architectures have a simplified and
streamlined instruction set with a focus on
executing instructions quickly. RISC
architectures typically have fixed-length
instructions and a smaller set of basic
instructions
• Very Long Instruction Word (VLIW):
VLIW architectures attempt to extract
parallelism from a program by grouping multiple
Microprocessor/Microcontroller Programming OUT: Allows you to send data from a register or
memory location to a hardware device.
Microcontroller programming - involves writing
code to control and interact with microcontrollers,
which are integrated circuits designed to perform
Arithmetic and Logic Instructions:
specific tasks in embedded systems.
ADD: Add two numbers.
Microprocessor programming - involves writing
code to control and execute tasks on a SUB: Subtract one number from another.
microprocessor, which is a central processing unit
(CPU) that performs computations in a digital MUL: Multiply two numbers.
system. DIV: Divide one number by another.
Programming embedded systems - in AND: Perform bitwise AND operation.
microprocessors and microcontrollers involves
writing software instructions to control the behavior OR: Perform bitwise OR operation.
of these devices and perform specific tasks.
XOR: Perform bitwise XOR operation.
• Microprocessors are versatile CPUs that
NOT: Perform bitwise NOT operation.
require external components and use high-
level languages.
• Microcontrollers, on the other hand, combine
Control Flow Instructions:
a microprocessor core with peripherals on a
single chip and are programmed at a lower JMP: Unconditionally jump to a specified location.
level, directly interacting with peripherals and
registers for precise control and efficient CALL: Call a subroutine.
resource usage. RET: Return from a subroutine.
Types of Microprocessors & Microcontrollers
Programming:
Conditional Branch Instructions:
1. Low-Level Programming: involves writing
code that interacts directly with the hardware and CMP: Compare two values.
specific features of the microprocessor or
IN: Input data from an I/O port.
microcontroller. It typically involves using
assembly language or programming directly in the OUT: Output data to an I/O port
device's machine code. In low-level programming,
developers have fine-grained control over the
hardware resources, such as registers, memory, 2. High-Level Programming: High-level
and I/O interfaces. programming involves using programming
SYNTAX OF LOW-LEVEL LANGUAGE languages like C, C++, Python, or Java to write
software for microprocessors and microcontrollers.
Data Movement Instructions:
SYNTAX OF HIGH-LEVEL LANGUAGE
MOV: Move data from one location to another.
VARIABLES:
LOAD: Load data from memory into a register.
Syntax: data_type variable_name = value;
STORE: Store data from a register into memory.
Variables are used to store and manipulate data.
PUSH: Push data onto the stack. They have a data type (such as int, float, or string)
and are assigned a value. The syntax declares a
POP: Pop data from the stack.
variable with a specific data type, assigns it an
XCH: Swaps the values of two variables or initial value, and optionally specifies the variable
memory locations. (registers to memory) name.

IN: Represents the register or memory location CONDITIONAL STATEMENTS:


where the input data will be stored OUT: Allows you
Syntax (if statement): Conditional statements
to send data from a register or memory location to
allow you to execute certain code blocks based on
a hardware device
specific conditions. The syntax checks a condition
and executes the code inside the curly braces if the
condition evaluates to true.
LOOPS:
Syntax (for loop): Loops are used to repeat a
block of code multiple times. The for loop is a
common type of loop that specifies the initialization,
condition, and increment/decrement operations.
The code inside the loop is executed repeatedly as
long as the condition is true.
FUNCTIONS:
Syntax (functions): Functions are reusable
blocks of code that perform specific tasks. They
can accept parameters as inputs and optionally
return a value. The syntax defines a function with
a return type, function name, and parameters
enclosed in parentheses. The code inside the
function is executed when the function is called.
ARRAYS:
Syntax (arrays): Arrays are used to store multiple
values of the same data type. They have a fixed
size and can be accessed using an index. The
syntax declares an array with a specific data type
and size.
COMMENTS:
Syntax (comments): Comments are used to
provide explanatory notes within the code. Single-
line comments start with //, while multi-line
comments are enclosed between /* and */.
Comments are ignored by the compiler and do not
affect the program's execution.
Microcontroller programming applications:
• Robotics
• Internet of Things (IoT)
• Prototyping and Development
• Automation and Control Systems
Microprocessor Programming Applications:
• Operating Systems
• Application Software
• Internet of Things (IoT)
• Digital Signal Processing (DSP)
• Security Systems
• Automotive Systems
Input Output (I/O) Interfacing
Input - input can be a device or system that sends Application of I/O Interface
out data into a certain property.
I/O Interface:
Output - receives a certain data that was sent out
from the input. Various applications of I/O Interface: Application of
I/O is that we can say the interface has access to
Process - Determines what the device does to the open any file without any kind of information about
input. file, even basic information of file is unknown
Interface - a device or a system that unrelated
entities use to interact with other external
Character-stream or Block:
properties or components.
A character stream or block both transfers data in
Input and Output interfacing - a method which
the form of bytes. The difference between both of
helps in transferring information between the
them is that character-stream transfers bytes in a
internal storage or peripheral devices and the
external peripheral devices. linear way, one after another whereas block
transfers whole bytes in a single unit.
Sequential or Random Access:
Structure of I/O Interface
The user instructs the device to seek to any of data
storage locations, a random-access device that is
used to transfer data in fixed order determined by
device.
Synchronous or Asynchronous:
Data transfers with predictable response times are
performed by a synchronous device, in
coordination with other aspects of the system. An
irregular or unpredictable response time not
coordinated with other computer events is
exhibited by an asynchronous device.
1. Data Bus Buffer - use bi-directional data bus to
communicate with CPU. All control word data and Sharable or Dedicated:
status information between interface unit and CPU Several processes or threads can be used
are transferred through data bus. concurrently by a sharable device; whereas a
2. Read/Write Control Logic - This block dedicated device cannot.
generates necessary control signals for overall Speed of Operation:
device operations. All commands from the CPU
are accepted through this block. Read and Write The speed of the device has a range set which is
signals are used to define the direction of data of few bytes per second to few giga-bytes per
transfer over a data bus. second.

3. Ports A and B registers - are used to transfer Read-write, read only, write-only:
data between Input-Output device and Interface
Different devices perform different operations,
Unit. Each port consists of bi-directional data input
some support both input and output, but others
buffer and bi-directional data output buffer. Lesson
support only one data transfer direction either input
8: Input Output (I/O) Interfacing
or output.
4. Control and Status register - CPU gives
control information to control register on basis of
control information. Bits which are present in the Ways of Communication in Microprocessors
status register are used for checking of status and Microcontrollers
conditions. Status register indicates status of data
register, port A, port B and also record errors that • Serial Communication Interface − In this
may occur during transfer of data. type of communication, the interface gets a
single byte of data from the microprocessor
and sends it bit by bit to the other system
serially and vice-a-versa.
• Parallel Communication Interface − In this
type of communication, the interface gets a
byte of data from the microprocessor and
sends it bit by bit to the other systems in
simultaneous (or) parallel fashion and vice-a-
versa.

You might also like