0% found this document useful (0 votes)
6 views

Computing 2

The document provides an overview of computer architecture, including key components such as processors, memory, and storage devices. It explains data types, programming concepts, and the differences between compilers and interpreters. Additionally, it covers algorithms, flowcharts, and the basics of programming languages and variables.

Uploaded by

kaydenlee.chat
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)
6 views

Computing 2

The document provides an overview of computer architecture, including key components such as processors, memory, and storage devices. It explains data types, programming concepts, and the differences between compilers and interpreters. Additionally, it covers algorithms, flowcharts, and the basics of programming languages and variables.

Uploaded by

kaydenlee.chat
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
You are on page 1/ 12

How

computers work
to
Computer -
Device that can receive data process the data
,
according a set of instructions and produce processed data as a

result Processor - Processes data and follows instructions

How a to function Control Arithmetic


computer architecture computer is
designed and built unit+
logic unit
-

Data -

Information used in a
computer program
6 Part of the
processor that follows instructions

Bit decides when data should be stored ,


-
A
binary digit that can take the value of O or 1 . and received

Byte-Binary number made


up
of
eight bits .
or transmitted by different parts of the

Name of unit
Symbol Size in
bytes computer .

Kiss
Kilobyte KD 1000 2 Part of the that data
processor processes by
Kibibyte kiB 1024
performing basic mathematical and logical
Megabyte MB 10002 operations
my

o
Mebibyte MiB
Memory
-
Stores data ,
instructions and the results

Gundu Gigabyte GB of
processing
for immediate
usage .

Gi B RAM (Random Access


Gibibyte 10244 Memory) >
Volatile
-

Teacher
Terabyte TB 1000
4
Secondary Storage - Stores large amount of data that

will not be lost when


Tebibyte TiB 1024
power supply is interrupted.
A series of machine instructions software
Rom (Read memory) > Non-volatile
is called
Only
-

a or a
program
In ↑ do and unit , -> faster and more the processor Lost when E
general ,
.

powerful .

power supply is
interrupted
Multi-leve >
multiple processing units that's able to perform multiple machine instructions at time .
processors a
-

Memory - Device that data for IMMEDIATE Data ROM cannot be easily t
is used to Store
Usage
Stored on
changed and

Address - A number that is used to locate byte in remains there regardless if the is off.
power supply
on or
a
memory
Hard disk > -

Secondary storage where data is stored on


rigid rotating disk coated with a
magnetic material

Bus > -
Collection of wires for
transporting data from one
part of a
computer to another . [Databus & address bus)
Differences in data bus & address bus .

O Data bus bidirectional it is


2 directions but the address bus unidirectional
is as in is as it is
only in one

direction

② Data bus transports data that is


going
to be
processed
to the IDU and data that has been processed from
the CPU to the memory
.
The address bus only specifies memory
address. 1010010/

#tabus

I
100101/
buses travel from the
00

Similarity
>
Both to the memory Cou
->

processor .
>
-

I 10110III
address bus

Input device >
->
Hardware device that allows users to enter data and instructions into
2001000/
3
01/1010
Bu T 4
a 1000101
computer #110,
Output device >
-
Hardware device that is used to
display processed data from a computer .
CPU
>
-
data bus
1000
6

address bus
4101011110

Storage media

① Data stored material that be read/written [Hard disks]


Magnetic on a
magnetic
can
by magnetic
a head


Solid state tre >
-

Large storage capacity , relatively cheaper


re- >
damaged lesing the information there much slower than solid State
-

on
③ Data
Optical stored in electronic circuits that have no
moving parts [Memery card]
+v >
e->
Much faster than optical data , not as vulnerable to damage
magnetic or
,
smaller in size and
lighter in
weight
ve > Much
- -

more
expensive

Data stored as
very small indentations that can be read or written by a laser [DVD ,
CD
, bluray]
+ ve->
Large storage capacity
-
ve- Vulnerable to scratches &f fingerprints ,
data can
only be written once

Set of
Algorithm >
-

Step-by-step instructions for solving a


problem

Data affect what


Input >
-
used
by an
algorithm that can is
required for correct output .

