0% found this document useful (0 votes)
13 views22 pages

Compsci Chapters 1 and 2 Notes Compilation

The document discusses data transmission methods, including the use of data packets and packet switching, highlighting their advantages and disadvantages. It explains different transmission types such as simplex, half-duplex, and full-duplex, as well as serial and parallel data transmission. Additionally, it covers error detection methods, encryption techniques, and the significance of number systems in data communication.
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)
13 views22 pages

Compsci Chapters 1 and 2 Notes Compilation

The document discusses data transmission methods, including the use of data packets and packet switching, highlighting their advantages and disadvantages. It explains different transmission types such as simplex, half-duplex, and full-duplex, as well as serial and parallel data transmission. Additionally, it covers error detection methods, encryption techniques, and the significance of number systems in data communication.
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/ 22

DATA TRANSMISSION

[UNIT 2]

MST_CREATOR
Instagram, Twitter, DeviantArt, NG & Tumblr

Data Transmissions Methods & Types

Data Packets
Data packets are basically blocks of data which join to make up a full file.

Files are split into packets when transferred over long distances.

This is done so that transmission is fast and error free.

However, it has drawbacks like needing extra space for the “sequence” value for
reassembly.

Structure

Notes By MST_CREATOR Page 3


Instagram, Twitter, DeviantArt, NG & Tumblr

Packet Switching
This is the method where data is broken into packets which can be sent along
pathways independently to each other.

The file we wish to transfer is first split up into packets:

These packets are then sent through many interconnect routers (or nodes) which
eventually reach the receiver.

The receiver then reassembles the packets in order.

Advantages & Disadvantages


Advantages Disadvantages
No single communication line is needed. Prone to errors
Packets can be rerouted if some lines are Packages can be lost and may need to
busy or blocked. be resent.
Package usage can be expanded easily. There can be delays if packages need to
High transmission rate is achievable. be resent.

Notes By MST_CREATOR Page 4


Instagram, Twitter, DeviantArt, NG & Tumblr

Hopping
This is to prevent packages from being lost.

Basically, each packet is assigned a “hop number” which is reduced by 1 every time
it “hops” from one node to another.

Eventually, the hop number reaches 0.

When this happens, the packet is considered “lost”, is deleted, and then flagged so
that it is resent.

Data Transmission

The 3 Questions
Before we transmit any data, we must ask 3 questions to decide how we even do it:

1. In which direction is the data being sent?


→ Will the data be sent one way or both ways?
2. Which method of transmission should we use?
→ How many bits should we sent every time?
3. How will the data be synchronised?
→ How do we ensure the received data is in the right order?

In Which Direction?
Simplex
This is when data is sent in only 1 direction (e.g., Mouse to computer)

Notes By MST_CREATOR Page 5


Instagram, Twitter, DeviantArt, NG & Tumblr

Half-Duplex
This is when data is sent in both directions but not simultaneously (like in walkie
talkies where they say “over” every time).

Full-Duplex
This is when data is sent in both directions simultaneously (like in calls or video calls).

Which Method of Transmission?


Serial Data Transmission
This is when data is sent one bit at a time through a single wire.

Advantages Disadvantages
Best over long distances. Slow transmitted.
Data is going to arrive completely
synchronised, so it reaches in the right
order.

Notes By MST_CREATOR Page 6


Instagram, Twitter, DeviantArt, NG & Tumblr

Parallel Data Transmission


This is when several bits of data are sent down many channels at the same time.

Advantages Disadvantages
Best over short distances. Data can get skewed over long distances
(data is unsynchronised).
Many bits can be transmitted faster. Expensive due to many wires.
Best for time sensitive data. Requires more hardware.
Easy to use for input/output devices. High interference risk.

Universal Serial Bus (USB)


It is a form of serial data transmission and is the most common type of input/output
port.

When a USB Device is Plugged in


1. Computer automatically detects the presence of the device.
2. Device is automatically recognised, and the right driver software is loaded up.
3. If this is a new device, then the computer will try to find the right driver for the
device, if no driver is found then the user is asked to download the right driver.

