A* 9618/ 9608 Chapter 2: Communication
Tout pour ce livre (6)
École, étude et sujet
A/AS Level
CIE
Computer Science
Unit 3 - Advanced Theory (9618)
Tous les documents sur ce sujet (2)
2
revues
Par: roro2552005 • 1 année de cela
Par: ashnacmr • 1 année de cela
Vendeur
S'abonner
SKH392
Avis reçus
Aperçu du contenu
CAIE A LEVEL COMPUTER SCIENCE (9618)
User-Defined Data Types: • Class: a composite data type that includes variables of given
data types and methods.
• User-defined data types: a data type based on an existing data • Object: defined from a given class
type or other data types that have been defined by a
programmer to extend the built-in data types. File Organisation:
• User-defined data types are necessary when there is no • Serial file organisation: records of data are physically stored
suitable data type provided by the language used. The in a file, one after another, in the order they were added to
programmer constructs their own data type. the file.
• Sequential file organisation: records of data are physically
Non-composite data types: stored in a file, one after another, in a given order.
• Non-composite data type: a data type that does not reference • Random file organisation: records of data are physically
any other data types. stored in a file in any available position; the location of any
record in the file is found by using a hashing algorithm on the
• Enumerated data type: a non-composite data type defined by key field of a record.
a given list of all possible values that had been implied order. o ID is hashed to produce a home location,
TYPE o If the home location is free, insert record,
<datatype> = ( value1, value2, vlaue3, … ) o Else, use overflow method to find a free location.
ENDTYPE
File Access:
DECLARE <identifier> = <datatype> • File access: method used to physically find a record in the file.
• Sequential access: records are searched one after another
• Pointer data type: a non-composite data type that uses the from the start of the file until the required record is found.
memory address of where the data is stored. o Efficient when every record in the file needs to be
• If the contents of the memory location are required rather processed.
than the address of the memory location, then the pointer can • Direct access: a record can be found in a file without reading
be dereferenced. other records.
TYPE o Files are found quicker
<datatype> = ^ <type name> o For a sequential file, an index of all the key fields is kept
ENDTYPE and used to look up the address of the file location
where a given record is stored.
DECLARE <identifier> : <datatype> o For a random-access file, a hashing algorithm is used on
<assignment value> ^ <identifier> the key field to calculate the address of the file location
where a given record is stored.
Composite data types:
• Composite data type: a data type that refers to any other data Hashing Algorithm:
type in its type definition. • Hashing algorithm: a mathematical formula used to perform a
• Examples: array, list, set, class, stack, queue, linked list calculation on the key field of the record; the result of the
• Record Data Type: a data type that contains a fixed number of calculation gives the address where the record should be
components that can be of different types. found.
TYPE • When reading a record from a file using direct access, the
<main identifier> address of the location to read from is calculated using the
DECLARE <subidentifier1> : <built in data type> hashing algorithm and the key field of the record stored there
DECLARE <subidentifier2> : <built in data type> is read.
ENDTYPE • But, before using that record, the key field must be checked
against the original key field to ensure that they match.
<main identifier> . <subidentifier(x)> <value> • If the key fields do not match, then the following records need
to be read until a match is found (open hash) or the overflow
• Set: a given list of unordered elements that can use set theory area needs to be searched for a match (closed hash).
operations such as intersection and union. • Open hash: record stored in next free space.
o The type definition has this structure: • Closed hash: record stored in next free space of overflow area.
TYPE <set-identifier> = SET OF <bastetype>
o The variable definition for a set includes the elements of
the set:
DEFINE <identifier> ( value1, value2, value3, ... ) :
<set-identifier>
o A set of vowels could be declared as follows:
TYPE Sletter = SET OF CHAR
DEFINE vowel ('a', 'e', 'i', 'o', 'u') : letters
1
, CAIE A LEVEL COMPUTER SCIENCE (9618)
Floating-point numbers, representation and manipulation: • Overflow: the result of carrying out a calculation which
• Mantissa (M): the fractional part of a floating-point number. produces a value larger than the allocated word size.
• Exponent (E): the power of 2 that the mantissa is raised to in a • Underflow: the result of carrying out a calculation which
floating-point number. produces a value smaller than allocated word size.
• Binary floating-point number: a binary number written in the • One of the issues of using normalised binary floating-point
form M x 2E numbers is the inability to store the number zero. This is
because the mantissa must be 0.1 or 1.0 which does not allow
for a zero value.
Binary floating-point number into denary
Protocols:
• Protocol: A set of rules governing communication between
computers. Ensures the computers that communicate
understand each other.
TCP/IP Protocols:
Denary into binary floating-point number
Layer Purpose
Application Encodes the data being sent
Network / Adds IP addresses stating where the data is from and
Internet where it is going
• Normalisation: a method to improve the precision of binary Link Adds MAC address information to specify which
floating-point numbers; positive numbers should be in the hardware device the message came from and which
format 0.1 and negative numbers in the format 1.0. hardware device the message is going to
Physical Enables the successful transmission of data between
devices
Application Layer:
• Contains all the programs that exchange data
• Sends files to the transport layer
• Allows applications to access the services used in other layers
HTTP Hypertext Transfer Protocol: responsible for correct transfer
of files that make up web pages on the world wide web
SMTP Simple Mail Transfer Protocol: handles the sending of emails
POP3/4 Post Office Protocol: this handles the receiving of emails
IMAP Internet Message Access Protocol: handles the receiving of
emails
FTP File Transfer Protocol: used when transferring messages and
attachments
Transport Layer:
• Regulates the network connections
• Data is broken up into packets which are sent to the network
layer.
• Ensures that packets arrive in sequence, without errors, by
swapping acknowledgements and retransmitting packets if
they become lost or corrupted.
• The accuracy of a number can be increased by increasing the
number of bits used in the mantissa.
• The range of numbers can be increased by increasing the
number of bits used in the exponent.
2
, CAIE A LEVEL COMPUTER SCIENCE (9618)
Transport Control Protocol (TCP): Circuit switching, packet switching and routers:
• Responsible for the safe delivery of a message by creating • Circuit switching: A method of data transfer in which the
sufficient packets for transmission. message is sent over a dedicated communication channel.
• It uses positive acknowledgement with retransmission (PAR)
which means it automatically re-sends a data packet if it has 1. First, a channel between sender and receiver is
not received a positive acknowledgement. established.
• TCP is referred to as a host-to-host transmission protocol as it 2. Data transfer then takes place (analogue or digital);
establishes an end-to-end connection between two host transmission is usually bi-directional.
computers using handshakes. 3. After the data transfer is complete, the connection is
terminated.
• TCP/IP Suite: A common protocol used to send data over a
Advantages Disadvantages
network.
the circuit used is dedicated to the it is not very flexible (it will send
o Protocols are split into separate layers, which are
single transmission only empty frames and it has to use a
arranged as a stack.
single, dedicated line)
o They service each other thus maintaining the flow of the
data. the whole of the bandwidth is nobody else can use the circuit
available
• Layer: A division of the TCP/IP suite.
the data transfer rate is faster than the circuit is always there whether
• Stack: A collection of elements/protocols/layers.
with packet switching or not it is used
• Packet: data is split up into smaller groups of bits for
the packets of data arrive at the if there is a failure on the dedicated
transmission over a network.
destination in the same order as line, there is no alternative routing
they were sent available
Internet/Network Layer:
a packet of data cannot get lost dedicated channels require a
• Ensure correct routing of packets of data over the
since all packets follow in order greater bandwidth
internet/network.
along the same single route
• Responsible for protocols when communicating between
it works better than packet
networks.
switching in real-time applications
• Take a packet from the transport layer and add its own header
which will include the IP addresses of both sender and
recipient. • Packet switching: A method of data transfer in which a
message is broken up into several packets that can be sent
• The IP packet (datagram) is sent to the data-link layer where it
independently to each other from start point to end point.
is assembles the datagrams into frames for transmission
o The data packets will need to be reassembled into their
correct order at the destination.
BitTorrent Protocol:
• Each packet follows its own path.
• A protocol that allows fast sharing of files via peer-to-peer
networks. • Routing selection depends on the number of datagram packets
o Torrent file: A file containing details about the tracker waiting to be processed at each node (router)
o Tracker: A server that keeps track of the peers • The shortest path available is selected.
o Peers: Users who download the same file at the same • Packets can reach the destination in a different order to that in
time which they are sent.
o Swarm: A network of peers that are sharing the torrent – • Router: A device that connects two or more computer
simultaneously downloading and uploading the file. networks.
o Seeding: The act of uploading a part of the file or the file o Directs the incoming packets to their receiver.
itself while downloading Advantages Disadvantages
o Leeching: Downloading the whole of part of a file and
not seeding it during or after the download. no need to tie up a communication more complex than those for
• How is data exchanged with BitTorrent? line circuit switching
1. Torrent descriptor file is made available. possible to overcome failed lines by if packet is lost, sender must re-
2. File to be shared is split into pieces. simply re-routing packages send packet (which wastes time)
3. BitTorrent client software is made available to other easy to expand the traffic usage does not work well with real-time
peers allowing them to work as seeds or leeches. data streams
4. Once peers have downloaded the file, it can become a charges users only for the duration the circuit has to share its
seed for the parts downloaded. of the connectivity bandwidth with other packets
5. Central server called tracker keeps records of all the high data transmission is possible there is a delay at the destination
peers and parts of the file they have. with packet switching while packets are reassembled
digital data is transmitted directly needs large amounts of RAM to
to the destination handle the large amounts of data
3
, CAIE A LEVEL COMPUTER SCIENCE (9618)
Processors and Parallel Processing: Boolean Algebra:
• RISC: Reduced Instruction Set Computer – group of processor • ̅ = NOT A
𝑨 • 0+0=0
architectures • A.B = A AND B • 1+0=1
• CISC: Complex Instruction Set Computer – group of processor • A + B = A OR B • 1+1=1
architectures
RISC CISC
Fewer instructions More instructions
Simpler instructions Complicated instructions
Small number of instruction
Many instruction formats
formats
Single-cycle instructions
Multi-cycle instructions
whenever possible
Fixed-length instructions Variable-length instructions
Only load and store instructions May types of instructions to
to address memory address memory
Logic Gates and Circuits:
Fewer addressing modes More addressing modes
• Logic circuits: A circuit that performs logical operations on
Multiple register sets Fewer registers
symbols.
Hard-wired control unit Microprogrammed control unit
• Sequential circuit: a circuit whose output depends on the
Pipelining easier Pipelining much difficult
input values and the previous output values. Eg: - Flip- flops
• Combinational circuit: a circuit whose output is dependent
• Pipelining: Instruction level parallelism
only on the input values
o Used extensively in RISC processor-based systems to
• Adders are used in electronics, digital circuits that performs
reduce the time taken to run processes
addition of numbers and present in ALU.
o Multiple registers are employed
• Half–Adder: A logic circuit that adds two bits together and
outputs their sum.
• Interrupt handling in CISC and RISC Processors:
o The sum bit (S)
o As soon the interrupt is detected the current processes
o The carry bit (C)
are paused and moved into registers
o The ISR (Interrupt Service Routine) is loaded on to the
pipeline and is executed.
o When the interrupt has been serviced, the paused
processes are resumed by bringing them back from the • Full–Adder: Two half adders combined to allow the sum of
registers to the pipeline several binary bits.
Parallel processing:
• Single Instruction Single Data stream (SISD)
o Found in the early computers
o Contains single processor thus no pipelining
• Single Instruction Multiple Data stream (SIMD)
o Found in array processors
o Contains multiple processors, which have their own
memory.
• Multiple Instruction Single Data stream (MISD)
o Used to sort large quantities of data.
o Contains multiple processors which process the same
data
• Multiple Instruction Multiple Data (MIMD)
o Found in modern personal computers.
o Each processor executes a different individual
instruction.
• Massively parallel computers
o Computers that contain vast amounts of processing
power.
o Has a bus structure to support multiple processors and a
network infrastructure to support multiple ‘Host’
computers.
o Commonly used to solve highly complex mathematical
problems.
4
Les avantages d'acheter des résumés chez Stuvia:
Qualité garantie par les avis des clients
Les clients de Stuvia ont évalués plus de 700 000 résumés. C'est comme ça que vous savez que vous achetez les meilleurs documents.
L’achat facile et rapide
Vous pouvez payer rapidement avec iDeal, carte de crédit ou Stuvia-crédit pour les résumés. Il n'y a pas d'adhésion nécessaire.
Focus sur l’essentiel
Vos camarades écrivent eux-mêmes les notes d’étude, c’est pourquoi les documents sont toujours fiables et à jour. Cela garantit que vous arrivez rapidement au coeur du matériel.
Foire aux questions
Qu'est-ce que j'obtiens en achetant ce document ?
Vous obtenez un PDF, disponible immédiatement après votre achat. Le document acheté est accessible à tout moment, n'importe où et indéfiniment via votre profil.
Garantie de remboursement : comment ça marche ?
Notre garantie de satisfaction garantit que vous trouverez toujours un document d'étude qui vous convient. Vous remplissez un formulaire et notre équipe du service client s'occupe du reste.
Auprès de qui est-ce que j'achète ce résumé ?
Stuvia est une place de marché. Alors, vous n'achetez donc pas ce document chez nous, mais auprès du vendeur SKH392. Stuvia facilite les paiements au vendeur.
Est-ce que j'aurai un abonnement?
Non, vous n'achetez ce résumé que pour €4,99. Vous n'êtes lié à rien après votre achat.