Output >-
Results produced by an algorithm Sub-problem - A
problem whose solution contributes to
solving the
bigger problem .

(
Decomposition - Breaking a big problem down into smaller problems
methods
Decomposition
① Incremental
approach
Identify quantitative features of the input/output that causes the problem to be too
large to handle. The solution to a small version of the problem

of these features be found and of the Each extension sub-problem


with one or more reduced can
gradually extended to
larger versions
problem .
gradual is a

② modular
approach
Solve of the tasks that of different natures . be other to
simple examples problem manually and identify are These tasks can
separated from each
become distinct sub-problems . This
usually results in
sub-problems that are different from each other .

Variable > Named space for value that be


Storage changed while the algorithm
-

a can is
running

equal sign ()
Use to store a value
an in a variable

Flowchart > Visual representation of to show the flow of


sequence of
algorithm using symbols Steps
->
an

③No
Flowchart symbols Structuring flowcharts
① Terminator ① CITARE Start with terminator symbol
exactly ONE and may stop with one a

② Data Lp) terminator


more symbol
⑤ Decision ② INPUT -..
④ (x = x+ 1 ② Except for terminator & decision all should
only have One entry d exit
point
,

④ Process OUTPUT ... Instructions & Flow lines should not Cross each other .

Iteration >
report process

· Dry run > -


Process of running through a set of
steps manually
-

closed loop ,
until a
particular condition is true ·
Test data -
Input data used to
perform adore
Trace table Tabulation of the invariables + output
change
>
dry
-

in a run

↓ Ye

of trace table
Purpose
① Determine
algorithm purpose
② Correcting an
algorithm
Instruction set >
-
Set of basic commands or instructions that a
processor can understand directly ,
represented in
byte form
Machine code > Instructions that
computer's processor
directly
-
can run on a
machine

Program - Set of instructions written to perform specific tasks on a


computer .
English Python Code

Programming languageLanguage designed for humans to communicate instructions to


computers
Source code > Instructions written humans
language both computers
-
in and can understand .
a
programming
Rules determine the
Syntax
> that how and instruction
words
symbols
-

in a valid are
arranged .
Error when incorrect source code do not follow the rules of the
occurs
language .

Compiler >
-
Lode translator
program
that translates source code into machine code fully before running the
compiled program
Code translator program that translates while the
Interpreter - source code into machine code interpreted program is
running
The machine
code is discarded after the is
stopped the
interpreter is needed
every time the is run
program so
program

I
,

Compilers Interpreters Data types


- Runs faster because all translation
beforehand Changes to the source code
Integer
-

is done inf 1234


is not needed to
compiler run take into effect
immediately

-
~

the
program after compilation Floating point float 1. 294
-

offers an interactive mode


~

Syntax errors are detected "ABCID]


"

before the program is run


string Str

Boolean book True/False


changes to the source code Program s rue af a slower speed
-
-

a require recompilation because translation occur while its List list [2 , "apples" ,
1 . 27)
runnings

-Do
offer interactive Fint A sequence of
not Interpreter needs to beena
range 2) into
starting from the
-

O up till
time
, . , argument
mode
-

Syntax errors may interrupt print (list range (s))) [0 ,


1
,
2]
the
running of a
program rangell , 2 int
.
A
sequence
of into
, starting from argument/ , up to argument
2

Java (C 8)() [4
Jarascipt/python Print (list(range (4 , ,
5
,
6, 7]
UDF ~
ange() Jint A
, sequence of into starting from argument) up to argument 2 increasing by
, , ,

def function namal) : rues function When name is called


4
print (list(range ( 20, 4))) [3 7 11 15
19]
- .

argument 3 .
,
, , , ,

def function (parameter 1)


requires /argument
:
- name ·

>
= =
def function Equal to
-

-
name
(paramete parameter 2) : requires
,
2
arguments returns true/False

Local ↓ -
Us Global variable Notegual to returns True/False

Local > Variable UDF that


created inside
only be used in UDF
-
can .

Global > created outside of UDF readable if not hidden


Variable by local
-

,
variable

+, addition I- subtractionI , ,
*, multiplication/division)// Floor division >
-

rounds down the division I


impt/ =,
&