Notes By MST_CREATOR Page 7


Instagram, Twitter, DeviantArt, NG & Tumblr

Advantages & Disadvantages


Advantages Disadvantages
Connected devices are detected and Older USB versions may not be
drivers are loaded automatically. supported.
Has lots of support as it is standard. Have a maximum length of 5m.
Error-free transmission due to USB Doesn’t have the fastest data transfer
protocols. rate compared to other mediums.
No external power source is required.
It is easy to add more ports and is
backward compatible.

Error Detection Methods

Why They Occur


Cause Details
This is when something happens and prevents the data
Interference
from reaching its destination.
Packet Switching If packets do not follow their correct path, they may end
Problems up not making it, this would lead to data loss.
This is usually in parallel data transmission and is when
Skewing
the bits do not arrive in the right order.

Parity Checks
I already made a whole video on this co just watch it here:

https://www.youtube.com/watch?v=oBEblLmUt34

Notes By MST_CREATOR Page 8


Instagram, Twitter, DeviantArt, NG & Tumblr

Checksums
As we know, data is sent in blocks.

Each block is assigned a value called a “checksum” which is calculated using the
information stored in that block.

The Process
1. Checksum value is calculated using the block of data.
2. The calculation is done using an algorithm which was agreed on beforehand.
3. The value is then transmitted along with the block of data.
4. The receiver then uses the same algorithm to calculate another checksum.
5. The calculated checksum is compare with the sender’s checksum.
6. If they are the same, no error occurred, if they are not the same, an error had
occurred, and receiver requests the data to be resent.

Echo Check
1. Sender sends data to receiver.
2. Receiver resends the data to the sender.
3. Sender compares the 2 sets of data.
4. If the 2 sets are the same, no error occurred.
5. If they are not the same, then an error occurred in transmission.

The Problem…
This method isn’t very reliable because when we compare the 2 sets of data, we
cannot determine which one is corrupted.

Notes By MST_CREATOR Page 9


Instagram, Twitter, DeviantArt, NG & Tumblr

Check Digit
This is the final digit which is included at the end of the data.

These are usually used in barcodes.

ISBN-13
An ISBN code is made up of 13 characters, the 13th character is the check digit.

Generation Rechecking
Add all the numbers at the odd Add all the numbers at the odd
1 1
positions. positions (including check digit).
Add all the numbers at the even Add all the numbers at the even
2 2
positions and multiply by 3. positions and multiply by 3.
Add the results from steps 1 and 2 Add the results from steps 1 and 2
3 3
and divide the result by 10. and divide the result by 10.
If the remainder is 0, then that is the
check digit. If the remainder is 0, then no errors
4 4
If not, then subtract the remainder occurred.
by 10.

Example
Generation Rechecking
(978034098382) (9780340983829)

1 9 + 8 + 3 + 0 + 8 + 8 = 36 1 9 + 8 + 3 + 0 + 8 + 8 + 9 = 45

2 3(7 + 0 + 4 + 9 + 3 + 2) = 75 2 3(7 + 0 + 4 + 9 + 3 + 2) = 75

36 + 75 111 75 + 45 120
3 = = 11 𝑟1 3 = = 12 𝑟0
10 10 10 10
4 10 − 1 = 9 4 𝑅𝑒𝑚𝑎𝑖𝑛𝑑𝑒𝑟 𝑖𝑠 0, 𝑛𝑜 𝑒𝑟𝑟𝑜𝑟𝑠 𝑜𝑐𝑐𝑢𝑟𝑟𝑒𝑑

Notes By MST_CREATOR Page 10


Instagram, Twitter, DeviantArt, NG & Tumblr

Modulo-11
Generation Rechecking
Each number is given a weighting
Give each number a weighting (assign
1 1 (assign values from 8-1 from left to
values from 8-2 from left to right).
right).

2 Multiply each digit by its weighting. 2 Multiply each digit by its weighting.

3 Divide the sum by 11. 3 Divide the sum by 11.

Subtract remainder from 11 (if


4 4 If remainder is 0, no errors occurred.
remainder is 10, then it is X)

