0% found this document useful (0 votes)
20 views14 pages

Computer Basics and Concepts Explained

The document provides an overview of computer basics, including the main components of a computer system such as hardware, software, and data. It explains the flow of data through input, processing, output, and storage, as well as the importance of computer viruses and protection methods. Additionally, it covers number systems, communication modes, and programming concepts like if statements and control structures.

Uploaded by

moaznaeemjutt
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views14 pages

Computer Basics and Concepts Explained

The document provides an overview of computer basics, including the main components of a computer system such as hardware, software, and data. It explains the flow of data through input, processing, output, and storage, as well as the importance of computer viruses and protection methods. Additionally, it covers number systems, communication modes, and programming concepts like if statements and control structures.

Uploaded by

moaznaeemjutt
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Computer Basics and Concepts (Easy Explanation)

1. Computer Basics and Flowcharts


A computer is a smart electronic machine. It takes data from us (input), works on it
(process), and gives us results (output).
Example: You type 2 + 2 → the computer works → shows 4 on the screen.
Main steps of a computer:
1. Input – We give data to the computer using keyboard or mouse.
2. Process – The CPU works on the data.
3. Output – The computer shows the result on the screen or printer.
4. Storage – It saves data for later use in a hard drive or USB.
Flowchart: A flowchart is a drawing that shows steps of a program or process using special
symbols.
Common symbols:
- Oval → Start or End
- Parallelogram → Input or Output
- Rectangle → Process or Work
- Diamond → Decision (Yes or No)
Example: Start → Input two numbers → Add them → Show the result → End
2. Components of a Computer System
A computer system has several parts that work together. There are three main components:
1. Hardware – Physical parts of the computer that we can touch.
Examples: Keyboard, Monitor, CPU, Mouse, Printer.
Types of hardware:
- Input Devices: Keyboard, Mouse, Scanner.
- Output Devices: Monitor, Printer, Speaker.
- Storage Devices: Hard Disk, USB, CD.
- Processing Devices: CPU, GPU.
2. Software – Programs that tell the computer what to do. We cannot touch them.
Types of software:
- System Software: Runs the computer (like Windows, macOS).
- Application Software: Helps users (like MS Word, Paint, Chrome).
- Utility Software: Helps maintain the system (like Antivirus, File Manager).
3. People (Users) – The person who uses the computer.
4. Data – The information that we enter into the computer.
3. Computer Viruses and Protection
A computer virus is a harmful program that can damage files, steal information, or make the
computer slow.
Types of viruses:
1. Boot Sector Virus – Affects the starting part of the computer.
2. File Virus – Attaches itself to files and spreads when files open.
3. Macro Virus – Affects documents like Word or Excel files.
4. Worm – Spreads automatically through networks.
5. Trojan Horse – Looks safe but harms your computer secretly.
Protection from viruses:
1. Install and update antivirus software.
2. Do not open unknown email links or attachments.
3. Avoid downloading from unsafe websites.
4. Keep your system updated.
5. Take regular backups of your data.
4. Cache Memory and Clock Speed
Cache Memory: It is a small and very fast memory inside the CPU. It stores the data and
instructions that the CPU needs quickly. This helps make the computer faster.
Types of Cache Memory:
1. L1 Cache – Smallest and fastest, built inside the CPU.
2. L2 Cache – Bigger but slower than L1.
3. L3 Cache – Larger and slower, shared between CPU cores.
Clock Speed: Clock speed shows how fast the CPU can do work. It is measured in GHz
(Gigahertz).
Example: 3.0 GHz = 3 billion actions per second.
Higher clock speed means faster performance.
5. Instruction Execution Cycle
1. Fetch: The CPU fetches (gets) the next instruction from memory (RAM). It uses the Program
Counter (PC) to know where the instruction is located. After fetching, the Program Counter
moves to the next instruction.
2. Decode: The CPU decodes (breaks down) the instruction to understand what it means. For
example, it figures out if the instruction is about adding, subtracting, or moving data.
3. Interpret: The CPU interprets (understands) the decoded instruction. It decides what action
needs to be taken, like which numbers to add or where to move data.
4. Execute: The CPU executes(performs) the action. For example: If it’s an addition, the ALU
(Arithmetic Logic Unit) adds the numbers. If it’s moving data, the CPU transfers data from one
place to another.
5. Write-Back: The CPU writes back the result to memory or a register. For example, if the
result of an addition is 8, it saves 8 in a specific location.
6. Example in Simple Words:
Let’s say the computer is adding two numbers (5 + 3):
Fetch: The CPU gets the instruction "Add 5 and 3" from memory.
Decode: The CPU breaks down the instruction and understands it’s about adding.
Interpret: The CPU understands it needs to add the numbers 5 and 3.
Execute: The ALU adds 5 and 3, and the result is 8.
Write-Back: The CPU saves the result (8) in a register or memory.
6. Number Systems
A number system is a way to represent numbers using symbols or digits. It’s like a language for
counting and calculating. Just like we use words to communicate, we use number systems to
work with numbers.
Types of Number System:
• Binary Number System (Base 2):
The binary system uses only two digits: 0 and 1. It’s the language of computers, where each
digit represents an on/off signal, making it perfect for processing data.
Example: The binary number 101 means: 1 is in the fours place (1 × 4 = 4). 0 is in the twos
place (0 × 2 = 0). 1 is in the ones place (1 × 1 = 1). Add them: 4 + 0 + 1 = 5 (in decimal).
• Hexadecimal Number System (Base 16):
The hexadecimal system uses 16 symbols (0-9 and A-F) and is widely used in programming. It
helps represent large binary numbers in a shorter and more readable format.
Example: The hexadecimal number 1F means: 1 is in the sixteens place (1 × 16 = 16). F is in
the ones place (F = 15, so 15 × 1 = 15). Add them: 16 + 15 = 31 (in decimal).
7. Programs and Software
A Program is a set of instructions that tells the computer what to do.
Example: Calculator program adds and subtracts numbers.
Software is a collection of programs that help the user or system.
Types of Software:
1. System Software – Helps the computer run. (Example: Windows, Linux)
2. Application Software – Helps users do specific tasks. (Example: MS Word, Chrome) 3. Utility
Software – Helps maintain and clean the computer. (Example: Antivirus, Disk Cleanup)
8. Operating Systems and Architecture
Computer architecture refers to the design and structure of a computer system. It’s like the
blueprint of how a computer is built and how its parts work together to perform tasks. Think of
it as the "plan" that defines how hardware and software interact to make the computer
function.
• Basic Components of Computer Architecture
1. Input Devices: These are the devices that help you give data or commands to the
computer. Examples include: Keyboard: For typing text. Mouse: For clicking and moving things
on the screen. Scanner: For copying pictures or documents into the computer.
2. CPU (Central Processing Unit): The CPU is the brain of the computer. It performs
calculations, makes decisions, and controls all other parts of the computer. ALU (Arithmetic
Logic Unit): Does math (like adding numbers) and makes decisions (like comparing two
numbers). Control Unit: Manages and coordinates all the activities of the computer.
3. Storage Devices: This is where the computer keeps all your files, programs, and data even
when the power is off. Examples include: Hard Drive: Stores a lot of data permanently. SSD
(Solid State Drive): Faster than a hard drive and stores data permanently.
4. Memory: This is where the computer stores data and instructions. There are two main
types:
RAM (Random Access Memory): Temporary memory that stores data while the computer is
running. It’s fast but loses data when the computer is turned off.
ROM (Read-Only Memory): Permanent memory that stores essential instructions (like the
BIOS) even when the computer is off.
5. Output Devices: These are the devices that show or give you the results of the computer’s
work.
Examples include:
Monitor: Displays text, images, and videos.
Printer: Prints documents or pictures on paper.
Speakers: Play sound or music.
6. Buses: Buses are like roads inside the computer that let data travel between parts.
For example:
• Data moves from the keyboard (input) to the CPU for processing.
• Processed data moves from the CPU to the monitor (output) to show the result. Computer
architecture is all about how a computer is designed and how its parts work together. The
main components are the CPU, memory, input/output devices, storage, and the
motherboard. These parts follow a structured plan (like the Von Neumann architecture) to
process data and perform tasks efficiently.
🔁 1. Simplex Communication
Meaning:
In Simplex, data moves in only one direction — from sender to receiver.
The receiver cannot send anything back.
Example:

• A keyboard sends data to the computer.
The computer doesn’t send anything back to the keyboard. ✅ One-way
communication only.

Easy example to remember:


It’s like a teacher speaking to students — only the teacher talks, students just listen. 2. Half
Duplex
• Communication

Meaning:
In Half Duplex, data can move in both directions, but not at the same time.
Only one side can send at a time — first one speaks, then the other.
Example:

A walkie-talkie:
When you press the button, you can talk.
When you release it, you can listen.
✅ Two-way communication, but one at a time.
Easy example to remember:
It’s like

talking on a walkie-talkie — one person speaks, the other waits.
🔁🔁 3. Full Duplex Communication
Meaning:
In Full Duplex, data can move both ways at the same time.
Both sender and receiver can send and receive together.
Example:

A mobile phone call:
You and your friend can talk and listen at the same time. ✅ Two-
way communication at the same time.
Easy example to remember:
It’s like a normal phone call — both people can speak together.

🧠 Summary Table
Mode of Direction of Data Example Description
Communication
Simplex One way only Keyboard → Only sender can send
Computer data
Half Duplex Both ways, but one Walkie-Talkie One sends, then the
at a time other
Full Duplex Both ways at the Mobile Phone Both can send & receive
same time together
Lab 2: Introduction to Decision Control
Basic Concepts
1. If Statement
The if statement checks the given condition. If the condition evaluates to be true then the block of
code/statements will execute otherwise not.
Syntax:
if ( condition ) {
//code to be executed
}
Exercise 1: draw a flowchart to for above syntax.