% modulus/ **
Exponentian) !1 >=
Operator then equal
, sign
List > can
-

contain items of different


any
and types
Index :

E g.
.

Computing print (subject-name [ :: 2]) print !"Computing" [2 : : (j)


subject- came =
"Computing" Lmuig muig

print (subject _
nan[5]) Print [subject-1ane[2 : 8 :
2] print ("Computing" (2 : 8 : ])
t Mui
mputin
Print (subject-name[s 6]) =
print (subject-named : 8 :
CJ)
put Cmui
Changing values of lists
Using index
>"
-

I
DOES NOT WORK WITH STRINGS

E E
g. g
.
.
.

4
Scores =
[85 . 0
,
88.1 72 2
,
.

,
63 .
Subject-name = "Computing"
Scores[C] = 50 . 0
subject-name = "It subject-name [1 ) .

print (scores) print (subject-nana)


[85 0 .

,
88 . 1
,
50 0 .

,
63 .

4) I

I
"

words : [ "code" , computing" ,


"future" "Low"
, ,
"thinking"] While loop
index While the loop
= O condition is not met, keeps running till condition is met

While index < (en(words) : For


loop
if words [inde] [0] !
= 'C' : The
loop runs for a fixed amount of time .

break

Print ("Lisfor" + words [index])


index = index + 1

stages in
developing a
program
abs() >
-

absolute value

Gather requirements >


-
Plan solutions >
-
Write code -> Test and refine code >
-

Deploy code round() -> rounds float to nearest int

O Gather round (2-017, 2) >


-
2 02
requirements
.

Gather To use math module


necessary inputs required for the code
-

the

Gather math
outputs required for the code
import
-

the necessary
② Plan Solutions moth Leil] >
-
rounds the number
.

up

Decomposing the problem into smaller problems math floor 1- rounds the number down
-

Write it out random. rand int (a, b) from a to b inclusive)


-
-
in
pseudocode/flowchart generates a number

③ Write code Str is . alnum() >


-

checks te se if all character is either letter/number

! alpha (1- > Checks


~
Write code Str to see if all characters
,
is are alphabets
① Test and refine code Checks to see if all characters numbers
Str is.
digiti) >
-
are

test the code with test cases to see if it Checks to see if lower case
runs as
expected Str islowers >
.
-
all
alphabets are

⑤ Deploy code Str .

isupper ()
-
> Checks to see if all
alphabets are
upper case

Str ends with) +


checks to see if the
.

string ends with certain alphabets

Data validation
techniques Str Starts
.
with 2)- > Checks to see if the
string starts with certain alphabets

& Length Check >


-
Ensures that input is of correct
length .
Uses lend function Str find()
.
>
-
Checks to see if an
argument
is in a
string and returns the index
,
returns - 1 if not in

Ensures

Range check >
- that the
input is within
range
limit in
put
to a Str
Split() >
Splits the
string ht the If there is an split at the
argument
-

,
.

space . argument,

particular range of values


-

& Presence check > Ensures - that


Mandatory inputs are present. Compares inputs
to valuesSuch as None or ("") to ensure all
required inputs
are
provided
& Format check > -

Satisfy additional complex requirements like


following a

pattern
Types of errors

Syntax error

E
Incorrect
Spelling of symbols
-

source code : error incorrect in source code


g. sequence
.

Detected When tries to translate Source


-

interpreter code into machine code

② Run-time error

Errors that usually Incorrect validated/conditions occurring


to
crush/hang : E g. of commands that has been properly
-

cause not outside of


a
program . use
program
control

Detected
-

when is
program running
③ Logic error

Errors allows the program


-

to
that run as
expected with incorrect output : Eg
.
.Incorrect or
incomplete algorithm
Detected when is
~

program running
TestCases

① Normal conditions data follows what


:
Input is
expected during normal use of the
program

Boundary conditions :
Input data is at the limit of what the
program is
designed to
cop with
③ Error conditions :
Input data is rejected

Data Data is by alternation Data corruption causes &


Corruption > -
made unusable errors or ,
ways to
prevent .

Data less >


-
Data is destroyed and cannot be destroyed Human error