Example
Generation Rechecking
(4156710) (41567102)
4 1 5 6 7 1 0 4 1 5 6 7 1 0 2
1 1
8 7 6 5 4 3 2 8 7 6 5 4 3 2 1

2 32, 7, 30, 30, 28, 3, 0 2 32, 7, 30, 30,28,3,0,2


32 + 7 + 30 + 30 + 28 + 3 130 32 + 7 + 30 + 30 + 28 + 3 + 2 132
3 = = 11 𝑟9 3 = = 12
11 11 11 11
4 11 − 9 = 2 4 𝑅𝑒𝑚𝑎𝑖𝑛𝑑𝑒𝑟 𝑖𝑠 0, 𝑛𝑜 𝑒𝑟𝑟𝑜𝑟𝑠 𝑜𝑐𝑐𝑢𝑟𝑟𝑒𝑑

Automatic Repeat Request (ARQ)


1. When the receiver receives the data, it also receives an error detection code along
with it (usually a Cyclic Redundancy Check).
→ This is basically when the sender adds up all the 1’s in the data packet and
stores it as a hex value which is sent off to the receiver.
→ The receiver then does the same and compares the 2 values, if they match, no
errors occurred but if they don’t, then the data is requested to be resent.
2. If an error is detected, the receiver sends a negative acknowledgement (request to
resend data), if not, then a positive acknowledgement is sent.
3. The sender also uses a timeout which basically waits for an acknowledgement and
if no acknowledgement is sent, the data is resent until one is received.

Notes By MST_CREATOR Page 11


Instagram, Twitter, DeviantArt, NG & Tumblr

Symmetric & Asymmetric Encryption

The Purpose of Encryption


When data is being transmitted, it can be intercepted by a hacker.

Encryption basically makes the data unreadable meaning that the hacker cannot use
the data even if they steal it.

Ciphertext & Plain Text


Plain text: This is the original data being sent.

Cyphertext: This is the plain text which is sent through an encryption algorithm.

Symmetric Encryption
This uses an encryption key which is used to decrypt/encrypt the message.

As of now, we have 10-digit keys, but these are easy to crack which is why we are
moving to longer ones.

Let’s say we want to encrypt “LET ME USE A CALCULATOR”:

We first decide on the key which is: 1456531746.

Let’s say our encryption algorithm moves the letter forward by a certain value:

L E T M E U S E A C A L C U L A T O R
1 4 5 6 5 3 1 7 4 6 1 4 5 6 5 3 1 7 4
M I U S J X T L E I B P H Z Q D U U V
To decrypt the message, we just move the letters position back by a certain value:

M I U S J X T L E I B P H Z Q D U U V
1 4 5 6 5 3 1 7 4 6 1 4 5 6 5 3 1 7 4
L E T M E U S E A C A L C U L A T O R
The problem is sending this because the hacker can intercept the key as well.

Notes By MST_CREATOR Page 12


Instagram, Twitter, DeviantArt, NG & Tumblr

Asymmetric Encryption
This is the confusing and annoying one so understand this well!

First up, we have 2 keys (not one):

1. Private Key: This key is only known by the user.


2. Public Key: This key is made public to everyone.

Here, both keys are required to encrypt/decrypt the message.

Let’s say a user, Ali, wants to send a file to another user, Zain.

The file is encrypted using asymmetric encryption, this is how it would go:

1. Zain uses an algorithm to generate 2 keys (public and private) which are
mathematically linked but cannot be derived.
2. Zain bhai sends his public key to Ali.
3. Ali now uses Zain’s public key to encrypt the file and sends it.
4. Zain now uses his private key to decrypt the document.

Basically, the encryption works in a way such that one key (the public key) is used
for encryption and another key (private key) is used for decryption.

Note: “bhai” means “brother” in Urdu/Hindi

Notes By MST_CREATOR Page 13


Instagram, Twitter, DeviantArt, NG & Tumblr

Number Systems
Binary is the basic building block of all computer systems!

The 3 Systems
System Bases Range of Values
Binary 2 0 -1
Denary 10 0 – 9
Hexadcimal 16 0 – 9, A – F

