Basic Computer Architecture
1. Computer System
A computer consists of Input Unit, CPU, Memory, Storage and Output Unit.
2. CPU
The CPU has the Control Unit (CU), Arithmetic Logic Unit (ALU), and Registers. CU fetches and
controls execution of instructions. ALU performs arithmetic and logical operations. Registers are
very small, fast storage inside the CPU.
3. Memory
Registers -> Cache -> RAM -> Secondary Storage forms the memory hierarchy. Cache is faster
than RAM. RAM is volatile. HDD/SSD are non-volatile.
4. Registers
Program Counter (PC): address of next instruction.
Instruction Register (IR): current instruction.
Accumulator: arithmetic results.
Stack Pointer (SP): top of stack.
Memory Address Register (MAR): memory address.
Memory Data Register (MDR): data being transferred.
5. Fetch-Decode-Execute Cycle
Fetch instruction from memory, decode it, execute it, store result, repeat.
6. Buses
Address Bus selects memory location, Data Bus transfers data, Control Bus carries control signals.
7. I/O Devices
Input: keyboard, mouse, scanner. Output: monitor, printer. Controllers interface devices with CPU.
8. Storage
SSD uses flash memory and is faster than HDD. HDD stores data magnetically.
9. Interrupts
Interrupts temporarily stop CPU execution to service urgent events like I/O completion.
10. Performance
Performance depends on clock speed, cores, cache size, memory bandwidth, and instruction
efficiency.