Exercise 2: Write a C++ code to implement the above concept.

#include <iostream>
using namespace std;
int main() {
int number = 5;
if(number > 0) {
printf("Number is positive");
}
Return 0;
}
2. If-else Statement
The if statement evaluates the code if the condition is true but what if the condition is not true, here
comes the else statement. It tells the code what to do when the if condition is false.
Syntax:
if(condition)
{
// code if condition is true
}
else
{
// code if condition is false
}
Exercise 3: draw a flowchart to for above syntax.
Exercise 4: Write a C++ code to implement the above concept.

int age = 18;


if(age >= 18) {
printf("You are an adult");
} else {
printf("You are a minor");
}

3. If-else-if ladder Statement


The if-else-if ladder statement executes one condition from multiple statements. The execution starts
from top and checked for each if condition. The statement of if block will be executed which evaluates
to be true. If none of the if condition evaluates to be true then the last else block is evaluated.
Syntax:
if(condition1)
{
// code to be executed if condition1 is true
}
else if(condition2)
{
// code to be executed if condition2 is true
}
else if(condition3)
{
// code to be executed if condition3 is true
}

else
{
// code to be executed if all the conditions are false
}
Exercise 5: draw a flowchart to for above syntax.
Exercise 6: Write a C++ code to implement the above concept.

4. Nested – If Statement
If statement inside an if statement is known as nested if. if statement in this case is the target of
another if or else statement. When more than one condition needs to be true and one of the condition is
the sub-condition of parent condition, nested if can be used.
Syntax:
if (condition1)
{
// code to be executed
// if condition2 is true
if (condition2)
{
// code to be executed
// if condition2 is true
}
}
Exercise 7: draw a flowchart to for above syntax.
Exercise 8: Write a C++ code to implement the above concept.

Lab 1:-
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Basic Organization of a Computer System

Storage Unit

Secondary
Storage

Program Input Output Information


and Unit Unit (Results)
Data Primary
Storage

Control
Unit
Indicates flow of
instructions and data
Arithmetic Indicates the control
Logic Unit exercised by the
control unit
Central Processing Unit (CPU)

Ref. Page 16 Chapter 2: Basic Computer Organization Slide 6/16


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Data Processing

The activity of processing data using a computer is called


data processing
Data

Capture Data

Manipulate Data

Output Results

Information
Data is raw material used as input and information is
processed data obtained as output of data processing

Ref Page 01 Chapter 1: Introduction to Computers Slide 4/17


Number System and Rules (Easy Explanation)
A Number System is a way to represent numbers using symbols or digits. Every
number system has a base (radix) — it tells how many digits are used in that
system.

Main Types of Number Systems


System Name Base Digits Used Example

Binary 2 0, 1 1011

Octal 8 0–7 275

Decimal 10 0–9 562

Hexadecimal 16 0–9, A–F 3A9, FF

1. Binary Number System (Base 2)


Uses only two digits: 0 and 1.
Each position value increases by powers of 2.

Example: (1011)₂ = 1×2³ + 0×2² + 1×2¹ + 1×2⁰ = 11

Rule: Each position from right to left → 2⁰, 2¹, 2², 2³

2. Octal Number System (Base 8)


Uses digits 0 to 7. Each position represents powers of 8.

Example: (275)₈ = 2×8² + 7×8¹ + 5×8⁰ = 189

Rule: Each position from right to left → 8⁰, 8¹, 8², 8³

3. Decimal Number System (Base 10)


Uses digits 0 to 9. This is the system we use in daily life.

Example: (562)₁₀ = 5×10² + 6×10¹ + 2×10⁰ = 562

Rule: Each position → 10⁰, 10¹, 10², etc.

4. Hexadecimal Number System (Base 16)


Uses sixteen symbols: 0–9 and A–F (A=10, B=11, ..., F=15).

Example: (3A)₁₆ = 3×16¹ + 10×16⁰ = 58


Rule: Each position → 16⁰, 16¹, 16²

Conversion Rules Between Number Systems

A. Binary → Decimal
Multiply each bit by 2^(position) and add all.
Example: (101)₂ = 5

B. Decimal → Binary
Divide by 2 → write remainders → reverse them.
Example: (13)₁₀ = (1101)₂

C. Binary ↔ Octal
Group binary digits in 3 bits.
Example: (101011)₂ = (53)₈

D. Binary ↔ Hexadecimal
Group binary digits in 4 bits.
Example: (11011100)₂ = (DC)₁₆

E. Decimal ↔ Hexadecimal
Divide by 16 → take remainders (A–F for 10–15).
Example: (254)₁₀ = (FE)₁₆

Extra Notes
• Base = total symbols allowed.
• Place value = base raised to power of position.
• Binary is used in computers because all data is stored as 0s and 1s (bits).

You might also like