Note!
Conversions will be skipped as I do not know how I can even explain them through
text, I do plan on making some videos on them however!

Uses of Hexadecimal System


Error Codes
These are shown as hexadecimal values & refer to the memory location of the error.

They are automatically generated by the computer.

MAC Addresses
Media Access Control (MAC) address is a term which refers to a number which
uniquely identifies a device on a network.

They are stored inside the Network Interface Card (NIC) & are hardly ever changed.

They usually have the structure:

NN : NN : NN : DD : DD : DD or NN – NN – NN – DD – DD – DD

NN:NN:NN DD:DD:DD
The number of the manufacturer Device serial number

Notes By MST_CREATOR Page 3


Instagram, Twitter, DeviantArt, NG & Tumblr

Internet Protocol (IP) Addresses


This refers to an address assigned to each device on a network.

IPv6 IP addresses are made up of hexadecimals.

HTML Colour Codes


HTML uses hexadecimal for their colors, this means that we can specify any color in
HTML when we enter a 6 digit hex code.

These codes have the following structure:

# RR GG BB

RR GG BB
These 2 tell us how much These 2 tell us how much These 2 tell us how much
red is in the colour green is in the colour blue is in the colour

Note!
Addition, subtraction, left shift, and right shift of binary will be skipped as I will
make video(s) on them.

Notes By MST_CREATOR Page 4


Instagram, Twitter, DeviantArt, NG & Tumblr

Text, Sound, & Images

Character Sets
A character set refers to a list of characters that have been defined by the hardware
and software of the computer.

They are important because they enable the computer to understand the characters
we understand.

ASCII Code
This is a character set for all the characters on a standard keyboard & control codes.

It contains 7-bit codes, these codes are used to uniquely identify a character or
control code on a keyboard.

As far as I know, we are not required to Character Hexadecimal Denary


memorise the ASCII table, but just to be a 61 97

safe, remember the codes listed on the A 41 65

right 0 30 48
<SPACE> 20 32

Extended ASCII
This makes use of 8-bit codes rather than the 7-bit codes used by ASCII code.

This allows it to store 128 more characters, these characters are mainly graphical or
non-English characters.

However, apart from normal English characters, there are more than 128 other
characters.

Notes By MST_CREATOR Page 5


Instagram, Twitter, DeviantArt, NG & Tumblr

Unicode
Unicode can support all other languages (including English) & special characters.

It can support a wide range of chars because it can support characters with up to 3
to 4 bytes.

Advantages & Disadvantages


Set Advantages Disadvantages
ASCII Takes less space than Unicode Supports 128 characters
Unicode Supports wide range of characters Takes lots of space

Sound
Soundwaves are vibrations in the air, these vibrations are sensed by our ears and
interpreted as sound.

Sound waves have the following properties:

→ Frequency → Wavelength → Amplitude

Converting Sound to Digital


Sound is analogue in nature as it varies as time progresses.

To convert this to digital, we sample the sound at a regular time interval.

The amplitude is stored as an approximate value because we cannot find the exact
value.

Tip:
When we are told to get the binary for the amplitude using the given range, we
must find the 2’s power which is more than or equal to the upper bound of the
range.

For example, if we are told that the amplitude range is 1 – 10, we find the 2’s
power where it is greater than or equal to 10, in this case, it is 4 (24 is 16),
meaning that there are 4 digits in which the amplitude is stored.

Notes By MST_CREATOR Page 6


Instagram, Twitter, DeviantArt, NG & Tumblr

Key Terms
Sampling Resolution/Bit Depth:
This refers to the number of bits stored by each sample.

Sampling Rate:
This refers to the number of times the sound is sampled per second.

Bit Rate:

This refers to the number of bits used per second.

