Programming Concepts and Computer Architecture

Fundamentals of Computers and Data

  • Computer Definition: An electronic device derived from the Latin word computare (meaning to calculate) that accepts digitized data (input), processes it according to a sequence of instructions (program), produces results (output), and stores them for future use.
  • Data: Raw, unorganized, and unstructured facts and figures that do not provide inherent value on their own (e.g., the numbers 77, 33, 99, and 1515).
  • Information: A collection of facts organized and processed to provide additional context and value (e.g., calculating the average of the quiz numbers to produce a result of 8.58.5).
  • Primary Computer Functions:
    • Input: Receiving data or instructions from external devices (e.g., keyboard, mouse, digital pen).
    • Processing: Operations performed on input data using the Central Processing Unit (CPU) to manipulate, calculate, and analyze.
    • Storage: Saving data temporarily in primary memory or permanently in secondary memory.
    • Output: Displaying or presenting processed data in forms such as text, graphics, audio, or video.
    • Control: Managing and controlling hardware and software components to ensure proper task execution.
    • Communication: Sending and receiving data or information over networks such as the Internet.

Computer Hardware and System Architecture

Block diagram showing the architecture and interaction of computer components including CPU, Control Unit, ALU, Internal Memory, Main Memory, Secondary Storage, Input Unit, and Output Unit

  • Central Processing Unit (CPU): Known as the "brain of the computer," it controls all system operations and consists of three main components:
    • Arithmetic Logic Unit (ALU): Performs calculations, logic operations, comparisons, and decision-making.
    • Control Unit: Directs computer activities, manages data flow between memory and the ALU, and fetches outputs.
    • Internal Memory Unit: Registers that volatilely store data, operations, or instructions currently being processed by the CPU.
  • Main Memory: Primary memory, specifically Random Access Memory (RAM), providing fast-access temporary storage for programs executing on the CPU.
  • Storage Devices: Non-volatile storage used to permanently keep data and software (e.g., Hard Disk Drives (HDD), Solid State Drives (SSD), Optical Drives (CD/DVD), and USB Flash Drives).
  • Motherboard: The main circuit board integrating and connecting all system components.
  • Input Devices: Classified into Keying, Pointing, and Scanning devices.
  • Output Devices: Classified into Visual, Print Output, and Audio devices.
  • Computer System: The complete setup of hardware (physical/tangible parts) and software (intangible programs and documentation).
    • System Software: Programs controlling the operations of the computer and its devices.
    • Application Software: Programs designed to perform specific user tasks.

Computer Programs and Programming

  • Computer Program: A sequence of sequential and logical instructions (source code) written in a programming language to direct a computer to execute specific tasks.
  • Computer Programming: The process performed by programmers/developers to write, design, and create software solutions that automate tasks and solve real-world problems.
  • Key Aspects of Computer Programming:
    • Problem Solving
    • Algorithm Design
    • Data Structures
    • Coding (Syntax and Logic)
    • Testing and Debugging
    • Documentation
    • Optimization
    • Modularity
    • Best Practices
    • Collaboration
    • Version Control

Programming Language Categories

  • Components of Programming Languages: Syntax, Data Types, Variables, Operators, Control Structures (sequence, selection, repetition), Libraries/Packages, and Paradigms (Procedural, Object-Oriented Programming, etc.).
  • Machine Languages: Direct binary code understood natively by computer hardware.

Example of binary code in machine language

  • Assembly Languages: Low-level languages closer to machine code that use mnemonics for instructions; translated into machine language using an Assembler.

Example of assembly language instructions using mnemonics

  • High-Level Languages: Human-readable languages (e.g., Python, Java, C++, Ruby, JavaScript) allowing focus on problem-solving rather than hardware details; translated into machine code using a Compiler.

Signals, Data Representation, and Encoding

  • Analog Signals: Continuous waveforms used to represent information like sound (e.g., audio tapes, analog temperature readings, dimmer switches).
  • Digital Signals: Discrete signals representing information as binary values consisting of 00s (low voltage/false) and 11s (high voltage/true).
  • Binary Units:
    • Bit (Binary Digit): The smallest unit of digital data, representing a 00 or a 11.
    • Byte: A sequence of 88 bits, serving as the basic unit for processing and storing data.

Table of binary data storage units from Byte to Zettabyte

  • Character Encoding Schemes:
    • ASCII (American Standard Code for Information Interchange): Standard scheme for Intel-based systems containing 128128 characters (indexed 00 to 127127). Example: Character 'A' corresponds to decimal value 6565 and binary 0100 00010100\,0001.
    • EBCDIC (Extended Binary Coded Decimal Interchange Code): An 88-bit encoding scheme with 256256 characters commonly used on IBM mainframe computers.
    • UTF (Unicode Transformation Format): 88-bit, 1616-bit, and 3232-bit encoding schemes providing over 100,000100,000 unique character codes, widely used for webpages, databases, and APIs.