Assembly Language Processors:
Finite State Machines (FSM)
Arithmetic Logic Units (ALU)
Devices: Flip-flops, Circuits, Gates, Transistors
Definition: A digital device that processes input, stores values, and produces output based on internal instructions.
Components in Design:
Adders, Counters, Registers
Datapath:
All data computations occur here, represented by diagrams of physical connections.
Control Unit:
Orchestrates actions in the datapath; it is a finite state machine managing various tasks.
Registers: Fundaments for storing data
ALU: Executes arithmetic operations and contains output signals (overflow, carry, negative, zero indicators).
Control Signals: Direct how data flows between components (e.g., Load Reg, ALU operations).
Process:
Load X into RA & RB
Multiply RA by RB (store in RA)
Add X to RA (store results)
Repeat to get final output
Acts as a FSM:
Responds to clock signals
Sends control signals to datapath
Determines when to execute operations
Arithmetic Unit (ALU)
Storage Unit: Register files and main memory.
Controller Unit: Direct operation of the microprocessor.
Performs:
Arithmetic operations (addition, subtraction)
Logical operations (AND, OR, NOT)
Inputs: Include select bits and carry bits for operations.
Outputs: Indicators such as overflow (V), carry (C), negative (N), and zero (Z).
Registers: Quick storage for immediate data manipulation.
Main Memory: Larger storage for ongoing data.
Analogy:
Registers as a desk of books (quick access)
Memory as a library (slower access, larger capacity)
Reading/Writing:
Utilizes multiplexers for input and output selection based on addresses.
Write signal activates specified registers using a one-hot decoder.
Usage:
Registers for immediate operations
Memory for larger data sets
Access Speed:
Registers: Immediate
Memory: Longer delays due to distance from the processor
Control signals manage operations such as:
Write and read operations to/from memory
Selecting data sources and ALU operations
Fetch:
Retrieve instruction from memory.
Decode:
Determine the actions based on instruction type.
Execute:
Perform computations or memory access operations.
Advance:
Move to the next instruction based on PC update.
Tracks memory address of current instruction. Updates typically by incrementing by 4 (word-aligned).
Defines how instructions are laid out in bits (32-bit for MIPS architecture).
Instruction types include:
R-type: Operates on registers.
I-type: Contains immediate values.
J-type: Jump instructions.
Examples for an addi
instruction include:
Setting PC, memory read/write, and ALU operations.
Instructions in machine code are binary sequences guiding processor operations. They can be created via compilation from higher-level languages.
If creating a low-level language, consider operations, naming conventions, and the instruction format.
Microprocessors and Datapath Concepts
addi
instruction include: