MIDTERM HELL ULTRA PAIN Flashcards
What is RAM?
Volatile Memory: Data is lost when the power is turned off.
Read/Write: Both reading and writing operations are allowed.
Primary Memory: Used to store data and programs currently in use.
What is ROM?
Non-Volatile Memory: Retains data even when the power is off.
Read-Only: Cannot be modified easily or at all by the user.
Stored Programs: Contains essential programs for booting and operating the computer (firmware).
What is the CPU?
Central Processing Unit: The brain of the computer that performs computations and controls other components.
What is memory?
Data and Instruction Storage: Stores data and instructions for the CPU.
Types Included: Includes both RAM and ROM.
What are I/O Devices?
Input/Output Communication: Allows communication between the computer and the outside world.
Examples: Keyboard, mouse, monitor, printer.
What is the data bus?
Carries Data: Transmits actual data between CPU and other components.
Bidirectional: Data can flow both to and from the CPU.
Width (Number of Lines): Determines how much data can be transferred at once (e.g., 8-bit, 16-bit, 32-bit, 64-bit).
What is the address bus?
Carries Addresses: Transmits the addresses of memory locations where data should be read or written.
Unidirectional: Typically only sends addresses from the CPU to memory or I/O devices.
Width: Determines the maximum amount of memory the CPU can address.
What is the control bus?
Carries Control Signals: Sends control instructions (like read or write signals) from the CPU to other components.
What is the ALU?
Arithmetic Logic Unit: Performs all arithmetic and logical operations (addition, subtraction, AND, OR, NOT).
What is Pipelining?
Overlapping Phases:
While one instruction is being executed, the next instruction is fetched simultaneously.
Division of CPU: Divides the CPU into the Execution Unit (EU) and Bus Interface Unit (BIU).
What is the bus interface unit?
Function:
1. Fetches instructions from memory.
2. Reads/writes data.
3. Calculates addresses.
Instruction Queue: A buffer that stores prefetched instructions so the EU doesn’t have to wait.
What is the Execution Unit (EU)?
Function: Executes instructions provided by the Bus Interface Unit (BIU).
What are registers?
High-Speed Storage: Small storage locations within the CPU that operate at high speeds.
Usage: Hold data, addresses, and control information temporarily during instruction execution.
What are the 5 register categories?
General-Purpose Registers
Segment Registers
Pointer and Index Registers
Instruction Pointer (IP)
Flags Register
What are the general-purpose registers?
Versatile Usage: Used for arithmetic operations, data manipulation, and addressing.
Access: Each can be accessed as a 16-bit register or as two separate 8-bit registers.
Ax (Accumulator Register)
Bx (Base Register)
Cx (Count Register)
Dx (Data Register)
What does the Ax (Accumulator Register) do?
Usage: Preferred for arithmetic, logic, and data transfer operations.
What does the Bx (Base Register) do?
Usage: Often holds base addresses in memory addressing.
Utility: Useful in indexed addressing modes.
What does the Cx (Count Register) do?
Usage:
1.) Primarily used as a loop counter in iterative operations.
2.) Used in shift and rotate instructions to specify the number of bits to shift/rotate.
What does the Dx (Data Register) do?
Usage:
1.) Used in I/O operations.
2.) Utilized for extended precision arithmetic.
What are the segment registers?
Function: Hold the addresses of segments in memory.
Memory Model: The 8088/8086 uses a segmented memory model, dividing memory into segments of up to 64 KB.
CS (Code Segment Register)
DS (Data Segment Register)
SS (Stack Segment Register)
ES (Extra Segment Register)
What does the CS (Code Segment Register) do?
Usage: Points to the segment containing the current program instructions.
What does the DS (Data Segment Register) do?
Usage: Points to the segment where data variables are stored.
What does the SS (Stack Segment Register) do?
Usage: Points to the segment containing the stack.
What does the ES (Extra Segment Register) do?
Usage: Provides an additional data segment for certain string and memory operations.
What are the Pointer and Index Registers?
Function: Used for memory addressing and manipulating data within memory segments.
Pointer Registers:
SP (Stack Pointer)
BP (Base Pointer)
Index Registers:
SI (Source Index Register)
DI (Destination Index Register)
What does the SP (Stack Pointer) register do?
Function:
1.) Automatically adjusted during stack operations.
2.) Points to the last value pushed onto the stack (top of stack).
What does the BP (Base Pointer) register do?
Usage: Often used to access parameters and local variables within the stack.
What does the SI (Source Index Register) do?
Usage: Used in string operations as the source pointer.
What does the DI (Destination Index Register) do?
Usage: Used in string operations as the destination pointer.
What is the Instruction Pointer (IP) Register?
Function: Holds the offset address (within the code segment) of the next instruction to be executed. Automatically updated after each instruction fetch.
Usage: The combination of CS (segment) and IP (offset) gives the complete address of the instruction.
What is the Flags Register?
Description: A 16-bit register that indicates the status of the CPU and the outcome of arithmetic and logical operations.
Flags Included:
Carry Flag (CF)
Zero Flag (ZF)
Sign Flag (SF)
Overflow Flag (OF)
Parity Flag (PF)
Auxiliary Carry Flag (AF)
What is the Carry Flag (CF)?
Condition: Set if an arithmetic operation generates a carry out of the most significant bit (for addition) or borrow into the most significant bit (for subtraction).
Usage: Used to detect unsigned arithmetic overflows.
What is the Zero Flag (ZF)?
Condition: Set if the result of an operation is zero.
Usage: Often used in branching instructions or loops.
What is the Sign Flag (SF)?
Description: Reflects the most significant bit of the result (the sign bit).
Condition: Set if the result is negative (in two’s complement representation).
What is the Overflow Flag (OF)?
Condition: Set if there is a signed overflow.
Usage: Used to detect errors in signed arithmetic operations.
What is the Parity Flag (PF)?
Condition: Set if the number of set bits in the least significant byte of the result is even.
Usage: Used for error detection in communication.
What is the Auxiliary Carry Flag (AF)?
Condition: Set if there is a carry or borrow between the lower and upper nibble (4-bit halves) of an 8-bit operand.
Usage: Important for Binary-Coded Decimal (BCD) arithmetic operations.
What are the three components of an assembly language instruction?
Mnemonic: A symbolic name representing a machine language instruction.
Operands: Data items that the instruction manipulates.
Comments: Provide explanations or annotations.
What is the Code Segment?
Storage: Stores the executable instructions of a program.
CPU Interaction: The CPU fetches instructions from the code segment during execution.
Registers Involved: CS (Code Segment Register), IP (Instruction Pointer)
What is the Data Segment?
Storage: Stores data to be processed by the program.
Registers Used: DS (Data Segment Register)
Offset Registers:
1.) Base Register (BX)
2.) Source Index (SI)
3.) Destination Index (DI)
What is the Stack Segment?
Definition: A stack is a region of memory used for temporary storage of data during program execution.
Purpose: Provides additional storage space for the CPU beyond its internal registers, which are limited in number.
Registers Involved:
1.) SS (Stack Segment Register)
2.) SP (Stack Pointer Register)
3.) BP (Base Pointer Register)
What is the physical address?
Definition: The actual address placed on the address bus by the CPU.