Computer Science
Computer Science
Introduction to Computer: [8 L]
Basic Building blocks, Algorithms, Flowcharts, Pseudo codes, System and Application Software-
concepts & terminologies, Concepts of Machine Language, Assembly Language and High level
languages, Fundamentals of World Wide Web and Internet
A computer system is basically a machine that simplifies complicated tasks. It should maximize
performance and reduce costs as well as power consumption.
Central Processing Unit (CPU):
The CPU is the primary component responsible for executing instructions in a computer
system.
It consists of several subunits, including the Arithmetic Logic Unit (ALU), Control Unit (CU), and
Registers.
The CU manages the execution of instructions by fetching them from memory, decoding them,
and controlling the flow of data between other CPU components.
the ALU and control unit (collectively called a central processing unit or CPU) have typically
been located on a single integrated circuit called a microprocessor.
Registers are small, high-speed memory units used to store data temporarily during
processing.
The control system ties the ALU, I/O systems etc all together. Its job is to read instructions and
data from memory or the I/O devices, decode the instructions, providing the ALU with the
correct inputs according to the instructions, "tell" the ALU what operation to perform on those
inputs, and send the results back to the memory or to the I/O devices. One key component of
the control system is a counter that keeps track of what the address of the current instruction
is; typically, this is incremented each time an instruction is executed, unless the instruction
itself indicates that the next instruction should be at some other location (allowing the
computer to repeatedly execute the same instructions).
Memory:
Random Access Memory (RAM) is volatile memory used for temporary storage. It holds data
and program instructions that are actively being used by the CPU.
Read-Only Memory (ROM) is non-volatile memory used for permanent storage. It typically
stores firmware or BIOS instructions that are essential for booting up the computer.
Cache memory, including L1, L2, and L3 caches, is faster than main memory (RAM) and is used
to temporarily store frequently accessed data and instructions, reducing the time needed to
access them.
I/O devices facilitate communication between the computer and the external world.
Examples include keyboards, mice, monitors, printers, scanners, network adapters, and
storage devices like hard drives and USB flash drives.
Storage Devices:
Hard Disk Drives (HDDs) use spinning disks and magnetic storage to store data.
Solid-State Drives (SSDs) use flash memory and have no moving parts, offering faster access
times and better reliability compared to HDDs.
Optical drives, such as CD-ROMs and DVD-ROMs, use laser technology to read and write data
on optical discs.
USB flash drives provide portable, removable storage using flash memory technology.
Bus:
The bus is a communication system that enables data transfer between various components
within the computer.
It consists of several types of buses, including the address bus, data bus, and control bus.
The address bus carries memory addresses used to identify specific locations in memory.
The data bus carries data between the CPU, memory, and I/O devices.
The control bus carries control signals to coordinate the operation of different components.
Registers:
Registers are small, high-speed storage locations located within the CPU.
They hold data temporarily during processing and are used to store operands, intermediate
results, and memory addresses.
Common types of registers include the program counter (PC), instruction register (IR), and
general-purpose registers (e.g., accumulator, index registers).
It specifies the set of instructions available to the CPU, including arithmetic operations, data
movement, control flow, and I/O operations.
Clock:
The clock generates timing signals that synchronize the operations of various components
within the computer.
It determines the rate at which instructions are executed and the speed at which data is
transferred between components.
Clock speed is measured in Hertz (Hz) and indicates the number of clock cycles per second.
on each clock cycle, the computer fetches instructions and data from its memory. The
instructions are executed, the results are stored, and the next instruction is fetched. This
procedure repeats until a halt instruction is encountered.
1. System Software:
Operating Systems (OS): Examples include Microsoft Windows, macOS, Linux, and
Unix. They manage hardware resources, provide a user interface, and support the
execution of applications.
Device Drivers: These are small programs that enable the operating system to
communicate with hardware devices such as printers, graphics cards, and network
adapters.
Utilities: These tools perform specific tasks such as disk defragmentation, antivirus
scanning, backup and recovery, system monitoring, and system optimization.
2. Application Software:
Multimedia Software: Examples include Adobe Premiere Pro, Apple Final Cut Pro, and
Audacity. These applications are used for editing and creating multimedia content
such as videos, audio tracks, and podcasts.
Educational Software: Examples include Khan Academy, Duolingo, and Rosetta Stone.
These programs are designed to facilitate learning and education through interactive
tutorials, simulations, and exercises.
Entertainment Software: Examples include video games like , Minecraft, and Candy
Crush Saga. These applications provide entertainment and leisure activities for users.
Web Browsers: Examples include Google Chrome, Mozilla Firefox, and Microsoft
Edge. These applications allow users to access and interact with content on the World
Wide Web.
Database Software: Examples include MySQL, Microsoft SQL Server, and Oracle
Database. These systems are used for storing, organizing, and retrieving data
efficiently.
Programming Software: Examples include Visual Studio, Sublime Text, and IntelliJ
IDEA. These tools provide developers with an environment for writing, testing, and
debugging code.
3. Middleware:
Examples include Apache HTTP Server, Microsoft IIS, and Java EE application servers
like Apache Tomcat. These software components facilitate communication and data
management between different applications or between applications and the
operating system.
4. Programming Software - Programs and software are created by coders using different
software tools, known as programming software. Some such programs used for software
development by coders are as given below
There are different ways in which software can be distributed based on various factors. With that said,
here are some common distribution mechanisms for software-
1. Commercial
The commercial distribution of software means providing users with a license to use that particular
software. Since users don’t completely own the software and are only provided a license, they cannot
make any modifications or add features to the software. While the most common type of distribution
mechanism in the past, it is less popular in recent times. Examples include Microsoft Office, Adobe
Creative Cloud, and Autodesk AutoCAD.
2. Open-Source
Examples include the Linux kernel, Apache web server, Mozilla Firefox browser, and
WordPress content management system. These projects are developed
collaboratively by a community of developers, and the source code is freely available
for study, modification, and distribution.
Open-source licenses like the GNU General Public License (GPL) or the MIT License
govern the use and distribution of open-source software, ensuring that it remains
open and accessible to the public.
3. Freeware
Freeware type of software is available to be downloaded from the internet and is completely free of
cost. Freeware is commonly adware, which means it comes with embedded advertising to generate
revenue, which compensates for the software being free of cost. : Examples include CCleaner, 7-Zip,
and Adobe Acrobat Reader.
4. Shareware
Shareware is a variation of software, which is available for download for a limited period of time on a
trial basis. It is aimed at offering a realistic experience to users so that they make the decision to buy
the full version of the software for an unlimited amount of time, based on their experience with the
shareware.: Examples include WinRAR, WinZip, and many early PC games.
• Examples include Microsoft Office, Adobe Photoshop, and proprietary enterprise software
like Oracle Database. The source code of closed-source software is not available to the public, and its
distribution and modification are controlled by the copyright holder.
Users typically obtain closed-source software through a one-time purchase, subscription, or licensing
agreement.
Need of an algorithm:
Optimizes Problem-solving: An algorithm helps us grasp the fundamental concept of
the problem solving as it written in simple English and follows a step-by-step approach to
solve a problem statement.
Measure of Performance: Algorithms are the best way to measure the performance of the
program in all cases, time complexity, space complexity (best cases, worst cases, average
cases).
Resource Allocation: Algorithms are used to determine the best possible way to solve a
problem statement based on the amount of resources used in terms of storage and processing
power. So writing an algorithm can help us determine the resources required to run the
algorithm and accordingly resource allocation can be done.
1. Natural Language: An algorithm can be expressed in a natural language like English. But it is
usually hard to understand and is not the best way to express an algorithm.
2. Flow Charts: Flow charts are another way of expressing an algorithm where we make use
of diagrams to represent the algorithm.
Types of Algorithms
1. Brute Force Algorithm
Brute force algorithms are simple and straightforward solutions that use trial and error to
solve problems.
They are often used to solve problems where no other efficient solution is known. Although
they can be very slow, they are easy to understand and implement.
Divide and conquer algorithms break a complex problem into smaller, simpler sub-problems.
The sub-problems are then solved separately and combined to solve the original problem.
This approach reduces the complexity of the problem and makes it easier to solve.
Dynamic programming algorithms are used to solve problems that can be broken down into
smaller sub-problems.
They use a bottom-up approach, starting with the simplest sub-problems and building up to
the more complex ones.
This approach is used to find the optimal solution to a problem by avoiding redundant
calculations.
4. Greedy Algorithm
Optimization issues are resolved using greedy algorithms. They always choose well and never
turn around.
This strategy is utilized when the answer may be discovered by making a sequence of local
optimal decisions that ultimately result in a globally optimal solution.
5. Backtracking Algorithm
Backtracking algorithms are used to solve problems that involve finding a solution by trying
different options and undoing them if they lead to a dead end.
This approach is used when there is no efficient way to solve the problem and it is necessary
to try all possible solutions.