Formulas
𝑁𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑆𝑎𝑚𝑝𝑙𝑒𝑠 = 2𝐵𝑖𝑡 𝐷𝑒𝑝𝑡ℎ
𝑆𝑎𝑚𝑝𝑙𝑖𝑛𝑔 𝑅𝑒𝑠𝑜𝑙𝑢𝑡𝑖𝑜𝑛 = 𝐵𝑖𝑡𝑠 𝑃𝑒𝑟 𝑆𝑎𝑚𝑝𝑙𝑒 = 𝐵𝑖𝑡 𝐷𝑒𝑝𝑡ℎ
𝐵𝑖𝑡 𝑅𝑎𝑡𝑒 = 𝑆𝑎𝑚𝑝𝑙𝑖𝑛𝑔 𝑅𝑎𝑡𝑒 × 𝑆𝑎𝑚𝑝𝑙𝑒 𝑆𝑖𝑧𝑒
𝐹𝑖𝑙𝑒 𝑆𝑖𝑧𝑒 = 𝑆𝑎𝑚𝑝𝑙𝑒 𝑅𝑎𝑡𝑒 (𝐻𝑧) × 𝑆𝑎𝑚𝑝𝑙𝑒 𝑅𝑒𝑠𝑜𝑙𝑢𝑡𝑖𝑜𝑛 (𝐵𝑖𝑡𝑠) × 𝐿𝑒𝑛𝑔𝑡ℎ (𝑠) × 𝑇𝑟𝑎𝑐𝑘 𝐴𝑚𝑜𝑢𝑛𝑡

Note:
These formulas are not mentioned in the book (they are from AS levels) but there is
a possibility that you may need to use them in the exam, or at least know what they
mean.

Pros & Cons of Increasing Bit Depth


Pros Cons
Larger dynamic range Requires more processing power
Better sound quality File size increases
Less sound distortion Takes longer to transfer

Notes By MST_CREATOR Page 7


Instagram, Twitter, DeviantArt, NG & Tumblr

Bitmap Images
Bitmap images are images which are made up of pixels.

Important Terms
Colour Depth:
This refers to the number of bits used to represent each colour.

Image Resolution:
This refers to the number of pixels in the X-Y direction of an image.

Pixel:
This is the smallest element used to make an image on a display.

Important Formulae
Colour Depth:
𝑁𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝐶𝑜𝑙𝑜𝑢𝑟𝑠 = 2𝐶𝑜𝑙𝑜𝑢𝑟 𝐷𝑒𝑝𝑡ℎ

Image Resolution:
𝑅𝑒𝑠𝑜𝑙𝑢𝑡𝑖𝑜𝑛 = 𝐼𝑚𝑎𝑔𝑒 𝑊𝑖𝑑𝑡ℎ × 𝐼𝑚𝑎𝑔𝑒 𝐻𝑒𝑖𝑔ℎ𝑡

File Size:
𝐹𝑖𝑙𝑒 𝑆𝑖𝑧𝑒 = 𝑅𝑒𝑠𝑜𝑙𝑢𝑡𝑖𝑜𝑛 × 𝐶𝑜𝑙𝑜𝑢𝑟 𝐷𝑒𝑝𝑡ℎ

Pros & Cons of Increasing Resolution


Pros Cons
Increased image quality Increased file size
High amount of detail in image More processing speed is required

Notes By MST_CREATOR Page 8


Instagram, Twitter, DeviantArt, NG & Tumblr

Data Storage & File Compression

Measurement of Data Storage


A bit is the smallest unit of data, it is the building block of all the others.

Name Size Name Size


nibble 4 bits Kibibyte (KiB) 210 bytes
byte 8 bits Mebibyte (MiB) 220 bytes
Kilobyte (KB) 1×103 bytes Gibibyte (GiB) 230 bytes
Megabyte (MB) 1×106 bytes Tebibyte (TiB) 240 bytes
Gigabyte (GB) 1×109 bytes Pebibyte (PiB) 250 bytes
Terabyte (TB) 1×1012 bytes Exbibyte (EiB) 260 bytes
Petabyte (PT) 1×1015 bytes This system exists because storage is actually
Exabyte (EB) 1×1018 bytes calculated as powers of 2

Data Compression
Files like videos and photos are large, this is not good.

To reduce their size we use many techniques, the process of using these techniques to
reduce file size is called “data compression”.

Advantages & Disadvantages


