Introduction to Computers, Hardware Architecture, and Programming Concepts
Fundamentals of Computing and Software Development
General Purpose of Computers:
- Computers are versatile, general-purpose machines designed to perform any specific task defined by the instructions within their operating programs.
- Educational Applications: Writing academic papers, conducting research, communicating via email, and taking online courses.
- Workplace Applications: Analyzing data, creating business presentations, executing financial transactions, controlling industrial machinery, and facilitating professional communication.
- Home Applications: Managing personal finances, shopping online, playing video games, and staying connected with others.
Ubiquitous Computerized Devices:
- Cellular phones
- iPods and digital audio players
- BlackBerry devices and mobile smartphones
- Global Positioning System (GPS) car navigation systems
Definitions of Software and Developers:
- Program: A sequence of detailed instructions that a computer follows step-by-step to execute a designated task. Standard examples include word processors (e.g., Microsoft Word) and photo editors (e.g., Adobe Photoshop).
- Software: The universal term used to describe computer programs.
- Programmers / Software Developers: Trained professionals who possess the technical skills required to design, write, test, and maintain software programs.
Computer Hardware Architecture
Hardware Definition:
- Hardware encompasses all physical, tangible electronic and mechanical components that constitute a functional computer system.
Five Major Hardware Components:
- Central Processing Unit (CPU):
- The core component that executes software instructions. A computer cannot operate without a CPU.
- Execution / Running: Terms describing the process of the CPU executing the operational commands specified by a software program.
- Main Memory:
- Acts as the computer's active work area, holding both the software program currently executing and the active data required by that program.
- Commonly known as Random-Access Memory (RAM).
- Offers high-speed data access for the CPU.
- It is volatile memory, meaning its contents are temporary and are completely erased when the computer is turned off.
- Secondary Storage Devices:
- Non-volatile memory designed to hold data and programs securely for extended periods, even when the computer is powered down.
- Disk Drives: Magnetically encode data onto a internal circular disk. External disk drives can be attached to create system backups.
- Floppy Drives: Write data onto small magnetic floppy disks. They possess low storage capacity, operate at slow speeds, and are generally unreliable compared to modern options.
- USB Drives: Small portable devices that plug directly into a computer's Universal Serial Bus (USB) port. They contain no moving magnetic disks, relying instead on solid-state flash memory. Also known as memory sticks or flash drives, they are inexpensive, small, and highly reliable.
- Optical Devices: Use high-precision laser beams to encode data as microscopic pits onto the reflective surface of CDs or DVDs. They feature large storage capacities and serve as reliable backup media.
- Input Devices:
- Input: Any raw data or information gathered by the computer from people or external sensors.
- An input device is the physical hardware that collects and transmits this incoming data.
- Examples: Keyboards, computer mice, digital document scanners, microphones, and digital cameras.
- Output Devices:
- Output: Any processed data or results produced by the computer for human users or external equipment.
- An output device is the hardware responsible for formatting, presenting, or displaying output.
- Examples: Display monitors and paper printers.
- Central Processing Unit (CPU):
Historical and Modern Processing Hardware
ENIAC (Electronic Numerical Integrator and Computer):
- Built in the year , ENIAC was the world's first programmable electronic computer.
- It was specifically developed for the United States Army to calculate artillery ballistic trajectory tables.
- Physical Dimensions: The CPU stood high, was long, and weighed approximately .
Modern Microprocessors:
- Modern central processing units are built on microscopic integrated circuits known as microprocessors.
- They are exponentially smaller in physical size while providing vastly superior processing capabilities compared to early room-sized systems.
Binary Representation and Data Storage
Fundamental Storage Units (Bits and Bytes):
- All data stored in a computer system is converted into binary sequences composed exclusively of the digits and
- A computer's primary memory is divided into basic storage locations called bytes.
- Each byte is further subdivided into smaller, discrete electronic storage units called bits (binary digits).
- Bits act as tiny electronic switches that hold either a positive electrical charge (representing an "on" switch or the binary digit ) or a negative electrical charge (representing an "off" switch or the binary digit ).
Numeric Representation in Binary:
- Unsigned integer values are stored using positional binary notation based on powers of (), evaluated from right to left starting at index :
- Bit (far right):
- Bit :
- Bit :
- Bit :
- Bit :
- Bit :
- Bit :
- Bit (far left):
- Worked Binary-to-Decimal Example:
- To find the decimal equivalent of the -bit binary number :
- Therefore, the bit pattern represents the decimal number
- Storage Capacity Limits:
- The maximum decimal integer value that can fit into a single -bit byte (where all bits are set to ) is
- To store integers greater than , systems combine multiple adjacent bytes. A -byte (-bit) memory block can store values up to
- Unsigned integer values are stored using positional binary notation based on powers of (), evaluated from right to left starting at index :
Advanced Data Formats:
- Negative Integers: Encoded using two's complement binary representation.
- Real Numbers (Decimals): Encoded using floating-point notation.
- Character Data: Textual characters are mapped to numeric codes and stored as binary values.
- ASCII (American Standard Code for Information Interchange): A standard set of numeric codes representing English letters, numbers, and basic punctuation. For instance, uppercase letter 'A' is represented by code
- Unicode: An expanded character-encoding standard that is fully backward-compatible with ASCII but contains codes for the written scripts and characters of all major global languages.
- Digital Media:
- Digital Data: Any data stored using binary representation.
- Digital Images: Composed of thousands of individual color dots called pixels (picture elements), where each pixel's color values are stored in binary.
- Digital Audio: Sound converted into numeric digital format by breaking continuous audio waves into small discrete measurements called samples.
CPU Execution Mechanics and Program Translation
Native CPU Capabilities:
- The CPU is an electronic component that executes lower-level operations deterministically.
- Core operations built into a CPU include:
- Reading data from a designated location in main memory.
- Adding two numbers.
- Subtracting one number from another.
- Multiplying two numbers.
- Dividing one number by another.
- Moving data from one main memory location to another.
- Testing whether two values are equal to each other.
Machine Language and Instruction Sets:
- A CPU directly understands only machine language, which consists entirely of binary sequences of s and s.
- The complete set of commands that a CPU is built to execute is called its instruction set.
- Microprocessor manufacturers (such as Intel, AMD, and Motorola) construct chips with distinct, proprietary instruction sets.
The Fetch-Decode-Execute Cycle:
- The continuous sequence executed by the CPU to run a program is called the Fetch-Decode-Execute Cycle:
- Fetch: The CPU reads the next binary instruction from main memory.
- Decode: The CPU decodes the instruction to identify the electronic operation to perform.
- Execute: The CPU carries out the operation.
- The continuous sequence executed by the CPU to run a program is called the Fetch-Decode-Execute Cycle:
Language Hierarchy and Abstraction:
- Assembly Language: A low-level programming language that replaces raw binary machine code with short, memorable terms known as mnemonics (e.g.,
ADD,MOV,SUB). - Assembler: A specialized program that translates an assembly language program into machine language.
- High-Level Languages: Languages that allow software developers to write complex programs using understandable words and logical expressions without needing to know how specific CPU hardware functions. Examples include Java, C++, Python, Visual Basic, C#, Ada, and Fortran.
- Assembly Language: A low-level programming language that replaces raw binary machine code with short, memorable terms known as mnemonics (e.g.,
Key High-Level Programming Concepts:
- Key Words / Reserved Words: Specialized words that have explicit, predefined meanings in a language and cannot be repurposed.
- Operators: Symbols or words that perform arithmetic or logical operations on data.
- Syntax: The exact set of rules that must be followed when writing source code.
- Statements: Individual command lines written in a programming language.
- Source Code: The program statements written in a high-level language before translation.
Compilers vs. Interpreters:
- Syntax Error: A violation of programming syntax rules, such as a misspelled keyword, missing punctuation mark, or improper operator usage.
- Compiler: A program that translates an entire high-level program into a separate, standalone machine language executable file that can be run independently at any time.
- Interpreter: A program that sequentially translates and executes each line of a high-level program on the fly during runtime, without generating a separate executable file.
Software Classification
System Software:
- Programs that manage and maintain the fundamental underlying hardware operations of a computer.
- Operating Systems (OS): Control internal hardware operations, manage connected hardware peripherals, and manage system resources.
- Utility Programs: Specialized routines that enhance computer functionality or protect system data (e.g., security utilities, file maintenance software).
- Software Development Tools: Software tools used by programmers to write, edit, compile, and debug software applications.
Application Software:
- End-user programs designed to accomplish practical tasks and daily workflows.
- Examples include word processing programs, spreadsheet software, database tools, presentation systems, web browsers, and email software.