How to
Storage devices may be
prevent data corruption & data loss
accidentally damaged during transportation
-

&
Backup Copy
> of data damaged/lost Multiple file may
-

made in case on the same


original is Users
working accidentally overwrite
-


Uninterruptible power supply > -
Provides enough power for
a
computer each other's data

How to
to
completely shutdown incase of
power
failure .
prevent !
-
make regular backups of data [Applies to all] A
Authentication -
Use when
adequate protection transporting data

Unauthorised When other's data wo Set-up rules When collaborating with


multiple to
-

access someone has excess to them


permission users
prevent
-

Methods to
prevent unauthorised access from writing to the same file at the same time

① Password Power failure


Security token, (2-factor authentication) Power
-

supply to a
computer fails ,
data that is
being written to storage device
③ Biometrics Memory will be lost
may become corrupted data stored in
,
volatile

How to
&

prevent ?
Authentication Set up a
-

measures backup power supply so


storage devices can
complete any operations in case of

① Passwords failure
power
Avoid the same passwords Hardware failure
using and use
unique passwords across or
damage
Storage manufacturing
-

due to defects
may fail
multiple accounts devices over use
, or age
Symbol
Use
passwords that are a mixture of lower case , upper can letters , numbers and How to
prevent ?
check
-

Update passwords regularly storage devices


regularly and
replace them immediately when
of failure are detected

security taken Malicious software or viruses

keep the security token stored in a secure times Some


-

location at all malicious software may purposely damage and corrupt data te attack

Report missing tokens as soon as


possible computer
③ Biometrics How to
prevent !
Choose from unknown
appropriate biometric that is hard to Avoid
opening email/chat attachments
files
~

an
replicate or sources

Install and
configure firewall to
-

them from
a
prevent spreading through the
Access control or authorisation
I network

① File
permissions
Take The interception of legitimate
care not to
accidentally grant file access to unauthorised Users
Pharming > requests to a website to fake
-
a

Make authentication details


especially Strong for the administrator to avoid
having website to steal personal data or credit card .

Stolen data then be used for


an intruder
successfully claim to be the administrator and by pass file permissions can meauthorised access to even more of

the victim's data


entirely
② Firewalls More difficult to detect than
phishing as take website uses same

Configure firewalls properly to block traffic between any address as real website

Use of take email be from


reauthorised senders and receivers
Phishing > -
and website that
appear
to
reputable

Configure the firewall to block traffic from certain well-known harmful companies to steal
personal information like
passwords and credit card

from users.
program

Encryption Spyware > A hidden
program that secretly personal information about its
-

collects

keep secret keys private and safe users and transmits this information to attackers without the user's

Use
encryption in combination with file
permissions Knowledge
Trojan horse A to be a harmless file

I
> that
computer program pretends useless
-

or

Copyright + > -
The legal
right of owners to control the use and distribution
application . When run it does
, something harmful .

of their Virus A
intellectual
property >
-

computer program that attaches itself to a


normally harmful program

Intellectual property > Creations of the mind that have value but can
only and modifies it When modified virus attaches
-

program is run
, Copies of
exist as data with no
physical form itself to other
programs .

Worm > A
computer program that runs automatically and attempts to
Spread
-

types of software licenses


by sending copies of itself to other
computers .

Free and
Open source software -
> Software Where users are
given the Does not need to attach itself to an
existing program .

freedom to change , copy study and share its source code -


,

Public domain software Software where the typically granted to


>
-

legal protections that are intellectual property are either expired been
,
surrendered or are
simply
in
applicable
Freeware >
-

Proprietary software that is available to use for no cost .

Open-courseware >
-

Higher-education course and materials


syn as videos and note, created
by universities and distributed for free on the internet.

software > Commercial software for which


Proprietary most of the
legal protections under copyright are retained .
-

Shareware > DemonstrationSoftware


-

that is free but


only available for a
period of time .
00000

-otwa
agement - Use or distribution of copyrighted work without
permission of
copyrighted owner
100 %

20010
Crack >
-

Program that modifies proprietary software so that the software cannot detect that it is
being used illegally .

Software
3001
Crime of software that is permitted by its
piracy- copying ,
distributing and or
using proprietary not license
4 0100

