Olevel Computer Science Notes 2210 PDF
Olevel Computer Science Notes 2210 PDF
Olevel Computer Science Notes 2210 PDF
Input Devices
The devices that allow data and instructions to enter a computer (such as a keyboard, mouse,
scanner) are called input devices. These further include kinds such as:-
Pointing devices
Mouse
Tracker-ball
Touch-sensitive pad
Joystick
Light pen
Text-input devices
Keyboard
Imaging and video input devices
Webcam
Image scanner / 3d Scanner
Barcode reader
Voice Input Device (Microphone)
Sensors:-
Biometric Devices
They allow people to be identified based on unique characteristics. Examples include
fingerprint scans, iris scans, and voice recognition. Biometric devices utilize technology
to capture and process this type of information. Such devices may be found at airports,
government buildings, and law enforcement agencies
Computer Science 2210/10th C Notes/By M Shoaib
2
Output Devices
An output device is any piece of computer hardware equipment used to communicate the results
of data processing carried out by an information processing system (such as a computer) which
converts the electronically generated information into human-readable form.
Computer Monitor
LCD
LED
Plasma screen
Printers
Inkjet Printer
LaserJet Printer
Dot-matrix Printer
3d Printer
Audio Output Devices
Speakers
Headphones
Projectors
DLP
LCD
Plotter: Plotters are a specialist type of printer which is able to draw high quality images on
very large pieces of paper, for example 3 foot wide by 10 foot long.
LEDs (Indication lights)
Operating Systems
The operating system (OS) is a program that, after being initially loaded into the computer by a boot
program, manages all the other programs/applications. On a PC, the first program that runs is stored
on a ROM chip. This program checks the system hardware to make sure everything is functioning
normally. This checks the CPU, memory and basic input-output systems (bios) for errors. If all is
satisfactory, the BIOS will activate the disk drives. When the hard drive is activated, the OS is found
in the boot and is then loaded.
The following is a list of functions carried out by various operating systems:
provides a user interface
device management (input/output control)
security (e.g. log on, passwords, etc.)
handles interrupts
spooling
memory management
multitasking
batch processing
multiprogramming
error reporting and handling
loading and running software
processor management
maintain user accounts
utilities (such as copy, save, re-name, etc.)
Computer Memory
There are two main types of Memory:-
Interrupts
In systems programming, an interrupt is a signal to the processor emitted by hardware or software
indicating an event that needs immediate attention. An interrupt alerts the processor to a high-priority
condition requiring the interruption of the current code the processor is executing, the current thread.
Hardware Interrupt: It is an electronic alerting signal sent to the processor from an external
device, either a part of the computer itself such as a disk controller or an external peripheral.
Software Interrupt:Software is also allowed to issue interrupts to the CPU. For example
software has detected that an error has occurred and will issue a software interrupt for the
CPU to run some instructions to try to clear the error.
Computer Security
How to keep data safe from physical damages?
Keep doors and windows locked.
Don‟t leave a spare house key outside.
Be careful about who you let into your home.
Keep private paper records such as passports, bank statements and National Insurance
number, under lock and key if possible.
Fit a burglar alarm.
Do not advertise the presence of computer equipment by leaving it on view through windows
and glass doors.
Consider using a computer locking cable to make it harder to steal.
Consult with your insurance company or local crime prevention officer for additional security
advice.
Make a copy of your data (Backup Copy)
Computer Science 2210/10th C Notes/By M Shoaib
7
Check digit
A check digit is a form of redundancy check used for error detection on identification numbers
(e.g. bank account numbers) which have been input manually.
It is analogous to a binary parity bit used to check for errors in computer-generated data. It
consists of a single digit (sometimes more than one) computed by an algorithm from the other
digits (or letters) in the sequence input.
Proxy server
A 'proxy' is a word meaning substitute or stand-in.
A proxy server reduces the bandwidth required for internet access. It does this by keeping a
copy of often-used web pages in its local 'cache'.
SSL
A network term. It stands for Transmission Control Protocol.
It is important because it is one half of the network protocol used to control data on the
Internet. The other half is IP.
TCP is responsible for checking that data has been delivered correctly from your computer (the
client) to another computer (the server). If data is lost, then TCP requests that the data is re-
sent.
Browsing Web
Web Browser: A web browser is a software application that provides a way to view and interact with
pages on the World Wide Web.
Web Server / Remote Server: The term web server can refer to either the hardware (the computer)
or the software (the computer application) that helps to deliver web content that can be accessed
through the Internet.
Network Protocols: An agreed-upon format for transmitting data between two devices.
Hypertext Transfer Protocol: HTTP is the set of rules that are used for transmitting files, (text,
graphics, sound, video etc) over the World Wide Web.
Hypertext Markup Language: It is the language used to create documents on the World Wide Web.
IP Address: The IP address is the unique address given to a computer running on a TCP/IP network.
It allows one computer to commmunicate with another one by sending data packets containing the
destination IP address.
Packets Switching: When data e.g. web pages, emails, instant messages etc are sent across the
internet, they are not sent as one big file. Instead, the file is broken up into lots of parts called
'packets'. The packets are reassembled when they arrive at their destination.
Errors are localized. If a packet becomes damaged, only that packet must be re-sent.
Multiplexing: several users, or several connections for the same user, can share the same line.
In Packet Switching, it takes more time to transfer the data when it comes to the recipient, In
case of real time video transfer. In other cases this problem is insignificant.
There are variable delays in receiving packets.
File Formats
Video File Formats:-
FLV: The Flash Video format is a video format defined by Adobe Systems. Flash Video is the
standard video format used by nearly all embedded video on the Internet including the videos found
on YouTube, Google Video, and many more websites.
AVI: It stores data that can be encoded in a number of different codec‟s and can contain both audio
and video data. The AVI format usually uses less compression than some similar formats and is a
very popular format amongst internet users.
MP4: This format is mostly used to store audio and visual streams online, most commonly those
defined by MPEG. The MPEG-4 video format uses separate compression for audio and video tracks;
video is compressed with MPEG-4 video encoding; audio is compressed using AAC compression, the
same type of audio compression used in .AAC files.
MPG: Common video format standardized by the Moving Picture Experts Group (MPEG); typically
incorporates MPEG-1 or MPEG-2 audio and video compression; often used for creating
downloadable movies. They are used in VCDs and can be played on DVD players via USB.
WMV: WMV format, short for Windows Media Video was developed by Microsoft. It was originally
designed for internet streaming applications, and can now cater to more specialized content.
3GP: The 3gp format is both an audio and video format that was designed as a multimedia format for
transmitting audio and video files between 3G cell phones and the internet. It is most commonly used
to capture video from your cell phone and place it online. It is commonly used to be played on small
screened mobile phone. It has a low size as well as low quality but works perfectly on Mobile Phones.
VOB: It is the container format in DVD-Video media. VOB can contain digital video, digital audio,
subtitles, DVD menus and navigation contents multiplexed together into a stream form. Files in VOB
format may be encrypted.
MP3: It is the standard format for compressing a sound sequence into a very small file, up to 12 times
smaller. The good thing about MP3 is that there is no or very little loss of sound quality from the
original file.
AAC: It is a standardized, lossy compression and encoding scheme for digital audio. Designed to be
the successor of the MP3 format, AAC generally achieves better sound quality than MP3 at similar bit
rates.
WAV: WAV files are popular because they are considered a “first generation” format. That is, they are
generally kept as the first digital copy of a file completely uncompressed. This means that WAV files
are the best possible quality and have not gone through any digital alterations except to be outputted.
JPG/JPEG
BMP
PNG
GIF
TIF
JPG: It is a lossy compression method; JPEG-compressed images are usually stored in the JFIF file
format.
BMP: The BMP file format is capable of storing 2D digital images of arbitrary width, height, and
resolution, both colorless and color, in various color depths, and optionally with data compression,
alpha channels, and color profiles.
PNG: This file format was created as the free, open-source successor to GIF. It is lossless and may
contain animation.
GIF: It is suitable for storing graphics with relatively few colors such as simple diagrams, shapes,
logos and cartoon style images. The GIF format supports animation and is still widely used to provide
image animation effects. It also uses a lossless compression.
TIFF: It is a lossless type of format that is used to contain very heavy images, of larger size. It is a
format that offers very huge size of images to be printed, such as flexes.
There are two types of compression. 'Lossy' and 'Lossless'. The lossless method compresses
the image without effectively losing any detail at all. The TIF file format is a lossless format and
is an excellent choice for long term storage of images.
A 'lossy' format actually discards some of the image detail in order to get even more
compression but it does so very cleverly so that a person hardly notices the loss of quality. A
very popular lossy method is the JPEG image format.
The new idea was that not only should the data be stored in memory, but that the program
processing that data should also be stored in the same memory.
This novel idea meant that a computer built with this architecture would be much easier to re-
program. Effectively the program itself is treated as data.
This 'stored-program' architecture is now commonly known as the 'Von Neumann'
architecture.
Its Features
Memory
The computer will have memory that can hold both data and also the program processing that
data. In modern computers this memory is RAM.
Control Unit
The control unit will manage the process of moving data and program into and out of memory
and also deal with carrying out (executing) program instructions - one at a time. This includes
the idea of a 'register' to hold intermediate values.
The 'one-at-a-time' phrase means that the von neumann architecture is a sequential
processing machine.
Input - Output
This architecture allows for the idea that a person needs to interact with the machine.
Whatever values that are passed to and forth are stored once again in some internal registers.
This part of the architecture is solely involved with carrying out calculations upon the data. All
the usual Add, Multiply, Divide and Subtract calculations will be available but also data
comparisons such as 'Greater Than', 'Less Than', 'Equal To' will be available.
Bus
Notice the arrows between components? This implies that information should flow between
various parts of the computer. In a modern computer built to the Von Neumann architecture,
information passes back and forth along a 'bus'. There are buses to identify locations in
memory - an 'address bus'.
And there are buses to allow the flow of data and program instructions - a 'data bus'.
Register: A register is a separate memory location within the CPU designed to hold temporary data
and instructions. There are many types of registers:-
Program Counter (PC): This holds the address in memory of the next instruction.
Current Instruction Register (CIR): A register, usually in the control unit, that contains the
information specifying the instruction that is being (or is about to be) performed.
Program Status Word (PSW): The PSW has a number of duties all rolled into one:-
The Arithmetic Logic Unit compares two data items together, and it arranges for the
result of that comparison to appear in this register i.e. the result of 'greater than' etc.
The PSW also indicates if program conditions have been met that would lead to a jump
to a different part of the program. In programming terms this means the result of an IF
statement. An IF statement is important in any programming language as it allows
execution to jump from one set of instructions to another.
The PSW also holds error flags that indicate a number of problems that may have
happened as a result of an instruction, such as 'overflow' which means a calculation has
exceeded it allowed number range.
Memory Address Register (MAR): The memory address register, or MAR, holds the location
in memory (address) of the next piece of data or program to be fetched (or stored).
Memory Buffer Register (MBR): When data, instruction is fetched from memory, it is
temporarily held in MBR.
Problem 1: Every piece of data and instruction has to pass across the data bus in order to move from
main memory into the CPU (and back again). This is a problem because the data bus is a lot slower
than the rate at which the CPU can carry out instructions. This is called the 'Von Neumann
bottleneck'. If nothing were done, the CPU would spend most of its time waiting around for
instructions.
Problem 2: Both data and programs share the same memory space. This is a problem because it is
quite easy for a poorly written or faulty piece of code to write data into an area holding other
instructions, so trashing that program.
Problem 3: Another issue is that the rate at which data needs to be fetched and the rate at which
instructions need to be fetched are often very different. And yet they share the same bottlenecked
data bus.
Fetch-execute Cycle
Step 2: Decode: The instruction gets interpreted/decoded, signals produced to control other internal
components (ALU for example).
Programming Languages
Machine Code: Another description of Machine code is 'object code'.
1010010110111010
1001110110000111
0001110010110001
• These instructions are stored in memory locations called 'Registers' within the CPU. Different
CPUs have a different set of registers.
• The raw instructions that the CPU carries out is called 'machine code' and each CPU family
has a different set of machine code.
Low Level Languages: Low level languages are near to the hardware but away from humans. Low
level languages have the advantage of providing very close control of the CPU but the code is still
quite difficult to read and follow by other programmers.
High Level Languages: High Level Languages are near to humans but away from hardware. They
are easy to understand for the programmers but they do not offer such a close control of the
hardware as the Low Level Languages do!
High level languages are fairly close to normal written language. But this means that they are
nowhere close to machine language! So an application is needed to convert the fairly abstract high
level language into a precise set of machine codes that the CPU can actually run. This application is
called the ‘translator’.
A translator converts high level commands into a set of machine codes. One high level command can
translate into many individual machine instructions. There are mainly 3 kinds of translators:
Interpreter Compiler
Scans the entire program and translates it as a
Translates program one statement at a time.
whole into machine code.
It takes less amount of time to analyze the It takes large amount of time to analyze the
source code but the overall execution time is source code but the overall execution time is
slower. comparatively faster.
Generates intermediate object code which
No intermediate object code is generated,
further requires linking, hence requires more
hence are memory efficient.
memory.
Computer Science 2210/10th C Notes/By M Shoaib
17
Continues translating the program until the first It generates the error message only after
error is met, in which case it stops. Hence scanning the whole program. Hence debugging
debugging is easy. is comparatively hard.
IDE - Integrated Development Environment: The IDE brings together the tools you need into one
application so that you can efficiently and easily go through this process. An IDE brings together :-
Flowcharts
Common flowchart symbols:-
Pseudo Code