1. Functional Building Blocks of a Computer 🏗️
Every computer system is composed of three primary functional subsystems working in synchronization:
• Control Unit (CU): Directs the flow of data and decodes program instructions.
• Arithmetic Logic Unit (ALU): Performs arithmetic computations (+, -, *, /) and logical evaluations (AND, OR, NOT).
• Registers: High-speed internal memory cells (e.g. Program Counter PC, Accumulator ACC, Instruction Register IR).
Holds active program instructions and transient data required immediately by the CPU.
Enables user interaction (Keyboards, Mice, Displays, Mass Disk Storage).
// Basic C++ Simulation of CPU Input-Process-Output (IPO) Cycle
#include <iostream>
int main() {
int inputData = 42; // Input stage
int result = inputData * 2; // Process stage (ALU)
std::cout << "CPU Output: " << result << std::endl; // Output stage
return 0;
}- CPU is the central brain containing CU, ALU, and Registers.
- Program Counter (PC) stores the memory address of the next instruction to execute.
- Accumulator (ACC) temporarily stores intermediate ALU calculation results.