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 (1960196020202020):
    • The volume of computing devices has decreased dramatically over time, measured in cubic millimeters (mm3mm^3).
    • Mainframes: Large-scale systems dominant in the early decades (1012mm310^{12}\,mm^3 range).
    • Minicomputers: Emerged in the late 19601960s and 19701970s (109mm310^9\,mm^3 range).
    • Workstations and Personal Computers (PC): Became prominent in the 19801980s (106mm310^6\,mm^3 range).
    • Laptops: Portable computing appearing in the 19901990s (103100mm310^3\,-10^0\,mm^3 range).
    • Smart Phones: Modern handheld computing (103mm310^{-3}\,mm^3 relative scale).
    • mm-scale sensors: Ultra-miniaturized computing devices emerging by 20202020.

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 00 or 11.
    • Byte: Consists of 88 bits. It is the smallest addressable location in memory.
    • Word: Typically consists of 44 bytes or more; the exact size is machine-dependent.
    • Instructions: Composed of operation codes (opcodes) and addresses (e.g., oprnaddr1addr2addr3oprn\,addr1\,addr2\,addr3).
  • 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 1010
    • Unix and Linux
    • Apple macOS
    • Android (common in various mobile brands)
  • Server-Client Networks: Enhance collaboration by sharing resources (software, files, printers).
    • Server Characteristics:
      1. Always powered on.
      2. Provides 24/724/7 access to specialized applications.
      3. Stores and shares files with clients.
      4. Performs backups of client computers.
      5. Allows remote file access for users.
      6. Provides enhanced security.
      7. Offers shared services: file, print, email, database, and web hosting.

Forms of Computing

  • 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 11s and 00s).
    • Machine-dependent (specific to a particular processor type).
    • Example (x86/IA-32): The binary code 101100000110000110110000\,01100001 instructions the processor to move an 8-bit value into a specific register. The first 55 bits (1011010110) represent the operation, and the next 33 bits (000000) 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=31 + 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 99 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; } &nbsp;&nbsp;&nbsp;&nbsp;
  • BASIC: 10 PRINT "Hello world!", 20 END.
  • Java: java public class HelloWorld { public static void main(String[] args) { System.out.println("Hello world!"); } } &nbsp;&nbsp;&nbsp;&nbsp;
  • Python: print("Hello World").
  • Matlab: fprintf('Hello World \n');.
  • Perl: print "Hello World!\n";.
  • VBA: vba Sub helloWorld() MsgBox ("Hello World!") End Sub &nbsp;&nbsp;&nbsp;&nbsp;

Python History and Philosophy

  • Origin: Conceived in the late 19801980s; implementation began in December 19891989 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 1212, 20182018.
  • 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 20082008 to 20232023 compared to languages like C#, Java, PHP, and C++.