Computer Organzation notes
Computer Organzation notes
I/O devices ->Input devices sends data to the computer and output devices
Memory and storage ->Memory stores data temporarily for quick access e.g
RAM
Storage (data is stored permanently for later use) e.g Hard disk, SSD
Interconnection:
Data Bus: Transfers data between CPU, memory, and I/O devices.
Subcomponents:
Registers:
sequence.
Definitions:
1. Clock:
2. Clock Period:
Example:
4. IA-32 Registers
Types:
EDX (Data Register): Used for I/O operations and to store values for
current position.
EBP (Base Pointer): Points to the base of the stack frame for
ESI (Source Index): Used as the source address in string and memory
manipulation operations.
2. Special Registers:
o EFLAGS:
Examples:
carry (extra bit) beyond the size of the destination register in unsigned
operations.
High (Set to 1): When the result is too large for the register (e.g., adding 8-bit
Example:
bits).
overflow in signed operations (i.e., the result is outside the valid range of
signed numbers).
High (Set to 1): When the result is too large for the signed range.
Low (Set to 0): When the result is within the signed range.
Example:
o Adding +120 and +10 in 8-bit signed numbers (valid range: -128 to
+127).
negative by copying the most significant bit (MSB), which represents the sign.
Low (Set to 0): When the result is positive or zero (MSB = 0).
Example:
Definition: The Zero Flag indicates whether the result of an operation is zero.
Example:
o Subtracting 4 - 4 → Result is 0.
o Subtracting 4 - 3 → Result is 1, so ZF = 0.
the 5th bit (bit 4), used for BCD (Binary-Coded Decimal) operations.
Example:
Definition: The Parity Flag indicates whether the number of 1 bits in the
High (Set to 1): When the number of 1 bits is even (even parity).
Low (Set to 0): When the number of 1 bits is odd (odd parity).
Example:
3. Segment Registers:
which is used for function calls, local variables, and managing the stack.
5. Memory Management
Memory Addressing:
o Example:
Endianness:
1. Little Endian:
2. Big Endian:
6. Memory Types
Volatile Memory:
2. Cache Memory:
Non-Volatile Memory:
7. I/O Operations
memory.
1. Read Cycle:
o CPU places address on Address Bus.
2. Write Cycle:
1. Fetch:
o CPU retrieves the next instruction from memory using the EIP.
2. Decode:
3. Execute:
4. Write Back:
o Results are stored in memory or registers.
Practice Questions
Syntax:
Variable declaration