View
218
Download
1
Tags:
Embed Size (px)
Citation preview
Study skills and Introduction to the Use of Computers
Revision2011
Outline of this lecture• Binary System• Data Storage• CPU• Operating Systems• Computer networks
– IP Addressing– Network classes– TCP/IP vs OSI model
• Legal Framework– Explain difference between patent and copyright– Computer Miss use Act– List 8 principles of Data protection 1998– Explain what rights you have as a data subject in relation to persons or
• Computer viruses– Virus– Macro– Trojan horse
Binary number
• Convert a binary number into its corresponding:– decimal value (base 10)– Hexadecimal value(base 16)– Octal value (base 8)
• Convert a decimal number to its corresponding binary number.– This done by repeated division by 2 and keeping the remainder
• Understand half adder and its disadvanges. • Understand full adder• Draw the truth table of both and any logical expression.
Example
• Convert 100111112 to its corresponding Decimal , hexadecimal and octal values.
• Find the binary representation of 137.
Adding binary 10011110 1101111+ + 111 1101-------------------- -------------------= 101 0 0 101 = 1111100
Boolean Algebra to Logic Gates
• Logic circuits are built from components called logic gates.
• The logic gates correspond to Boolean operations +, *, ’.
• Binary operations have two inputs, unary has one
OR+
AND*
NOT’
ANDA
BLogic Gate:
A B A*B
0 0 0
0 1 0
1 0 0
1 1 1
Truth Table:
A*B
A
BLogic Gate:
A B A+B
0 0 0
0 1 1
1 0 1
1 1 1
Truth Table:
A+B
OR
NOTALogic Gate:
(also called an inverter)
a A
0 1
1 0
Truth Table:
A’ or A
n-input Gates• Because + and * are binary operations, they can be
cascaded together to OR or AND multiple inputs.
AB
C
ABC
A+B+C
A+B+C
AB
ABC
ABC
ABC
Half Adder (1-bit)
A B S(um)
C(arry)
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
HalfAdder
A B
S
C
Half Adder (1-bit)
AB C
BABABAS
A B S(um)
C(arry)
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
A
BSum
Carry
Full Adder
Cin A B S(um)
Cout
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
FullAdder
A B
S
Cout
Carry In(Cin)
Full Adder
B)Cin(AABCout BACinS
A
B
Cin
Cout
S
H.A. H.A.
Full Adder
B)Cin(AABCout BACinS
Cout
S
HalfAdder
S
C
A
B
HalfAdder
S
C
A
BB
A
Cin
4-bit Ripple Adder using Full Adder
FullAdder
A B
CinCout
S
S0
A0 B0
FullAdder
A B
CinCout
S
S1
A1 B1
FullAdder
A B
CinCout
S
S2
A2 B2
FullAdder
A B
CinCout
S
S3
A3 B3
Carry
A
BS
C
Half Adder
A
B
CinCout
SH.A. H.A.
Full Adder
Data storage (see lecture slides)• You need the understand how data is represented in computers.• You need to understand the difference between different memory
types– CPU registers– Cache memory (why is it needed?)– Main memory – Magnetic memory– Optical memory– Magnetic tape.
• Understand how data is represented in magnetic and optical memories.• What is a bus in computing, its components and how does link the CPU
to the main memory.• Understand the role of CPU registers
Operating System
• Role of an operating system• How the operating system get started?• Understand understand how processes are managed by an
operating system.• Be able to explain all the state of a process from its creation to it
termination (process state diagram)• Understand how operating systems manage:• memory
– Fixed size partition, Swapping, paging, demand paging• i/o devices
– Programmed i/o (polling), interrupt driven i/o and direct memory access.
19
Operation System
User command interface
Resource management
Process Manager
Memory manager
Device Manager
File manager
Network manager
A model of an operation System
20
How the operating system get started?
21
Memory partition
• How processes are arranged in the main memory before been executed?
• Fixed-sized partitions• Variable-sized partitions• Swapping • Paging
22
Swapping
• I/O operations are slow • If a running process requires an I/O operation. The
CPU will move to another process in the main memory.• Suppose the main memory is full of processes waiting
on I/O.• CPU becomes idle• To solve this problem Swapping technique is used.
23
os os
P1
os
P1
p2
os
P1
p2
p3
os
P1
P3
os
P1
P4
P3
os
P4
p3
os
p2
P4
p3
adcb
ehgf
24
Memory partition
• How processes are arranged in the main memory before been executed?
• Fixed-sized partitions• Variable-sized partitions• Swapping • Paging
25
Swapping
• I/O operations are slow • If a running process requires an I/O operation. The
CPU will move to another process in the main memory.• Suppose the main memory is full of processes waiting
on I/O.• CPU becomes idle• To solve this problem Swapping technique is used.
26
os os
P1
os
P1
p2
os
P1
p2
p3
os
P1
P3
os
P1
P4
P3
os
P4
p3
os
p2
P4
p3
adcb
ehgf
Simple paging
• Swapping the whole process takes lots of time. Simple is used to reduce the amount of code been swapped.
• Simple paging: a process is divided into fixed equal size chunks called pages and the main memory is divided into the same fixed size called frames. A page is stored in a frame. This reduces internal fragmentation and instead of swapping a process only a page is swapped.
• Disadvantages all the pages of a process are loaded even if only a few are needed at a time. Simple pages fills the main memory of pages not ready to be executed yet.
• To solve this problem demand paging is used.
Demand paging
• Not all pages of a process at once. A page is loaded only if it is needed (page fault).
• This allows the main memory to store other processes which are ready to be run.
29
I/O modules
System bus
CPUMain
memory
I/O module I/O module
I/Odevice
I/Odevice
30
Advantages of I/O modules
• They are 3 ways in which I/O modules can work– Programmed I/O– Interrupt-driven I/O– Direct memory access.
31
Programmed I/O• The CPU controls I/O device directly Via the I/O modules.
• The CPU sends an I/O command to the I/O module.
• And waits until the I/O operation is completed before sending another I/O command.
• The performance is poor as the CPU spends too much time waiting the I/O device.
32
Interrupt-driven I/O
• The CPU issues a command to the I/O module and then gets on with executing other instructions.
• The I/O module interrupts the CPU when it is ready to exchange data with the CPU.
• The CPU then executes the data transfer.
• Most computer have interrupt lines to detect and record the arrival of an interrupt request.
33
Disadvantages of Interrupt-driven I/O
• CPU is responsible for managing I/O data transfer.
• Every transferred word must go through the CPU.
• Devices with large transfer, e.g. disk drive, the CPU wastes time dealing with data transfer.
• Solution: Direct-memory-access(DMA).
34
Direct-memory-access - DMA
• Special-purpose processor.• Handles data transfer.• CPU issues to the DMA:
• starting address in main memory to read/write to.• Starting address in the I/O device to read/write to.• The number of words to be transferred.
• DMA transfers data without intervention from the CPU.• DMA sends interrupt to the CPU when transfer is
completed.
35
Process State
• As a process executes, it changes state– new: The process is being created.– running: Instructions are being
executed.– waiting: The process is waiting for
some event to occur.– ready: The process is waiting to be
assigned to a process.– terminated: The process has finished
execution.
Computer Netwoks
• Understand Network topologies• Network classes• OSI vs TCP/IP model• Protocols • IP addressing (IPv4)
Topology
• The physical topology of a network refers to the configuration of cables, computers and other peripherals.
• The main types of network topologies are:– Linear Bus– Star– Ring– Tree or Hybrid– Mesh
What Each Layer Does
2
How Does It All Work Together
• Each layer contains a Protocol Data Unit (PDU)– PDU’s are used for peer-to-peer contact between
corresponding layers.
– Data is handled by the top three layers, then Segmented by the Transport layer.
– The Network layer places it into packets and the Data Link frames the packets for transmission.
– Physical layer converts it to bits and sends it out over the media.
– The receiving computer reverses the process using the information contained in the PDU.
2
4 layers of the TCP/IP model
• Layer 4: Application• Layer 3: Transport• Layer 2: Internet• Layer 1: Network access
It is important to note that some of the layers in the TCP/IP model have the same name as layers in
the OSI model. Do not confuse the layers of the two models.
• Application layer: Handles high-level protocols, issues of representation, encoding, and dialog control
• Transport layer: The transport layer deals with the quality-of-service issues of reliability, flow control, and error correction. Maine protocols are TCP and UDP.
• Internet layer: Logical addressing. Internet Protocol (IP). Packets Routing , routing table, routing protocol.
• Network access layer (link layer): Concerned with all of the issues that an IP packet requires to actually make the physical link. All the details in the OSI physical and data link layers.
TCP/IP protocol stack
Protocols at the application layer• 21: File Transfer Protocol (FTP)• 22: Secure Shell (SSH)• 23: Telnet remote login service• 25: Simple Mail Transfer Protocol (SMTP)• 53: Domain Name System service• 80: Hypertext Transfer Protocol (HTTP) used in the World Wide Web• 110: Post Office Protocol• 161: Simple Network Management Protocol (SNMP)• 443: HTTPs with Transport Layer Security or Secure Sockets Layer
Comparing TCP/IP with OSI
OSI Model TCP/IP Hierarchy Protocols
7th
Application Layer
6th
Presentation Layer
5th
Session Layer
4th
Transport Layer
3rd
Network Layer
2nd
Link Layer
1st
Physical Layer
Application Layer
Transport Layer
Network Layer
Link Layer
Link Layer : includes device driver and network interface cardNetwork Layer : handles the movement of packets, i.e. RoutingTransport Layer : provides a reliable flow of data between two hostsApplication Layer : handles the details of the particular application
An IP address is a 32-bit
address.
What is an IP Address?
The IP addresses are
unique.
Figure 4-3
Finding the class in binary notation
Figure 4-5
Finding the class in decimal notation
Figure 4-10
Masking concept
Default Mak
• Class A default mask is 255.0.0.0• Class B default mask is 255.255.0.0• Class C Default mask 255.255.255.0
Slash notation is also called CIDR
notation.
Example 18
What is the network address if one of the addresses is 167.199.170.82/27?
Solution
The prefix length is 27, which means that we must keep the first 27 bits as there were and change the remaining bits (5) to 0s. The 5 bits affect only the last byte. The last byte is 01010010. Changing the last 5 bits to 0s, we get 01000000 or 64. The network address is 167.199.170.64/27.
Exercise
• Given the following IP address 137.129.45.17:80
• find the class the network belongs to, the network address, the host address and the application
Answer
• the first octet is 137 (128 < 135 < 191). Hence the network is of a class B. the first 2 octets represent.
• the network address (135.129.0.0). The last 2 octets represent the host address (0.0.45.17). The
• port number is 80 which represent HTTP application
web client and server connection
• You should be able to explain how a web browser gets a web requests and get a web page from a web server.
solution
• The browser determine the URL and extract the domaine name. it breaks the URL into three
• parts: protocol (http), the server name and the file name.
• It then determine the IP address of the server name.• make a tcp connection to port 80 at the ip address
and send a send a request for a web page once the server has accepted the connection.
• the server sends the file and the browser releases the TCP connection.
Legal Framework
Copyright vs patent
• Copyright– Rights to make copies, automatically belongs to the author
of any original or creative work.– No one else may derive revenue from the work without the
copyright holder’s permission– Copyrights, designs and patent Act 1988
• Covers moral rights:– Even if the author has assigned copyright to another party and
no longer drives revenue from a work, they still have the right to be recognised as the original author.
• Patent– Protects the right to exploit inventions, – i.e. innovative computer hardware– It does not exist automatically but it has to be granted by a
government patent office.
The Copyright, Designs and Patents Act 1989 covers:
• Illegal copying of software.• Illegal running of copyright software on more
than one machine unless covered by the licence.
• Illegal for an organisation to encourage or pressure its employees to copy of distribute illegal software.
Software Piracy
• Software piracy can be defined as "copying and using commercial software purchased by someone else".
• Software piracy is illegal.
• Each pirated piece of software takes away from company profits, reducing funds for further software development initiatives.
Software patent• Computer programs are not in general recognised as innovations. Hence, they fall under copyright
rather than patent law
• UK and EU patents offices
– Exceptions for programs which makes technical contributions. Or provide an improvement of existing technology.
• Improved program for translating between Japanese and English is not patentable as linguistics is a mental process.
• Image enhancement is patentable as it produces a technical improvement in a technical area.
• Can I patent computer software
http://www.intellectual-property.gov.uk/
See study guide pages 51-52-53 for more details
The Computer Misuse Act 1990• The widespread use of computers and computer systems and the misuse
of them in the 1980’s led to a law making it a criminal offence to do certain things.
• The Act covers a variety of misuses that couldn’t be covered by the existing laws of the time. These include:
– Deliberate damage by planting viruses– Using computers to carry out unauthorised work– Copying computer programs– Hacking into a system to view private information– Various frauds including stealing money from banks
The Computer Misuse Act Covers:
• Unauthorised access to computer programs or data;
• Unauthorised access with a further criminal intent;
• Unauthorised modification of computer material (programs or data).
Three Specific Offences
• Section 1 (unauthorised access)– Access a program or data stored on a computer• Knowing the access is unauthorised• This is why login screens often carry a message saying that
access is limited to authorised persons:• This may not prevent a determined hacker getting access
to the system.
• The maximum prison sentence is 6 months.
Offences
• Section 2: (unauthorised + further offence)– Unauthorised access and intent of committing a
further offence,• Access private data, company records in order to
commit fraud, blackmail.
• The maximum prison sentence is 5 years.
Offences• Section 3: (unauthorised access + modification)– Unauthorised access plus– Modification of the computers contents
• Altering data:– A nurse might use doctor’s password to alter patient’s drug dosages and
treatments records• Removing data,
– e.g. to cover up evidence of wrong doing• Adding data:
– e.g. sending email under a false name results in unauthorised modifications to the content of the mail server.
• The maximum prison sentence is 5 years.
What the CMA does not cover?
• Denial of service attacks, (see next chapter)• Sponsored links on websites– A company pays on for advertising only if a user
click on the link– The advertiser’s competitors can click many times
causing the advertiser to run up a bill which does not bring them new business.
What is the Data Protection Act?
• Intended to balance interests of data subjects with data controllers.
• Freedom to process data vs. privacy of individuals.
• 1984 act was updated by the 1998 act.– On 24th on October 1998.– Came into force on the 1st of March 2000.
Changes Since the 1984 Act
• DPA 1998– Much broader than the old act. – More rights for data subjects.– Covers relevant manual filing systems.– New category of data – sensitive data.– Transitional relief:
• If data processing has been in effect before 24th of October then– For automated data
» Data controller has till 23rd of October to comply with the act – For manual data
» Data controller has till 23rd of October 2007 to comply with the act.
– Rules about export of data to non-EEA countries.
Definitions• Personal Data:
– is about a person who is alive and can be identified by that data.• Data Subject:
– is the individual that the data is about.• Processing:
– retrieving, holding, sorting, deleting • The Data Controller:
– is the person who is responsible for the control of the data in a business or organisation.• Relevant Filing System:
– Readily accessible information about living individuals• The Commissioner:
– is the person responsible for enforcing the law, including ensuring the owners of the data use good practice, and the individuals are aware of their rights.
Data Protection Act 1998
• PDA 1998 has 8 principles
Principles of the act – 1.• Non-sensitive Personal data must be processed fairly and
lawfully and shall not be processed unless one of the below is met (schedule 2). – Consent – the most important– Contract– Legal Obligation– Vital interests of subject (life or death!)– Public functions– Balance of interest
Sensitive Personal Data
• Racial or ethnic origin• Political opinions• Religious/similar beliefs (note food!)• Trade Union Membership• Health• Sexual Life• Offences
Sensitive Personal Data
• May only be held if one of the below is met:– Explicit and informed consent– Employment Law– Vital Interests of Subject– Legal Proceedings– Medical Purposes (by medical professionals)– Equal opportunities monitoring
Principles of the act – 2.
• Data must be obtained only for one or more specified lawful purposes.– Must not use data for a new incompatible purpose
without subject’s consent.– Have a data protection statement explaining what
data will be held and why and get consent from new students/staff as they arrive.
Principles of the act – 3 & 4.
• Personal data must be adequate, relevant and not excessive.– Must not stock up on data without a reason that
can be justified – consent!• Personal data shall be accurate and up-to-
date.– This is an ongoing requirement and means data
needs to be kept under constant review.
Principles of the act – 5.
• Personal data may not be kept for any longer than is necessary for its stated purpose(s).– This potentially creates a problem with old
staff/members data. – Consent from all new staff/members to keep
their data after they have left as this is a different purpose to keeping it while they are here.
Principles of the act – 6.
• Personal data must be processed in accordance with the rights of data subjects– This means that you cannot do things that
violate the rights given to data subjects under the new act, especially denying access to data.
Rights of data subjects
• Must be informed if personal data are being processed and given a description of the personal data and for what purpose it is being held for.
• May prevent processing for purposes of direct marketing.
• Right to see algorithms used in automated decision making (credit scoring etc.).
• Compensation, rectification, blocking, destruction.
Access rights
• Right to have communicated to him/her in an intelligible form the information constituting the data.
• No right to rifle through filing systems, computers etc.
• Right to be informed of logic involved in automated processing.
• Request must be in writing, fee up to £10 may be charged and identity may be thoroughly checked.
Enforced Access
• It is an offence to force subjects to exercise their access rights to data held by others– Includes data about cautions, criminal convictions
and certain social security records
Right to prevent processing
• Unwarranted substantial damage or distress to subject.• 21 days to comply with request.• Exemption if processing is necessary for– performance of contract with subject, or – there is a legal obligation, or– the vital interests of the subject are at stake.
Exemptions to access rights
• Prevention and detection of crime• Apprehension or prosecution of offenders• Collection of tax or other duty• Research, history, statistics.• Exam marks – 40 days after date of
announcement or 5 months of access request.• Confidential references.
Principles of the act – 7.
• Technical or organisational measures must be taken to prevent unauthorised or unlawful processing of data and accidental loss, damage or destruction of data.– First is related to IT support staff
(backups, password security etc.) but everyone can help.
– Second is about being careful with keys, having access controls
Principles of the act – 8.• Personal data may not be transferred overseas unless the
receiving country has an adequate level of protection for it.– US does not.
• Transfer is OK if contract is in place with the abroad party or the subject has consented.– Data Protection Commissioner is preparing standard
contracts.
revision
• Revise lecture slides• Revision slides• Assignments• Do previous exam paper• Come to my office Next Tuesday if have any
question.
Fin
Good Luck