1/32
Looks like no tags are added yet.
Instruction set architecture (ISA)
Definition: Rules and conventions defining the interface between hardware and software.
Abstraction: Hides intricate hardware details so developers can write code easily.
Impact: Determines a computer's capabilities, performance, and compatibility.
Key elements of an ISA
Instructions: Machine instructions executable by the CPU (arithmetic, data movement, control flow).
Data Types: Supported types like integer, floating-point, and character.
Registers: Available small, fast storage locations for temporary use and instruction operands.
Memory Organization: How memory is structured, addressed, and accessed.
Instruction Encoding: Binary formatting specifying opcodes and operands.
Execution Semantics: Instruction behavior and its effects on processor state (flags, registers).
Control Flow: Instructions for program flow management like branching and function calls.
Instructions (1-4)
Arithmetic Instructions: Perform math operations (addition, subtraction, multiplication, division) on registers or memory.
Data Movement Instructions: Move data between registers, memory, and storage (e.g., load moves memory to register; store moves register to memory).
Logic and Bitwise Instructions: Perform logical/bitwise operations (AND, OR, XOR, bit-shifting) for data manipulation.
Control Flow Instructions: Manage execution flow via branching, jumping, and conditional execution (e.g., branch, branch if equal, branch if less than).
Instructions (5-8)
Data Transfer Instructions: Handle data transfer and conversion between different data types, such as integers and floating-point numbers.
Stack Operations: Support stack-based data structures commonly used for function calls and subroutine management.
Vector and SIMD Instructions: Process multiple data elements in parallel, found in modern ISAs designed for multimedia and parallel processing.
System Calls and Privileged Instructions: Interact with the operating system to perform privileged operations like entering kernel mode.
Data types
Integer
Floating-Point
Character
Integer Data Types
Integer Data Types Definition: Represent positive and negative whole numbers without fractional parts, typically expressed as binary numbers.
Examples:
Byte: 8 bits, used for small integers.
Word: 16 bits or 32 bits, commonly used for integers.
Double Word: 32 bits, used for larger integers.
Quad Word: 64 bits, used for large integers and memory addressing.
Floating-Point Data Type
Floating-Point Data Types Definition: Used to represent numbers with fractional parts and a wide range of values, especially important for scientific and engineering calculations.
Examples:
Single Precision: Typically 32 bits, used for single-precision floating-point numbers.
Double Precision: Typically 64 bits, used for double-precision floating-point numbers.
Extended Precision: Some ISAs support extended precision formats with more bits for increased accuracy.
Character Data Types
Character Data Types Definition: Used to represent characters, symbols, and text, fundamental for processing and displaying textual information.
Examples:
Character: Often 8 bits (1 byte) and used for encoding individual characters (e.g., ASCII or Unicode).
String: A sequence of character data.
Layers of Abstraction
On this image

Registers
Registers are small, high-speed storage locations within the CPU. They are built directly into the processor chip and are used to store data temporarily.
Registers are the fastest storage elements in a computer, offering almost instantaneous access to data.
Types of Registers
General-Purpose Registers: Hold data and are used for a wide range of tasks, including data manipulation, calculations, and memory addressing.
Special-Purpose Registers: Registers with dedicated, specific functions.
Program Counter (PC): Keeps track of the address of the next instruction to be executed.
Stack Pointer (SP): Helps manage function calls and data storage in a stack.
Flag Registers: Contain flags or condition codes providing information about the outcome of previous operations.
Zero Flag: May indicate whether a previous arithmetic operation resulted in a zero value.
Roles and Purposes of Registers
Temporary Storage: Registers serve as temporary storage for data currently being processed (e.g., loaded during arithmetic operations, processed, and stored back).
Operands for Instructions: Act as the source and destination for most ISA instructions (e.g., numbers loaded from memory into registers for addition, with results stored back in registers).
Data Movement: Essential for moving data between memory and the CPU (e.g., loading data from memory into registers prior to processing).
Control and Program Flow: Special-purpose registers like the Program Counter (PC) manage program flow and instruction sequencing.
Instruction encoding
Instruction Encoding Definition: Specifies how instructions are represented in binary format, determining how the CPU interprets and executes instructions.
I-type Instruction: data transfering and branching (comparison).
R-type Instruction: shifting, addition and subtraction.
J-type Instruction: quick execution.

