Introduction To Computer
Introduction To Computer
TO
COMPUTER
Mohammed Hamdaan
31/12/2022
WHAT IS A COMPUTER?
A Computer is an electronic machine or device that performs calculations
and operations on input data based on instructions provided by a software
or a hardware program
It has the ability to accept data, process it, and then it produces an output
It has the ability to store, retrieve, and delete data
You can use a computer to create documents, send email, watch movies,
develop Software programs, develop building plans, browse the Web
INPUT, PROCESS AND OUTPUT
All the parts in a computer can be divided in 2 groups which are
output and input
A computer receives an input, processes the
information(program + input data), then produces an output
Input: Input is the information or data that is fed into the
computer via an input device such as a Keyboard, IO port,
camera, mouse, scanner
Input captures the data from user, or it is the process of
accepting data or information, by using input the computer can
do any process
Process: It is the program that processes the input data to
produce a desired output
Output: This is the info that comes out of the computer as a
result from processing. The output is displayed on a screen
(monitor) or passed on to an output device such as a Printer
WHAT IS A HARDWARE AND A SOFTWARE?
Computer hardware
Hardware is the physical components of the computer, such
as the central processing unit (CPU), hard disk, monitor,
mouse and keyboard
It also includes all the parts inside the computer case, such as
the hard disk drive, motherboard, video card, and many others
Computer hardware is what you can physically touch
Computer software
Software is the programs that run on a computer.
Computer software, also called software, is a set of
instructions and its related documentations that tells a
computer what to do or how to perform a task
Software includes all different software programs on a
computer, such as applications(MS Office, Paint, Anti virus)
and the operating system (Windows, Apple OS, MAC OS,
Linux, Solaris, Android)
INPUT, PROCESS AND OUTPUT
Input Devices Processing device Output Devices
Keyboard Monitor
Scanner Printer
Mouse
CPU Headphone
Microphone Speaker
Camera Headset
WHAT IS AN OPERATING SYSTEM?
An operating system is an interface between the user and the computer hardware
An operating system is a software that manages computer hardware
Operating system is the one program running at all times on the computer
An operating system is concerned with the allocation of resources and services, such as
memory, processors, devices, and information.
An operating system (OS) is system software that manages computer hardware, software
resources, and provides common services for computer programs
Examples of OS devices are: Window 7, Windows 8, Windows 10, Android, IOS, MacOS, Disk
operating systems (DOS) Windows XP
WHAT ARE THE IMPORTANT PARTS OF A COMPUTER?
The 5 Most Important Parts of A Computer are:
• The Motherboard.
• The Central Processing Unit (CPU)
• RAM & ROM
The Motherboard-
The motherboard is the backbone that ties the computer's components
together in one spot and allows them to talk to each other. Without it,
none of the computer pieces, such as the CPU, GPU, or hard drive, could
interact. Total motherboard functionality is necessary for a computer to
work well.
ALU (arithmetic & logic Unit)-
The ALU performs simple addition, subtraction, multiplication, division,
and logic operations, such as OR and AND. The memory stores the
program's instructions and data.
WHAT ARE THE IMPORTANT PARTS OF A COMPUTER?
The CPU-
The computer's central processing unit (CPU) is the portion of a
computer that retrieves and executes instructions. The CPU is
essentially the brain of a CAD system. It consists of an arithmetic and
logic unit (ALU), a control unit, and various registers. The CPU is often
simply referred to as the processor.
Minicomputers
Minicomputers are small Computers that are more powerful
compared to personal computers, but they are less powerful if
we compare them with mainframe or supercomputers
The minicomputer is designed to fulfil the computing needs of
several people in a small to a medium-sized business
environment
The first minicomputer was developed by IBM
Supercomputers
Supercomputers are the computers that are most powerful in
the world and are primarily used for complex scientific
calculations
These computers are capable of processing trillions of
instructions per second Mini computer
TYPES OF COMPUTERS CONTINUED
Microcomputer
A microcomputer was created in January 1971 by a team of logic
architects and silicon engineers—Federico, Marcian (Ted) Hoff, Supercomputers
Stanley Mazor, and Masatoshi
A small personal computer with a microprocessor as a central
processor is an example of a microcomputer
Microcomputer, an electronic device with a microprocessor as
its central processing unit (CPU)
Microcomputer was formerly a commonly used term for personal
computer, particularly any of a class of small digital computers
Microcomputer
WHAT IS THE INSTRUCTION CYCLE?
The main job of the CPU is to execute programs using the fetch-decode-execute cycle (also
known as the instruction cycle).
This cycle begins as soon as you turn on a computer.
To execute a program, the program code is copied from secondary storage into the main
memory.
All computer software is built up of sets of instructions.
Instructions are encoded in binary.
The fetch-decode-execute cycle is the sequence of steps that the CPU follows to process
instructions.
WHAT IS BIOS?
BIOS (basic input/output system) is the program a computer's microprocessor uses to start
the computer system after it is powered ON
BIOS is the first program to run when the computer is turned ON
It also manages data flow between the computer's operating system (OS) and attached
devices, such as the hard disk, video adapter, keyboard, mouse and printer
The BIOS is a computer program embedded on a chip in a computer’s ROM
Normally the BIOS chip is located in the ROM but in the modern computer systems, the BIOS
contents are stored on a flash memory chip so that the contents can be rewritten without
removing the chip from the motherboard.
The BIOS software has a number of different roles, but its most important role is to load the
operating system
When users turn on their computer, the microprocessor passes control to the BIOS program,
which is always located at the same place on EPROM
COMPUTER SCIENCE
Computer science is a very large subject with lots of applications. Computer Science is the
study of computers and computational systems. Computer scientists design new software,
solve computing problems and develop different ways to use technology. Computer
scientists deal mostly with software and software systems; this includes their theory,
design, development and application.
Future innovations
Technology advances constantly and people are always working on new and
inventive ways to use it. These include hardware innovations like wearable
technology such as smart watches, new interface methods and new
software such as voice recognition, machine translation and predictive analytics.
Being able to think logically and come up with solutions to problems are useful
skills in all professions.
STORAGE IN A COMPUTER
1 byte = 8 bits
KB = Kilobyte = 1000 bytes
MG = Megabyte = 1,000,000 bytes
GB = Gigabyte = 1,000,000,000 bytes
TB = Terabyte = 1,000,000,000,000 bytes
RAM cards (Random Access Memory) will remember
whatever is said to them and can even change to
remember new information. But, when the computer is
turned off it forgets everything. That’s why you need to
save your work.
ROM (Read-Only Memory) is good at remembering
things, but cannot change its mind. It holds information
that was built into it.
COMPUTER MEMORY
Memory is an essential element of a computer. Without its memory, a computer is of hardly any use.
Memory plays an important role in saving and retrieving data. Memory is of the following types -
Primary Memory and Secondary Memory.
Primary Memory:
Primary Memory is an internal memory of the computer. RAM and ROM both form a part of primary
memory. The primary memory provides the main working space for the computer.
PROM:
There is another type of primary memory in computer, which is called Programmable Read Only
Memory (PROM).
COMPUTER MEMORY CONTINUED
PROM continued:
You know that it is not possible to modify or erase programs stored in ROM, but you can store your
program in a PROM chip. Once the programs are written they cannot be changed and remain intact
even if the power is switched off. Therefore, programs or instructions are written in PROM or ROM
cannot be erased or changed.
Step 2:
Now multiply each digit in the binary number starting from the right with its respective weight based on its position and
evaluate the product. Observe the figure shown below to relate to the step. Finally, sum up all the products obtained for
all the digits in the binary number
Step 3:
Now, express the binary number as a decimal number: (101101)2(101101)2 = (45)10
HOW TO CONVERT A BINARY CODE TO A DECIMAL USING THE
DOUBLING METHOD
Step 1:
Write the binary number and start from the left-most digit. Double
the previous number and add the current digit. Since we are starting
from the left-most digit and there is no previous digit to the left-most
digit, we consider the double of the previous digit as 0. For example
in (101101)2(101101)2, the left-most digit is '1'. The double of the
previous number is 0. Therefore, we get ((0 × 2) + 1) which is 1
Step 2:
Continue the same process for the next digit also. The second digit
from the left is 0. Now, double the previous digit and add it with the
current digit. Therefore, we get, [(1 × 2) + 0], which is 2
Step 3:
Continue the same step in sequence for all the digits. The sum that is
achieved in the last step is the actual decimal value. Therefore, the
result of converting the binary number (101101)2(101101)2 to a
decimal using the doubling method is 4510
BINARY CODE DECIMAL NUMERS Hexa Decimal BINARY CODE DECIMAL NUMERS Hexa Decimal BINARY CODE DECIMAL NUMERS Hexa Decimal
Pseudo-code
Pseudo-code is a simple way of describing a set of instructions in a manner that resembles a programming language. In an
algorithm, most processes fall into three main categories:
• Inputs
• Processes
• Outputs
When pseudo-code is being written, inputs, processes and outputs can be identified using the keywords in the code.
For example, if a person was writing a program where a number is input and the program calculates and outputs the times table
up to ten, they could write a statement like this:
The user INPUTS a number which is saved as num FOR each number from 1 to 10, OUTPUT
num*number
This could be improved by writing the pseudocode:
num ← USERINPUT FOR number ← 1 TO 10 OUTPUT number * num ENDFOR
Factors of an Algorithm
• Modularity: This feature was perfectly designed for the algorithm if you are given a problem and break it down into
small-small modules or small-small steps, which is a basic definition of an algorithm.
• Correctness: An algorithm's correctness is defined as when the given inputs produce the desired output, indicating
that the algorithm was designed correctly. An algorithm's analysis has been completed correctly.
• Maintainability: It means that the algorithm should be designed in a straightforward, structured way so that when you
redefine the algorithm, no significant changes are made to the algorithm.
• Functionality: It takes into account various logical steps to solve a real-world problem.
• Robustness: Robustness refers to an algorithm's ability to define your problem clearly.
• User-friendly: If the algorithm is difficult to understand, the designer will not explain it to the programmer.
• Simplicity: If an algorithm is simple, it is simple to understand.
• Extensibility: Your algorithm should be extensible if another algorithm designer or programmer wants to use it.
Approaches of an Algorithm
Brute Force Algorithm
This algorithm uses the general logic structure to design an algorithm. It is also called an exhaustive search algorithm
because it exhausts all possibilities to provide the required solution. There are two kinds of such algorithms:
[Link]: Finding all possible solutions to a problem and then selecting the best one, will terminate if the best
solution is known.
[Link]: It will stop as soon as the best solution is found.
Greedy Algorithm
This is an algorithm paradigm that makes the best choice possible on each iteration in the hopes of choosing the best
solution. It is simple to set up and has a shorter execution time. However, there are very few cases where it is the best
solution.
Approaches of an Algorithm
Dynamic Programming
It improves the efficiency of the algorithm by storing intermediate results. It goes through five steps to find the best
solution to the problem:
1. It divides the problem into subproblems to find the best solution.
2. After breaking down the problem into subproblems, it finds the best solution from these subproblems.
3. Memorization is the process of storing the results of subproblems.
4. Reuse the result to prevent it from being recomputed for the same subproblems.
5. Finally, it computes the complex program's output.
Branch and Bound Algorithm
Only integer programming problems can be solved using the branch and bound algorithm. This method divides all
feasible solution sets into smaller subsets. These subsets are then evaluated further to find the best solution.
Randomized Algorithm
As with a standard algorithm, you have predefined input and output. Deterministic algorithms have a defined set of
information and required results and follow some described steps. They are more efficient than non-deterministic
algorithms.
Backtracking
It is an algorithmic procedure that recursively and discards the solution if it does not satisfy the constraints of the
problem. Following your understanding of what is an algorith, and its approaches, you will now look at algorithm
analysis.
Basis of algorithms
How to Write an Algorithm?
There are no well-defined standards for writing algorithms. It is, however, a problem that is resource-dependent.
Algorithms are never written with a specific programming language in mind. For Example:
Step 1 − Start
Step 2 − declare three integers x, y & z
Step 3 − define values of x & y
Step 4 − multiply values of x & y
Step 5 − store result of step 4 to z
Step 6 − print z
Step 7 − Stop
Fundamentals of algorithms
The ← symbol in pseudo-code means assignment. Most programming languages use = instead of ←. In the example above, num ←
USERINPUT means that the user input is being put into, or assigned to, the variable called num.
Outputs use the word OUTPUT before the data to be sent to the user. In the example above, the line OUTPUT number * num in
Python might look like print (number * num). Processing refers to any operation the computer system is performing on data, for
example doing a calculation or searching for something. In OUTPUT number * num, the program is actually performing a
calculation within the output, so it is possible to see statements which combine one or more of these.
Fundamentals of algorithms
Flowcharts
A flowchart is a diagram that shows an overview of an algorithm. Flowcharts use a variety of standard symbols to represent
different elements, and arrows to show the flow or direction. These symbols are used to construct the flowchart and show the
step-by-step solution to the problem.
Fundamentals of algorithms
Start
Input
“What is the
best subject”?
Yes
Output
“Yes, Stop
Offcourse!
Fundamentals of algorithms
Start
Input
2 numbers (a,b)
No
If a>b Output – “b is
the greatest”
Yes
Output
“A is the
greatest” Stop
Fundamentals of algorithms
Start
Input two
numbers (a, b)
Sum= a+b
Input a Yes
If a>0 A is greater than 0
number (a)
No
Yes
If a=0 A is equal to 0
No
num ← USERINPUT
FOR number ← 1 TO 10
OUTPUT number * num
ENDFOR
In larger programs, problems are decomposed further until it is easy to identify how each could be written as an
individual subroutine in the program. This is useful to a development team, for example, as it means that the work can be
divided between them. As the problem has been broken down into smaller sections, the subroutines can be reused to solve
similar problems.
Decomposition is breaking a problem down into smaller, more manageable chunks.
Fundamentals of algorithms
Determining the purpose of simple algorithms
When given an algorithm, there are a number of ways to determine what the purpose of the algorithm is. Sometimes it is clear
as the algorithm is simple; however, at other times it is useful to ‘dry run’ the algorithm to see what is taking place.
Dry running an algorithm means to assign the values to variables of an algorithm and to do any processing that takes place
without translating it into code.
Trace tables
Trace tables enable the variable values in an algorithm to be recorded as the algorithm is dry run. For example, using the times
table algorithm below, a table could be created showing the value of the variables num and number as the program runs:
num ← USERINPUT FOR number ← 1 TO 10 OUTPUT number * num ENDFOR
Visual inspection
Some algorithms follow a pattern that can be recognised. Many of these are referred to as standard algorithms and often follow
a set pattern for searching for or sorting data. Sometimes it is clear what this is just by looking at the pseudo-code. For example,
the algorithm below follows a recognisable pattern for searching through each letter of a word and checking if the letter entered
matches. This would be a useful decomposed part of a hangman game.
guess ← USERINPUT FOR i ← 0 TO LEN(word) IF word[i] = guess THEN OUTPUT “found” ENDIF
ENDFOR
Fundamentals of algorithms
Efficiency of algorithms
Not all algorithms are made equal and it is a computer scientist’s job to consider the patterns and features that would find the
best solutions to problems.
For example, sorting data into alphabetical order could be completed using a number of different methods. The programmer
could choose to use bubble sort or merge sort, which are both standard sorting algorithms - but before choosing, it would be
important to know which would be most efficient. You can read more about sorting algorithms in the common algorithms guide.
Efficiency looks at how much time it takes to run a particular algorithm and how much space is needed. By using both
measurements, an algorithm that looks much more complex can actually be more efficient.
In the example of sorting data, the programmer might choose to look for the smallest piece of data and put that at the start of a
new array, then repeat the process until all the data has been removed from the original array. This would certainly solve the
problem, but there are better ways to reach the goal. These would be described as being more efficient.
Efficiency looks at how much time it takes to run a particular algorithm and how much space is needed.
Fundamentals of data representation
Character encoding
Computers work in binary. As a result, all characters, whether they are
letters, punctuation or digits are stored as binary numbers. All of the
characters that a computer can use are called a character set.
Two standard character sets in common use are: Hexadecima
Character Decimal Binary
• American Standard Code for Information Interchange (ASCII) l
• Unicode A 65 1000001 41
Representing images
Computers work in binary. All data must be converted into binary in order for a computer to process it. Images are no exception.
Important information
•Problem: A problem can be defined as a real-world problem or real-world instance problem for which you need to
develop a program or set of instructions. An algorithm is a set of instructions.
•Algorithm: An algorithm is defined as a step-by-step process that will be designed for a problem.
•Input: After designing an algorithm, the algorithm is given the necessary and desired inputs.
•Processing unit: The input will be passed to the processing unit, producing the desired output.
•Output: The outcome or result of the program is referred to as the output.
The internet
The internet is simply a network of networks all connected together. This allows us to access information on other computer
systems, sometimes thousands of miles away.
Most of the information we access is displayed through webpages on the World Wide Web.
Wired vs. wireless
A wired connection uses a physical wire to send data. In a school or office, these are normally hidden away, with many
access points built into walls. This has many advantages:
• The wired connection is normally more secure
• The wired connection speed is normally faster
Wired connections make use of different wires, each having different data transfer speeds. The options are:
• Fibre optic and Copper wire
However, there are disadvantages to wired connections, including:
• This could leave many wires trailing round an office
• If the wires are damaged they need to be replaced
• A very large amount of cabling and network hubs may be needed in large premises
A wireless connection can connect devices without any wires needed between them. This has several advantages, such
as:
• There are no wires causing clutter or hazards (i.e. tripping over wires)
• A connection can be made anywhere within the range of the device
However, there are disadvantages, including:
• If the connection is unsecured, other users could access it
• There can be interference with the wireless signal from other devices
Cyber security threats
Not all online content can be trusted. When using the internet, it is important to understand the threats that may occur.
Technology is rapidly evolving and as a result, the way that criminals are using the internet is also changing.
There are a number of different threats to computer systems that include:
• social engineering
• malicious code
• human error
Any risk posed to a computer system from an internet source is considered a cyber threat. These threats are often combined to
increase the probability of harm to a system. By taking steps to understand what the potential risks are, people and businesses
are able to better protect their systems and data.
Social engineering techniques
Social engineering is manipulating people into handing over confidential information
such as a PIN or password. There are several forms:
o blagging
o phishing
o pharming
o Shouldering
Blagging
Blagging is when someone makes up a story to gain a person’s interest and uses this to
encourage them to give away information about themselves, or even send money.
For example, a person may receive an email that appears to be from a friend telling them
that they’re in trouble and asking them to send money.
Shouldering
This is the simplest form of taking personal details. Shouldering is looking at someone’s
information over their shoulder, for example looking at someone enter their PIN in a
shop or at a cashpoint.
A person can prevent this by using their hand to cover the keypad as they type their PIN,
or being aware of people around them when typing in PINs. Software helps protect
against shouldering by masking what is typed, showing an asterisk on the screen instead
of the symbol that was entered.
Social engineering techniques
Phishing
Similar to blagging, a phishing email will ask a person to send personal details, but
pretends to be from a business. They can often look convincing, but may contain
spelling errors or URLs that do not match the business's website.
When a person clicks on these links and logs in, it sends their username and password
to someone who will use it to access their real accounts. This information might be
used to steal a person’s money or identity, or the email may contain malware.
Banks will never send emails asking for personal information or usernames and
passwords. If someone receives an email that they think might be phishing, they
should report it to the business the sender is claiming to be.
Pharming
Pharming is a type of cyberattack that redirects a user from a genuine website to a
fake one. The fake website will often look like the genuine one. When a person logs in,
it sends their username and password to someone who will use it to access their real
accounts.
There are several ways that a pharming cyberattack can redirect traffic from a genuine
website to a fake one. One example is if the Domain Name Servers (DNS) of the
website, which match the website address with the IP address of the webserver,
are hacked and the IP address is changed to become the address of the pharming site.
Malicious code
Malicious code is software written to harm or cause issues with a computer. This is also referred to as malware and comes in a
number of different forms. In all its forms, the code has been written to either harm or steal data from your computer system.
There are a number of types of malware, which include:
❑ viruses
❑ trojans
❑ ransomware
❑ spyware
❑ Adware
Viruses
A virus is a piece of malware that infects a computer, and then replicates itself to be passed onto another computer.
Anti-virus software holds a large database of known viruses. If a program that is installing, or file that is being opened, appears
to be similar to one of these, the anti-virus software will warn the user and, depending on the type of anti-virus, place all related
files into a secure folder until it is confirmed that it is safe.
Trojans
A Trojan appears to be a piece of harmless software, often given away for free, that contains malicious code hidden inside. This
only appears once the gifted software is installed. It was named after the Greek myth of the Trojan horse.
Malicious code
Ransomware
Ransomware hijacks the data on a computer system by encrypting it and demanding that the owners pay money for it to be
decrypted.
Having up-to-date anti-virus software and educating users to not open suspicious attachments will help protect from
ransomware.
Spyware
Spyware is a type of malware that collects the activity on a computer system and sends the data it collects to another person
without the owner being aware.
If a computer has been infected by spyware, it could be sending back everything that is typed, or the sites that are visited, or
even where the user is clicking on their screen. Spyware that records what is being typed is known as a keylogger. Keyloggers
attempt to find out usernames and passwords by collecting everything that is entered into the system, which allows the hacker
to search for personal data.
Most anti-virus software will also look for spyware in the same way as viruses. Specialist anti-spyware software is also available.
Adware
Adware is software that either causes pop-ups or windows that will not close. Generally, the pop-ups or windows display
advertisements. Many anti-virus programs will detect and prevent adware infecting a computer system, but specialist anti-
adware programs also exist.