Computer Fundamentals

Secondary storage devices

  • Purpose and definition
    • Secondary storage devices hold data for a longer period and are used to store programs and data permanently until loaded into main memory when needed.
    • They store data on a permanent basis for future use; loading into main memory occurs on demand.
  • Types of secondary storage devices
    • Disk drives
    • Work by magnetically encoding data onto a spinning circular disk.
    • The disk contains two main components related to data encoding/reading: data is encoded (converted from a readable form to an unreadable form) and then read back when accessed.
    • Solid State Drives (SSD)
    • Faster than traditional disk drives.
    • No moving parts; data stored in solid-state memory.
    • Generally speed advantages come with a higher cost compared to hard disks.
    • Flash memory
    • Portable and has no physical disk.
    • Examples discussed: USB flash drives (pen drives), memory cards used in cameras and mobile devices.
    • Portable nature means you can carry data easily across locations.

Input devices

  • Purpose
    • Input devices provide data to the computer from users or other devices.
  • How data is collected
    • Through devices like keyboard, mouse, touchscreen, scanner, cameras.
    • Other data input methods mentioned: Bluetooth, voice data (audio).
  • Disk drives as input devices
    • Disk drives load programs into main memory; they can be considered input devices because they supply program instructions to RAM.
    • Typical flow: programs are stored on disk; when you double-click, the program’s instructions are loaded into RAM; the CPU processes data based on those instructions; if the CPU needs more information, it fetches from RAM.
  • Example scenarios
    • Keyboard or mouse input to a computer.
    • Video calls involve multiple inputs: audio data (microphone) and video data (webcam).

Output devices

  • Definition
    • Output devices are peripheral components that receive and display data produced by the computer (e.g., display, projector, printer).
    • A computer can function without an output device, but you wouldn’t be able to determine or verify what the computer is doing.
  • Output formats
    • Hard copy vs soft copy:
    • Soft copy: displayed on a monitor.
    • Hard copy: printed on paper by a printer.
  • Disk drives/USB as output devices
    • Disk drives and USB drives can also be considered output devices because data is written to them for storage.

Basic computer function diagram and data flow

  • High-level sequence
    • Input devices provide data to the computer.
    • Data is stored in memory (RAM) during processing, including intermediate results.
    • Central Processing Unit (CPU) processes the data according to user instructions.
    • If more information is needed, the CPU fetches data/instructions from RAM.
    • The Control Unit coordinates operations of computer components.
    • Output devices display or project the results.
  • Examples illustrating input, processing, and output
    • Example 1: Calculator
    • Input: number keys 1–9 pressed.
    • Processing: calculator computes the result in fractions of a second.
    • Output: result displayed on screen.
    • Example 2: Video calling
    • Inputs: audio (microphone) and video (webcam).
    • Processing: CPU handles data, organizes into data packets for transmission over the Internet.
    • Outputs: audio heard via speaker; video displayed on monitor.

Computer software: types and roles

  • Application software
    • Programs that make the computer useful for everyday tasks: emails, games, web browsers, etc.
  • System software
    • Controls and manages computer operations; examples include operating systems and utility software.
  • Utility programs
    • Enhance computer operations and safeguard data (e.g., antivirus software).
  • Software development tools
    • Tools used to create, modify, and test software; considered part of system software.

Binary data representation: bits, bytes, and encoding

  • Core idea
    • Computers understand data as zeros and ones.
  • Bit and byte definitions
    • Bit: the smallest unit of digital information, representing a single binary value: 0 or 1.
    • Byte: a collection of eight bits.
  • Mapping of bits to numbers
    • A binary number is represented by bits in positions that carry weights of powers of two.
    • In a standard representation, the value of an n-bit binary number with bits b_i (i = 0 to n-1) is:
    • ext{value} =
      \sum{i=0}^{n-1} bi \cdot 2^i,
    • where each b_i ∈ {0,1}.
    • The positions begin at 2^0 and go up to 2^{n-1} for an n-bit number.
  • Byte value range
    • A byte can represent values from 0 to 255 inclusive:
    • 0value281=255.0 \le \text{value} \le 2^8 - 1 = 255.
  • Storage capacity units (in brief)
    • Bit: smallest unit; 0/1 mapping (on/off state).
    • Byte: 8 bits; common minimal addressable storage unit for basic character data.
  • Character encoding: ASCII and Unicode
    • ASCII
    • Uses 7-bit encoding, allowing up to 128 characters:
      • 27=1282^7 = 128 characters.
    • Typical ASCII range: codes 0–127.
    • ASCII encodes letters, digits, punctuation, and control characters.
    • Unicode
    • Designed to support many languages and scripts beyond ASCII.
    • Unicode is compatible with ASCII in that ASCII characters share the same code points for the first 128 characters.
    • Unicode enables encoding of languages such as English, Hindi, and many others.
  • Practical note about interpretation (lecture inconsistency)
    • The transcript contains two conflicting statements about bit meaning:
    • Some parts say: on = 0, off = 1.
    • Other parts imply the common convention: on = 1, off = 0.
    • For clarity in notes, the standard convention is 1 = on and 0 = off, but the underlying idea is that bits encode zeros and ones; the mapping can vary by system.

