Overview of Computer Architecture
To become effective at programming, you have to know how computers are built. Computer architecture refers to the design of a computer’s components that execute programs.

Key Components
-
Input:
- Definition: Data or instructions provided to the computer by users or devices (e.g., keyboard, sensors).
- Role in Programming: Programs often begin by receiving input, such as numbers or text, to process.
- Example: An application would accept a user's name from a keyboard as input to personalized messaging.
-
Output:
- Definition: Results or information the computer produces after processing input.
- Role in Programming: Programs generate output, such as writing into a display unit or writing into a file.
- Example: An application that adds 5 and 7 shows "12" to the screen.
-
RAM (Random Access Memory):
- Definition: Temporary storage for data and instructions while a program runs.
- Role in Programming: Stores variables (like a score or user input) for faster retrieval during program run time.
- Key Point: RAM is volatile—the data is erased when you turn off your computer.
- Example: A program that follows a score in a game stores the value in RAM for real-time updating.
-
ROM (Read-Only Memory):
- Definition: Permanent storage for essential instructions, like firmware or boot-up processes.
- Role in Programming: Rarely accessed directly by programmers. ROM is what instructs the computer to boot and load the operating system.
- Key Point: ROM is non-volatile, retaining data without power.
-
Binary and Digital Signals:
- Definition: Computers use binary (0s and 1s) to represent data and instructions, based on digital signals (on/off states in circuits).
- Role in Programming: Programm is initially converted into binary (machine code) before executing in the processor.
- Why Binary?: Hardware uses electrical signals with two states, represented as 0 and 1.
- Example: The character "B" is stored as a binary code (e.g., 01000010 in ASCII) for processing.
Programming and Architecture
- Programs receive input from devices like keyboards or mice.
- They store and manipulate data in RAM during execution.
- The processor executes instructions, stored as binary in RAM or ROM.
- Programs generate output, for example, characters on a screen or files on a storage.