Comprehensive Introduction to Computer Concepts and Programming Languages
Introduction to Basic Computer Concepts
- Instructor and Context: The material was prepared by Dr. Marco A. Arocha for sessions in Summer 2015, August 2015, and Summer 2020.
- Fundamental Definition of a Computer:
- A computer is an electronic device designed to perform computations and make logical decisions.
- Processing Speed: Computers operate at speeds that are millions or even billions of times faster than human capabilities.
- Control: Computers process data specifically under the control of sets of instructions known as computer programs.
Computer Hardware and Software
- Hardware: Refers to the physical devices that comprise a computer system. Examples include:
- Keyboard
- Screen (Monitor)
- Disks (Storage)
- Memory
- Processing Units
- Software: Refers to the computer programs that run on the hardware to perform tasks.
- Internal Components of a Desktop Computer:
- Power Supply: Provides electrical power to the system.
- Microprocessor: The central engine of the computer, often equipped with a microprocessor fan for cooling.
- RAM (Random Access Memory): Primary volatile memory for active data.
- Video Card and Sound Card: Dedicated hardware for processing visual and auditory data.
- Motherboard: The main circuit board that connects all components.
- Hard Disk Drive: Primary long-term storage.
- CD-DVD: Optical drive for reading/writing discs.
- Casing: The external shell housing the components.
Classification and Evolution of Computers
- Historical Volume and Scale Trends (1960–2020):
- The volume of computing devices has decreased dramatically over time, measured in cubic millimeters (mm3).
- Mainframes: Large-scale systems dominant in the early decades (1012mm3 range).
- Minicomputers: Emerged in the late 1960s and 1970s (109mm3 range).
- Workstations and Personal Computers (PC): Became prominent in the 1980s (106mm3 range).
- Laptops: Portable computing appearing in the 1990s (103−100mm3 range).
- Smart Phones: Modern handheld computing (10−3mm3 relative scale).
- mm-scale sensors: Ultra-miniaturized computing devices emerging by 2020.
Computer Organization and CPU Structure
- Central Processing Unit (CPU): The principal part of any digital computer system. It is responsible for coordinating and supervising the operation of all other sections. It consists of:
- Arithmetic and Logic Unit (ALU): The component that performs mathematical calculations and makes logical decisions.
- Control Unit (CU) / Program Control Unit: Determines what the computer does based on instructions read from the memory.
- Main Memory: Works directly with the CPU to store active data and instructions.
- Input and Output (I/O) Units:
- Input Unit: The "receiving" section. Today, information is primarily entered via typewriter-like keyboards.
- Output Unit: The "shipping" section. Information is output by displaying it on screens, printing on paper, or storing it in secondary memory devices.
Memory Hierarchy and Storage
- Memory Units and Organization:
- Bit: A binary digit, representing either 0 or 1.
- Byte: Consists of 8 bits. It is the smallest addressable location in memory.
- Word: Typically consists of 4 bytes or more; the exact size is machine-dependent.
- Instructions: Composed of operation codes (opcodes) and addresses (e.g., oprnaddr1addr2addr3).
- Secondary Storage Devices: Used for programs or data not actively in use by other units. Examples include disks and pen drives (USB flashes).
- The Bus System:
- Definition: A set of physical connections (cables, printed circuits) shared by multiple hardware components.
- Purpose: To reduce the number of communication pathways by carrying all signals over a single data channel.
- Metaphor: Often described as a "data highway."
Operating Systems and Networking
- Operating System (OS): Software that administrates computer operations to ensure optimal performance. Examples include:
- Windows 10
- Unix and Linux
- Apple macOS
- Android (common in various mobile brands)
- Server-Client Networks: Enhance collaboration by sharing resources (software, files, printers).
- Server Characteristics:
- Always powered on.
- Provides 24/7 access to specialized applications.
- Stores and shares files with clients.
- Performs backups of client computers.
- Allows remote file access for users.
- Provides enhanced security.
- Offers shared services: file, print, email, database, and web hosting.
- Single-user Batch Processing: The computer runs one program at a time, processing data in designated groups or batches.
- Multiprogramming: Enables the "simultaneous" operation of many jobs by sharing resources among them.
- Timesharing: A specific case of multiprogramming where multiple users access the system via terminals, appearing to run programs simultaneously.
- Distributed Computing: Computing tasks are spread across a network to the specific sites where work is performed.
- Client-Server Computing: Servers store shared programs and data accessed by distributed client computers.
Hierarchy of Programming Languages
- Machine Language:
- The only language a computer understands directly.
- Consists of strings of numbers (binary 1s and 0s).
- Machine-dependent (specific to a particular processor type).
- Example (x86/IA-32): The binary code 1011000001100001 instructions the processor to move an 8-bit value into a specific register. The first 5 bits (10110) represent the operation, and the next 3 bits (000) identify the register.
- Assembly Language:
- Uses English-like abbreviations (mnemonics).
- Requires Assemblers to translate code into machine language.
- Example:
LUI R1, #1, LUI R2, #2, DADD R3, R1, R2 (performs 1+2=3 in MIPS assembly). - MIPS (Million Instructions Per Second): An old measure of CPU speed. Critics sometimes call it the "Meaningless Indicator of Performance" because it doesn't account for instruction complexity or I/O bottlenecks.
- High-Level Languages:
- Contain English words and conventional mathematical notation.
- Easier to write but require translation.
- Compiled Languages: (e.g., Fortran, C, C++) Use a system called a Compiler to translate code into machine language.
- Interpreted Languages: (e.g., Python, Matlab) Use Interpreters to execute programs directly without prior compilation.
- Scripting/Interpreted Layers: The highest layer of human-readable code (e.g., Perl, Python, Shell, Java).
History and Significant High-Level Languages
- FORTRAN ($1950$): Formula Translator; designed for mathematical applications.
- COBOL ($1959$): Common Business Oriented Language; designed for commercial data manipulation.
- Pascal ($1970$): Designed for teaching structured programming.
- C ($1972$): General-purpose, procedural language that maps efficiently to machine instructions.
- Ada ($1980$): Developed for the US Department of Defense using Pascal as a base.
- Python ($1989$): Created by Guido van Rossum as a successor to the ABC language.
- Java ($1995$): Class-based, object-oriented language popular for client-server web applications, with approximately 9 million developers.
- Structured Programming: A disciplined approach to writing code that is clearer, easier to test, debug, and modify compared to unstructured programs.
Comparative "Hello World" Code Examples
- C:
c
#include <stdio.h>
int main() {
printf("Hello World! \n");
return 0;
}
- BASIC:
10 PRINT "Hello world!", 20 END. - Java:
java
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello world!");
}
}
- Python:
print("Hello World"). - Matlab:
fprintf('Hello World \n');. - Perl:
print "Hello World!\n";. - VBA:
vba
Sub helloWorld()
MsgBox ("Hello World!")
End Sub
Python History and Philosophy
- Origin: Conceived in the late 1980s; implementation began in December 1989 at Centrum Wiskunde & Informatica in the Netherlands.
- Guido van Rossum: The principal author. He was known as the "Benevolent Dictator for Life" (BDFL) until he stepped down on July 12, 2018.
- Philosophy: Van Rossum describes Python as an experiment in programmer freedom: "Too much freedom and nobody can read another's code; too little and expressiveness is endangered."
- Popularity: Stack Overflow query data shows Python trending upward significantly from 2008 to 2023 compared to languages like C#, Java, PHP, and C++.