5 0901

6 110
Uses of binary and hexadecimal systems
z 0111
-
RGB colour codes
8100
s 100/
-
IP address
1010

denary number system [AA


A
(IP(4) > DDJ The
i
BB numbers OLx4255
B
-

.
. .
C . ore

(IPVO) >
-

hexadecimal number system larger and overcomes the problem of insufficient Ip addresses
,
E
Mac addresses =
IP address
may change each time a device is connected to the internet and is not
permanent , a more
permanent way is to use Media and

Control address .

I Paddress -
transmits data over the internet

MAL address -
transmits data between devices in local area networks .

ASCII -> defines how numbers characters 7 bit


binary
are used to
represent common
types on keyboards .
-

OR AND NOT gate


gate gate
Q: NOT A
A O= A
A-Xo-Q
-a
Q = AORB ANDB
-a
A B Q A BQ A Q

00 0 00 0 0 I

0 1 010 10

I I 100
0

11 I
111

NOR NAND gate


gate
Not a
-a

or
A BQ

O O I

0 I I

[ 8 I

-1
D
Data types in excel 4
stages in the data life
cycle
= IF
(logical-test ,
value -
if - true
,

General (Data with no


specific type)
① Data collection value -
if -
falsel
~
Number (Applies for both into and floats) ② Data processing
=
AND (logical -
1
, lOgica22 ,
... )
(logical
= OR
-

Currency (Used for money) ③ Data analysis -


1
, logical -
2
,
... /

Date (Used for dates) ④ Data distribution = NOT


(logicall
-

Time (used for time and durations)


=
LEN("TExT'
-

Percentage (used for


=
MIDL "TEXT" start-nun ee-chars =
TODAY(1 A
rates , ratios
,
and
proportions , ,

Text (Used for text) = LEFT ( "TEXT" num-chars


,

=
RIGHT ( "TEXT" num-chars]
Logical value (Booleandata TRUE/FALSE)
-

, ,

HLookup (Lookup value table-arra


-

I
,
,
row-index-num , range lookup
VLookup table-array
Computer (Lookup
=
networks (tre) value ,
now-index-num range lookup
, ,

shared allows of range lookup TRUE/FALSE


resources ,
a
group computers to =

2)
make use of shared resources like printers or files Approximate match Exact match

shared internet =
Ceiling Math 1)
=
ROUND (number
-

access .

,
no of decimals
-

Sharesoftware =
Floor. math () = RAND BETWEEN ( lowest, higher) [Both inclusive]
*
Shared =
power (number [Exclusive
~

Storage ,
Data files can be stored on a central
, power )
=
RAND() Number of
number]
-SQRTC) Sumc(
=

backup purposes
=
server for ease of access ,
and

Communication Computers
-

,
in the same network
=
MAX() =
SumIF(range ,
Criteria ,
Sum-rangel
are able to share instant emails
=
MINC) = COUN+ 11
messages and

= COUNTAL) =
COUNTIF()
=
COUNT BLANKIS
Computer network ( -

ve)
= MODE . SNGLL)

Initial costs due to


=
MEDIANIS = AVERAGEL
are
high setup and
equipment costs

MaintenanceLost associated with administering and


=
SMALL(range ,
no % = LARGE Crange no ?
,

the network
maintaining
Security files shared infected
-

risks with just


,
Since are through a network ,
even one
computer ,
a virus or worm can
spread
throughout the network.

Risk of data loss data loss due to hardware failures data


may be Regular backups
-

or errors >
-
are needed
, .

O Networks
Geographical size of networks of
computing devices connected within a small
geographical area
typically within the
① Local network home school or office
area same
building ,
such as a
,

② Metropolitan area network & Network of computing devices typically spanning across zor mere
buildings within the same town or

③ Wide area network City


& Network of
computing devices large-scale geographical multiple
covering a area
, typically across

locations
geographical

Wired network >


- All devices are connected by a
physical medium .
[Most commonly ethernet]
Ave Data is more secure it is harder for hackers to access to one's information
as
gain
More reliable as data is not
susceptible to interference
ve when distance between devices physical
-

more devices arc added ,


and increases ,
cost of setup increases as cables have to be run.

Lower mobility as devices have to remain at certain


spots and users cannot more to other locations .

Wireless network > A network of devices which transmitted without the


signals are use of a
physical medium.
-

Wireless Access points (WAP) > -


Provides a wireless connection between wireless devices up to loom away .

client >
Computer that initiates connection to the server to
request for resources and services to
a
operations
-
run

Server >
-

Computer that shares resources to clients and


responds to
request , from clients and other servers .
It has a higher capacity and

is were
powerful than a client as it needs to resource , and services
manage

Client server network

the : Centralised control of data and resources


~
ve :
Higher initial costs due to the need for a server

Easy to schedule
backups of all shared files at intervals Administrative needed for the maintenance of
regular costs servers

Data is more secure as access


rights are controlled
by a central server and clients

Peer-to-peer network
+ ve
through
ve
backup
-

Cheaper to : More effort and data


:
set-up as there isdo
specialised server needed .

required to access

the network as the data


Easy to
set-up as do specialised software are needed to rue the system .
is stored within each individual

computer rather than in a Central Server .

Security is an issue as access


rights are not administered by
a
Server

1
Feature Client-server Peer-to-peer
Function Data and resources shared using Data shared between computers. Each computer
are one or more and resources are
directly
dedicated servers- Each computer is either a client or server .
is both a client and server

Security Secure as access rights to all data and resources is controlled


by Low as Security is handled by each computer and not a central server

a server .

Set-up cost High due to the need for a


specialised server Low as no
specialised server is needed and each Computer acts as a client and

Server

Storage Centralised and is


only carried out at the server Decentralised and can be carried out at each individual computer

Applications In large businesses with large amount of people In homes or small businesses

Factor Wired Wireless

Cost Cheaper at first but becomes more


expensive al more
people join
More
expensive at first due to the cost of wireless networking Equipment
the network due to the cost of Cables but becomes time
cheaper over
I i
Reliability more reliable as it is unaffected by interference Less reliable as it can be interfered by radio waves acrobstructed by physical
J
objects
Security More secure o it is less susceptible to interference and
hacking
Less secure due to possible intrusion of backers

Mobility of Users Lower as network connections are fixed at


specific sports Higher as users can move freely within the
range of the wireless network

Scalability more troublesome as cables have to be added to add new Easier as new devices can be added to the network .

devices

Network interface controller >


-
Provides the hardware interface to enable the transfer of date between a device and network .

Network hab > Transmits received the devices that it is connected to


packets to all
-

>Computer
-

=> C

Network Switch Device that Similar networks


> constructs
single network by connecting multiple together
-

compote
computer
T -
Compute

computer
Router >
- Device that forwards
pockets between received networks .

Moder >
-
Converts digital data into a form suitable for the transmission medium Ged nice Versa

↑a ↑
3
Bus
topologe
↓ 6

I
the :
Easy and Cheap to install Ve
-
: A break
,
uses less cabling than other
designs anywhere along the bus
may disable
the entire network

Scalable easily be added Size


as new
computers can is
dependent on
capacity and
length of bus

can continue even when I computer breaks down

Gristopolo ,
a

tre : Can
operate over large distances and handle data than V2 A computers cable failing the entire network tofail .
-

were : can cause

bustopolog Adding a new


computer causes the communication of the
ring
to be

Central server is not required as dataSent between 2


computers passes temporarily disrupted .

through intermediate Computers


Do
star
topla

I
↓Ve : Reduce load on Cable
-
Ve : Use other networks
each
cabling as each
computer uses individual more
cabling than

Easy to isolate the fault Godde a


replacement without
disrupting
If the Central network hardware fails the system fails .

the rest of the network

Odd
parity

&
In if the total number of is affirst is odd Os
an odd
parity , ,
add Ensures data is not
lost/corrupten .

If the total number of Is is I


even
,
add .

Even parity

In if the total number ofls is even


an even
parity , , ,
and 0 .

If the total number ofIs is odd addi


,

Checksum
The The data and checksum are sent
bytes up together
sum of all the are added .
together .

At destination checksum is recalculated and checked against original checksum-


,

You might also like