How a simple program works (execution flow)

  • Program storage and loading
    • Instructions are stored on disk (hard drive or SSD).
    • When a program is invoked, its data is loaded into main memory (RAM).
    • The data is represented in binary (zeros and ones) for processing by the CPU.
  • Processing steps in the CPU
    • Fetch: retrieve the next instruction from memory.
    • Decode: determine what operation is to be performed.
    • Execute: perform the operation on the data.
    • If additional information is required, fetch from RAM as needed.
  • Compiler vs interpreter (summary)
    • Compiler
    • Translates an entire high-level language program into machine code (zeros and ones) in one go.
    • Once translated, the program can be executed multiple times without re-translation.
    • Interpreter
    • Translates and executes code line by line, directly from the high-level language.
    • No separate machine code is produced; execution happens as translation occurs.
    • If an error is found, an error message is shown and processing may continue to the next line (depending on the language and implementation).
  • Source code and syntax errors
    • Source code: the human-readable statements written in a high-level language.
    • Syntax error: violation of the language’s grammar or rules; detected during compilation or interpretation.

Python programming language specifics (as discussed in the lecture)

  • Python overview (introduction in the lecture)
    • Python is an interpreted language used for various programming tasks.
    • The interpreter handles Python code.
  • Modes of the Python interpreter
    • Interactive mode: statements are entered directly and executed immediately.
    • Script mode: statements are saved to a Python script file and executed as a batch.
  • Relationship to debugging
    • In Python, the interpreter is typically used as a debugger for immediate feedback (line-by-line execution).
  • Historical and general questions raised
    • The lecture touched on questions such as who invented Python and why it is named Python, but the provided transcript does not include those factual answers. (Note: Python was created by Guido van Rossum and released in 1991; this information is not explicit in the transcript but is common context for Python discussions.)

Activities and assessment reminders (from the lecture)

  • Activity 1
    • Question: Which peripheral is the most recent invention? Provide details on its functionality and cost.
  • Activity 2
    • Task: Draw or explain the computer architecture/diagram referenced in the lecture.
  • Activity 3
    • Task: Identify the processor that is the heart of your computer (the CPU), its speed, and research the history of the chip and popular modern processors along with their basic characteristics.
  • Submission and support
    • Some activities may be submitted via a GitHub server; the instructor will share a link and guidance on using GitHub for submission.
  • Deadlines for the first assessment
    • The deadlines for the first assessment range from late October to early November, with specific dates communicated in class.

Quick recap: key terms to remember

  • Secondary storage devices: disk drives (magnetic), SSDs (solid-state, no moving parts), flash memory (USB drives, memory cards).
  • Input devices: keyboard, mouse, touchscreen, scanner, cameras; data can also be transferred via Bluetooth or voice.
  • Output devices: display/monitor, projector, printer; hard copy vs soft copy.
  • Computer architecture basics: input -> memory (RAM) -> CPU -> memory (RAM) -> control unit -> output.
  • Software types: application software, system software, utility programs, and development tools.
  • Data representation: bits and bytes; binary numbers and their weighting; ASCII (7-bit, 128 chars); Unicode for broader language support.
  • Program execution model: fetch-decode-execute cycle; compiler vs interpreter; source code and syntax errors.
  • Python basics: interpreter-based language with interactive and script modes; used as an example of an interpreted language.
  • Activities emphasize practical understanding of peripherals, CPU details, and history of hardware/software components.