Architecture of computers (lec. 3)

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/32

encourage image

There's no tags or description

Looks like no tags are added yet.

33 Terms

1
New cards

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.


2
New cards

Key elements of an ISA

  1. Instructions: Machine instructions executable by the CPU (arithmetic, data movement, control flow).

  2. Data Types: Supported types like integer, floating-point, and character.

  3. Registers: Available small, fast storage locations for temporary use and instruction operands.

  4. Memory Organization: How memory is structured, addressed, and accessed.

  5. Instruction Encoding: Binary formatting specifying opcodes and operands.

  6. Execution Semantics: Instruction behavior and its effects on processor state (flags, registers).

  7. Control Flow: Instructions for program flow management like branching and function calls.


3
New cards

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).


4
New cards

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.


5
New cards

Data types

  1. Integer

  2. Floating-Point

  3. Character


6
New cards

Integer Data Types

  • Integer Data Types Definition: Represent positive and negative whole numbers without fractional parts, typically expressed as binary numbers.

  • Examples:

  1. Byte: 8 bits, used for small integers.

  2. Word: 16 bits or 32 bits, commonly used for integers.

  3. Double Word: 32 bits, used for larger integers.

  4. Quad Word: 64 bits, used for large integers and memory addressing.



7
New cards

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:

  1. Single Precision: Typically 32 bits, used for single-precision floating-point numbers.

  2. Double Precision: Typically 64 bits, used for double-precision floating-point numbers.

  3. Extended Precision: Some ISAs support extended precision formats with more bits for increased accuracy.


8
New cards

Character Data Types

  • Character Data Types Definition: Used to represent characters, symbols, and text, fundamental for processing and displaying textual information.

  • Examples:

  1. Character: Often 8 bits (1 byte) and used for encoding individual characters (e.g., ASCII or Unicode).

  2. String: A sequence of character data.


9
New cards

Layers of Abstraction

On this image

<p>On this image</p>
10
New cards

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.


11
New cards

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.


12
New cards

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.


13
New cards

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.


<p><span style="line-height: 1.15;"><strong>Instruction Encoding Definition:</strong> Specifies how instructions are represented in binary format, determining how the CPU interprets and executes instructions.</span></p><ul><li><p><span style="line-height: 1.15;"><strong>I-type Instruction:</strong> data transfering and branching (comparison).</span></p></li><li><p><span style="line-height: 1.15;"><strong>R-type Instruction:</strong> shifting, addition and subtraction.</span></p></li><li><p><span style="line-height: 1.15;"><strong>J-type Instruction:</strong> quick execution.</span></p></li></ul><p></p>
14
New cards

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.


15
New cards

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.


16
New cards

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


17
New cards

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.


18
New cards

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.


19
New cards

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.


20
New cards

Register Specifiers

  • Specifies which registers are involved in instructions.

  • Encoded as binary values or bit fields within the instruction


21
New cards

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.


22
New cards

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.


23
New cards

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.


24
New cards

Flow Control Instructions

  • Function: Manipulate program execution flow.

  • Examples: Enabling/disabling interrupts, setting/clearing condition flags, and handling branch delay slots (if present).


25
New cards

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.


26
New cards

Branching Instructions

  • Definition: Used to alter the program's flow by changing the order in which instructions are executed.


27
New cards

Unconditional branching

  • Mechanism: Unconditionally change the program's flow, redirecting execution to a specific memory address (e.g., "jump").


28
New cards

Conditional branching

  • Mechanism: Allow the program to take different paths depending on a condition or a flag status (e.g., "branch if equal").


29
New cards

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.


<p></p><ul><li><p><span style="line-height: 1.15;"><strong>Core Definition:</strong> Consists of several key components that work together to execute instructions and perform basic computational tasks.</span></p></li><li><p><strong>Internal Components (Inside Microprocessor):</strong></p><ul><li><p><span style="line-height: 1.15;"><strong>ALU:</strong> Performs arithmetic and logic operations.</span></p></li><li><p><span style="line-height: 1.15;"><strong>Control Unit:</strong> Manages instruction decoding and execution flow.</span></p></li><li><p><span style="line-height: 1.15;"><strong>Register Array:</strong> Holds temporary data and register states.</span></p></li></ul></li><li><p><strong>Surrounding Units:</strong></p><ul><li><p><span style="line-height: 1.15;"><strong>Input Device:</strong> Sends data into the processor.</span></p></li><li><p><span style="line-height: 1.15;"><strong>Output Device:</strong> Receives results from the processor.</span></p></li><li><p><span style="line-height: 1.15;"><strong>Memory Unit:</strong> Connects externally to store program instructions and data.</span></p></li></ul></li></ul><p></p>
30
New cards

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


<ul><li><p class="first-token"><span style="line-height: 1.15;"><strong>Computer Memory Function:</strong> Stores both instructions (program code) and data.</span></p></li><li><p><strong>Memory Classification (Hierarchy):</strong></p><ul><li><p><span style="line-height: 1.15;"><strong>Primary Memory:</strong> Consists of RAM and ROM.</span></p></li><li><p><span style="line-height: 1.15;"><strong>Secondary Memory:</strong> Consists of long-term storage options including Floppy Disk, Hard Disk, CD, DVD, and Pan drive</span></p></li></ul></li></ul><p></p>
31
New cards

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.


32
New cards

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.


33
New cards

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.