Opcode (Operation Code)
Definition: Field within the instruction that specifies the operation to be performed (arithmetic, logic, data movement, or control flow).
Format: Typically a binary code that uniquely identifies each instruction in the ISA.
Operands
Definition: The data on which the instruction operates (registers, memory addresses, immediate values, or combinations).
Execution: Instruction encoding specifies how the CPU interprets and accesses these operands.
Instruction Length
Definition: Defines the size of each instruction, which varies depending on operation complexity and number of operands.
Types: Instructions may be fixed-length or variable-length
Addressing Modes
Definition: Information within instruction encoding on how to compute the effective memory address for load and store operations.
Function: Dictate how the CPU should combine operands to determine the memory address.
Immediate Values
Purpose: Constants encoded directly within instructions, commonly used in arithmetic, logical, and control operations.
Bit Allocation: The number of bits allocated varies, affecting the range and precision of values that can be represented.
Instruction Decoding
Responsibility: Handled by the CPU's control unit to decode binary machine code into meaningful instructions.
Execution: Interprets opcode and operand fields to determine the operation to execute and the data to operate on.
Register Specifiers
Specifies which registers are involved in instructions.
Encoded as binary values or bit fields within the instruction
Encoding Efficiency
Optimizes the use of limited memory and achieves good instruction throughput.
Minimizes instruction length and complexity while maximizing instruction density and execution speed.
Machine Code Format
Determines the machine code format used to represent instructions in binary form.
Represents what is actually stored in memory and executed by the CPU.
Control Flow Instructions
Function: Fundamental ISA component allowing management and control of a program's execution sequence.
Examples: Branching (conditional and unconditional jumps) and function call instructions.
Flow Control Instructions
Function: Manipulate program execution flow.
Examples: Enabling/disabling interrupts, setting/clearing condition flags, and handling branch delay slots (if present).
Subroutine Parameters and Return Values
Function: Manage parameter passing to subroutines and retrieval of return values during function calls.
Mechanism: Defined by ISA conventions using specific registers or memory locations.
Branching Instructions
Definition: Used to alter the program's flow by changing the order in which instructions are executed.
Unconditional branching
Mechanism: Unconditionally change the program's flow, redirecting execution to a specific memory address (e.g., "jump").
Conditional branching
Mechanism: Allow the program to take different paths depending on a condition or a flag status (e.g., "branch if equal").
Simplified microprocessor structure
Core Definition: Consists of several key components that work together to execute instructions and perform basic computational tasks.
Internal Components (Inside Microprocessor):
ALU: Performs arithmetic and logic operations.
Control Unit: Manages instruction decoding and execution flow.
Register Array: Holds temporary data and register states.
Surrounding Units:
Input Device: Sends data into the processor.
Output Device: Receives results from the processor.
Memory Unit: Connects externally to store program instructions and data.

Memory
Computer Memory Function: Stores both instructions (program code) and data.
Memory Classification (Hierarchy):
Primary Memory: Consists of RAM and ROM.
Secondary Memory: Consists of long-term storage options including Floppy Disk, Hard Disk, CD, DVD, and Pan drive

Program Memory (Instruction Memory)
Allocation: Specifically allocated to store the instructions that make up a program.
Execution: Instructions are fetched and executed by the Central Processing Unit (CPU) to run a software application.
Content: Holds the machine code, which is a binary representation of the program's instructions.
Data Memory
Purpose: Used for storing various types of data, including variables, arrays, and other program-related information.
Separation: Distinct from program memory, ensuring a separation between code and data.
Operation: Where the CPU reads from and writes to when performing data manipulation operations.
Addresses
Organization: Memory is organized as a sequence of addressable locations, each identified by a unique memory address.
Usage: Used by the CPU to access specific memory locations for fetching instructions or reading/writing data.