Supported Instructions
Supported Instructions
Supported Instructions refer to the specific operations that the CPU can perform.
Arithmetic Operations: This includes operations like addition and subtraction.
Data Movement: This involves loading and storing data between various memory locations.
Control Flow: Branching and jumping within the execution flow of programs.
Data Types
The types of data that the processor can handle:
Integers: Whole numbers without fractional parts.
Floating-Point Numbers: Numbers that can represent a fractional component.
Characters: Individual symbols or letters.
Registers
Registers serve as small, fast storage locations within the CPU for temporary data during processing.
Memory Management
Memory management is pivotal in how hardware manages main memory.
Key features include virtual memory, allowing systems to use disk storage as an extension of RAM.
Input/Output Model
Pertains to the methods used by the processor for interacting with peripheral devices.
Example of an Instruction Set Architecture (ISA)
x86 Architecture: A widely used example of ISA in PCs, designed as a Complex Instruction Set Computer (CISC).
Arithmetic Operations: Instructions include ADD for addition and SUB for subtraction.
Data Movement: Instructions like MOV to transfer data between registers and memory.
Control Flow: Instructions such as JMP for unconditional jumps.
Examples of CISC Architectures
x86 Architecture
Utilized by Intel and AMD processors with a rich instruction set allowing complex operations.
Instructions include MOV, ADD, SUB, JMP, and CALL.
Motorola 68k Family
Features multiple operations executed in a single instruction.
VAX Architecture
Complex instruction set by Digital Equipment Corporation.
Examples of RISC Architectures
ARM Architecture
Noted for its efficient instruction set, popular in mobile and embedded systems.
MIPS Architecture
Designed for efficient pipelining, with a simple instruction set.
Power Architecture
Emphasizes simplicity for high performance across various applications.
Operand Storage in the CPU
Operand storage in the CPU refers to temporary storage methods for data during program execution.
Registers: High-speed storage locations holding operands and intermediate results.
General-Purpose Registers: Store frequently accessed data.
Special-Purpose Registers: Store values like the program counter and stack pointer.
Cache Memory
L1 Cache: Fastest cache located within the CPU core for frequently used data.
L2 and L3 Cache: Larger caches providing faster access than main memory but slower than L1.
Main Memory (RAM)
Stores program instructions and data manipulated by the CPU.
Stack Memory
A region of memory for temporary data, including function call details and local variables.
Stack Pointer: Manages memory allocation and deallocation.
Virtual Memory
A memory management technique utilizing disk storage as an extension of RAM.
Page Tables: Translate virtual addresses to physical addresses.
Explicit Named Operands
The number of explicitly named operands in a computer instruction relates to how many data items are referenced.
For instance, the instruction
MOV eax, 123uses two explicit named operands:eax(the register) and123(an immediate value).
Operand Locations
Common Operand Locations
Registers: Locations within CPU for fast access.
E.g.,
ADD R1, R2uses operands from registers.
Immediate Values: Fixed values specified in the instruction.
E.g.,
MOV R1, #10uses an immediate operand.
Memory: Operands located at specified memory locations.
E.g.,
LOAD R1, [address]fetches from memory.
Stack: Temporary values for function calls.
E.g.,
PUSH R1places value onto the stack.
Accumulator: Operands in a special register used for arithmetic.
E.g.,
ADD A, Boperates using an accumulator register.
Indexed: Addressing operands with an index/offset.
E.g.,
LOAD R1, [base + offset]accesses indexed memory.
Condition Codes: Flags affecting instruction execution.
E.g.,
BRANCH IF ZEROuses condition codes.
Instruction Set Architectures (ISAs)
ISAs define the operations a processor can execute.
Types of Operations in ISAs
Arithmetic Operations: Add, subtract, multiply, divide, increment, decrement.
Logical Operations: AND, OR, XOR, NOT.
Data Movement Operations: MOVE, LOAD, STORE.
Control Flow Operations: JMP, CALL, RET.
Shift and Rotate Operations: Shift left/right, rotate left/right.
Comparison Operations: Compare, set conditions.
Control Operations: Halt, no operation.
Operand Types and Sizes
Common Operand Types
**Integer Operands
Sizes: 8-bit, 16-bit, 32-bit, 64-bit.
Floating-Point Operands
Sizes: 32-bit, 64-bit.
Character/String Operands
Typically 8 bits per character.
Pointer Operands
Size matches the native word size.
Boolean Operands
Typically stored as 1-bit values.
How Operands Are Specified
Registers: Specified by name (e.g., R1).
Memory Addresses: Specified directly (e.g., [0x1234]).
Immediate Values: Specified within instruction (e.g., MOV R1, #10).
Indirect Addressing: Using addresses in registers (e.g., [R2]).
Indexed Addressing: Using base and offset (e.g., [R3 + 4]).
Stack Pointers: Relative to stack pointer (e.g., [SP]).
Types of Instruction Set Architectures (ISAs)
1. Stack Architecture
Operands are on the stack; pop and push operations are common.
2. Accumulator Architecture
One operand is the accumulator used for arithmetic/logical operations.
3. General Purpose Register (GPR) Architecture
All operands are explicitly mentioned, allowing flexibility in modern processing.
Trade-offs of Different ISAs
Each ISA type has unique advantages and impacts processing and application design.