Advantages Disadvantages
Reduced file size
Increased upload & download speeds Will be discussed for specific methods
Reduced bandwidth usage later
Time taken to stream reduces

Notes By MST_CREATOR Page 9


Instagram, Twitter, DeviantArt, NG & Tumblr

Lossy File Compression


Lossy file compression is when unnecessary data of a file is deleted; causing its size to
decrease, and the file cannot be reverted back to its original self.

Sound – MP3
MP3 files are sound files and are the compressed versions of the original file.

When a sound file is compressed to MP3, its file size reduces by around 90%.

MP3 files are not of the highest quality (like CD or DVD) but provide a decent
experience to the everyday user.

What Happens
When a file is compressed to MP3, the following may happen:

1. Sounds outside the hearing range (20 Hz-20,000Hz) are removed.


2. Lighter sounds are removed when there is a presence of a louder sound.

Video – MP4
This format allows the storage of multimedia; this includes videos, music, sound,
animation, images, etc.

When this is done, they can still be streamed without any reduction in quality.

Images – JPEG
JPEG or Joint Photographic Expert Group is a form of lossy file compression used
with images; it relies on the inability of the eye to distinguish certain colour changes
and hues.

Base Concepts
The system is based off of 2 key concepts:

1. Our eyes detect image brightness more than shades.


2. By separating the pixel colour from the brightness, images can be split into 8 x 8
pixel block allowing some information to be discarded, thus reducing file size.

Notes By MST_CREATOR Page 10


Instagram, Twitter, DeviantArt, NG & Tumblr

Lossless File Compression


This is when we reduce file size and but the resulting file can be reverted back to the
original file.

Run Length Encoding (RLE)


In IGCSE computer science, we only cover RLE as a means of lossless compression.

It takes a repeated data and coverts it into 2 digits:

1. The 1st digit amount of times that data was repeated at a certain position.
2. The 2nd digit is the item which is repeating (letters are shown in ASCII format).

RLE is only useful when the data has repeating values, if not, then the file size may
increase due to the addition of values.

RLE with Text


Let’s say we are to compress the following string using RLE:

“AAAAbbbbDDDdcccCCCC”

We write the number of times the character was repeated and the ASCII code:

AAAA bbbb DDD d ccc CCCC


4 65 4 98 3 68 1 100 3 99 4 67
This contains 12 values while the original had 19.

Lets consider a string with only unique data:

“AbCdEf”

A b C d E f
1 65 1 98 1 67 1 100 1 69 1 102
This contains 12 values while the original has 6.

Notes By MST_CREATOR Page 11


Instagram, Twitter, DeviantArt, NG & Tumblr

RLE with Images


Let’s say we have a bitmap image which is only Black and White:

When written down, it would look like this:


BWWW BB BW BBB WBW BB WWWB BWW
WB
When run through RLE, it would look like this:
1B 3W 3B 1W 3B 1W 1B 1W 2B 3W 2B 3W 1B
If we consider B as 1 and W as 0, then we get:
11 30 31 10 31 10 11 10 21 30 21 30 11
Let’s say we have a coloured image instead:

We also need to know their RGB values:


Pink: 227 61 111
Black: 0 0 0
Orange: 233 148 58
When written out, it looks like so:
0 0 0 0 0 0 227 61 111 227 61 111 0 0 0 0 0 0 0
0 0 233 148 58 227 61 111 227 61 111 233 148
58 0 0 0 227 61 111 227 61 111 227 61 111

227 61 111 227 61 111 227 61 111 227 61 111 227 61 111 227 61 111
227 61 111 227 61 111 227 61 111 0 0 0 233 148 58 227 61 111 227 61
111 233 148 58 0 0 0 0 0 0 0 0 0 227 61 111 227 61 111 0 0 0 0 0 0

That monstrosity can be put through RLE and would look like so:

2 0 0 0 2 227 61 111 3 0 0 0 1 233 148 58 2 227 61 111 1 0 0 0 12 227


61 111 1 0 0 0 1 233 148 58 2 227 61 111 1 233 148 58 3 0 0 0 2 227 61
111 2 0 0 0

Notes By MST_CREATOR Page 12

You might also like