Computer Hardware & Software Basics
Computer Hardware & Software Basics
A computer is a programmable machine that processes data using hardware components and software
programs 1 2 . Hardware refers to the physical parts of a computer: - CPU (Central Processing
Unit): the “brain” of the computer, with an Arithmetic Logic Unit (ALU) for arithmetic/logic operations
and a Control Unit (CU) that decodes instructions and manages execution 3 . The CPU also contains
small fast registers (e.g. Program Counter, Instruction Register) for immediate data storage 4 .
- Memory: stores data and instructions. Primary memory (RAM) is fast and volatile (lost on power-off),
holding data the CPU is currently using. Secondary storage (hard drives, SSDs) is non-volatile for long-
term data. Cache is a small high-speed memory near the CPU that holds frequently used data 5 .
- I/O Devices & Buses: Input devices (keyboard, mouse, etc.) allow data entry; output devices (monitor,
printer, etc.) present results 6 . These components communicate over system buses (data, address,
control lines).
Software is the collection of instructions and programs that run on hardware 2 . It is of two main
types:
- System software: includes the operating system (e.g. Windows, Linux) and device drivers. The OS
manages hardware resources (CPU scheduling, memory allocation, I/O control) and provides a user
interface 7 8 . It acts as an intermediary between hardware (machine language) and application
programs (high-level languages) 8 .
- Application software: programs that perform user tasks (browsers, office apps, games). They run on
top of the OS and request services (e.g. file saving, network access).
These components work together: hardware executes machine code, system software coordinates
resources, and applications provide useful functions to users 7 8 .
• Binary to decimal: Each binary digit (bit) has a place value 2^n. For example, the binary number
11010₂ equals 1·2⁴ + 1·2³ + 0·2² + 1·2¹ + 0·2⁰ = 16+8+0+2+0 = 26₁₀. As built-in notes explain, “binary
uses only two digits (0 and 1) — base-2, whereas decimal uses 0–9 (base-10)” 10 .
• Conversions: To convert from binary to decimal, sum the powers of 2 for each 1 bit. To convert
binary to hex, group bits in 4’s (e.g. 11010₂ = 1 1010₂ = 1A₁₆). To convert decimal to binary,
repeatedly divide by 2 and record remainders (e.g. 13₁₀ → 1101₂). Hexadecimal is compact for
binary: each hex digit = 4 bits. Table examples:
• 0000₂ = 0₁₆, 0001₂ = 1₁₆, … 1001₂ = 9₁₆, 1010₂ = A₁₆, … 1111₂ = F₁₆.
• Example: 101011₂ = 43₁₀ (32+8+2+1).
Key points:
- Bit = one binary digit (0/1). 8 bits = 1 byte (range 0–255) 11 .
- Computers use binary because physical circuits have two states (e.g. voltage on/off). Decimal values
can always be converted to binary for processing 10 11 .
1
Logic Gates & Boolean Algebra
Digital logic gates implement Boolean functions at the hardware level. The AND gate outputs 1 only if
all its inputs are 1. Otherwise it outputs 0. In electronics terms: “The output goes HIGH (1) only when all
inputs are HIGH” 12 . Conversely, the OR gate outputs 1 if any input is 1. (It outputs 0 only when all
inputs are 0) 13 . The NOT gate (inverter) has one input: it outputs the opposite of its input bit 14 . In
summary:
- AND: 1·1=1; 1·0=0; 0·0=0 12 .
- OR: 1+0=1; 0+0=0; 1+1=1 13 .
- NOT: ¬1=0; ¬0=1 14 .
Other gates include NAND (NOT-AND), NOR (NOT-OR), XOR (exclusive OR), etc., each with its own truth
table. Gates can be combined into circuits for computation.
Boolean algebra is the mathematical system underlying logic gates. Variables take values 0/1 and use
operations ∧ (AND), ∨ (OR), ¬ (NOT). Common laws include identity and domination (e.g. A + 0 = A, A·1 =
A), commutativity, distributivity, and De Morgan’s laws. For example, De Morgan’s laws state:
- ¬(A ∨ B) = ¬A ∧ ¬B
- ¬(A ∧ B) = ¬A ∨ ¬B 15 16 .
These laws allow simplification of logic expressions and circuits. (For example, a NAND gate is
equivalent to an AND gate followed by NOT, etc.) Boolean algebra is used to design and minimize digital
logic for hardware implementation.
2
programs to run concurrently.
- Memory Management: Controls allocation/deallocation of RAM. It keeps track of each program’s
memory needs, uses techniques like paging or segmentation, and may employ virtual memory (using
disk space) to extend RAM 18 . The OS prevents programs from interfering with each other’s memory
and optimizes performance by caching and swapping.
- File System & Storage: Manages files/directories on disks or SSDs. It organizes data on secondary
storage, handles read/write requests, and tracks free/used space. The OS provides a hierarchical file
structure and may implement permissions/security on files.
- Device I/O Control: Interacts with hardware devices via drivers. The OS uses device drivers to control
peripherals (printers, disks, network cards, etc.). It handles I/O requests from programs, using
interrupts or direct memory access (DMA) to efficiently transfer data.
- User Interface: Offers a shell or GUI for user interaction. Users enter commands (CLI) or use a
graphical desktop (GUI); the OS translates these into actions (launching apps, copying files, etc.).
- Security and Services: Provides user accounts, access controls, and network services. For example,
the OS may manage users, enforce passwords, and offer security protocols. It also runs background
services (daemons) like networking (TCP/IP stack), printers, or web servers.
In summary, the OS is the core program always running (kernel and system processes) that ensures
smooth operation of the entire computer 7 . Popular examples include Windows, Linux, macOS for
personal computers, and Android or iOS for mobile devices. The OS boots at startup, loads into
memory, and then continuously schedules and manages programs until shutdown.
Networking Fundamentals
A computer network connects multiple devices to share resources and data. Networks can be
classified by scope and architecture:
- LAN (Local Area Network): Covers a small area (home, office). It typically uses Ethernet or Wi-Fi and
operates at high speed.
- MAN (Metropolitan Area Network): Larger area (city), often interconnecting multiple LANs.
- WAN (Wide Area Network): Spans large geographic regions (countries or global). The Internet is the
largest WAN.
Networks use various topologies (e.g. star, bus, ring) and devices: NICs (network cards) connect devices,
switches/hubs interconnect LAN segments, and routers forward data between networks (often
connecting LANs to the Internet).
- VPN: A Virtual Private Network creates a secure “tunnel” over public networks, extending a private
network across the Internet 22 . VPNs encrypt traffic so remote users appear on the local network,
useful for secure remote access.
3
Networks follow architectural models:
- Client–Server: Dedicated servers provide resources/services (files, web pages, email) and clients
request them. This centralization aids management and scalability 23 .
- Peer-to-Peer: All nodes are equal; each can act as client or server. This is common for file-sharing in
small networks. P2P is easier to set up on a small scale but less centrally managed 24 25 .
Protocols may follow the OSI or TCP/IP models. For example, TCP/IP is the suite of protocols on the
Internet (IP, TCP/UDP, HTTP, etc.). Firewalls and security measures (like VPNs and encryption) protect
networks. Networking fundamentals also include understanding bandwidth, latency, and types of
connections (wired vs. wireless).
<!DOCTYPE html>
<html>
<head>
<title>Sample Page</title>
<meta charset="UTF-8">
</head>
<body>
<h1>Welcome to My Site</h1>
<p>This is a sample HTML page.</p>
<a href="https://example.com">Visit Example.com</a>
</body>
</html>
Here, <html>...</html> encloses the whole document. Inside, <head> contains metadata (like
<title> for the page title), and <body> contains visible content. Common elements: headings
( <h1> – <h6> ), paragraphs ( <p> ), links ( <a href="URL"> ), images ( <img src="file.jpg"
alt="text"> ), lists ( <ul> , <ol> with <li> ), tables ( <table> , <tr> , <td> ), etc. HTML
elements may have attributes (e.g. href , src , alt ) that provide additional info. As MDN notes,
HTML “consists of a series of elements… to enclose… parts of content” 26 . For example, wrapping text
in <p> makes it a paragraph; <h1> makes it a top-level heading.
CSS (Cascading Style Sheets) is a language to style HTML content. It controls how elements look
(colors, layout, fonts). For example:
p {
color: yellow;
background-color: black;
}
This CSS rule makes every <p> paragraph have yellow text on a black background. As MDN explains,
CSS “is a declarative language that controls how webpages look” 27 . CSS rules consist of a selector
4
(here, p ) and a declaration block with properties ( color , background-color ) and values.
“Cascading” means multiple CSS rules are applied with priority rules (inline, internal, external styles).
In practice, CSS can be placed in the <head> (using a <style> tag or linked .css file) to style the
HTML. This separation of structure (HTML) and style (CSS) is fundamental to web design. Together,
HTML defines the content and layout, while CSS defines the presentation and appearance of a web page
27 26 .
5
1 Computer - Wikipedia
https://en.wikipedia.org/wiki/Computer
3 4 5 6 Computer Architecture
https://foundationsofcomphw.blogspot.com/2024/11/computer-architecture.html
12 Logic AND Gate Tutorial with Logic AND Gate Truth Table
https://www.electronics-tutorials.ws/logic/logic_2.html
14 Logic NOT Gate Tutorial with Logic NOT Gate Truth Table
https://www.electronics-tutorials.ws/logic/logic_4.html