0% found this document useful (0 votes)
40 views10 pages

Chapter1 and 2 Quick Revision

The document provides guidance on answering exam questions and explains various computer science concepts. It discusses binary and hexadecimal number systems, data representation, character sets, images, and memory size measurements. Examples and applications of concepts like MAC addresses, IP addresses, and two's complement notation are also described.

Uploaded by

ayesha
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)
40 views10 pages

Chapter1 and 2 Quick Revision

The document provides guidance on answering exam questions and explains various computer science concepts. It discusses binary and hexadecimal number systems, data representation, character sets, images, and memory size measurements. Examples and applications of concepts like MAC addresses, IP addresses, and two's complement notation are also described.

Uploaded by

ayesha
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/ 10

1 | Page

CompSci Paper 1
Paper 1 advice
Check the command word that is used, for example describe requires more than a
statement. Explain requires more detail as to why something happens, or why you have
selected the answer you have.

Check whether tick box questions require one, or possibly more ticks per row. If it is
one tick per row then make sure you don't put two. If there could be more check each
possibility, it is very likely that at least one of the rows requires two or more ticks.

If a question gives a context, and the wording of the command refers back to this
context, then make sure you use it in your answer. Don't just give a generic answer, use
the context in each point you make.

If a question asks for differences between two or more items, then make sure you give
all sides. For example just stating that parallel transmission has multiple wires is not
enough without also stating that serial has just one wire.

When converting numbers between different types (e.g. binary, denary, hexadecimal),
always check your answers by working it the reverse. For example, if converting binary
to denary, convert your denary answer back to binary and make sure that they both
match.
2 | Page
Chapter 1 Data Representation 1. Memory dump
Q1) What is meant by binary system? 2. Colour code in HTML
 It has a base of 2. 3. URL Encoding
 It only uses two values, that are 1 and 0. 4. Error Message
5. MAC Address
Q2) Why binary numbers are used in computer? 6. IPV6 Address
In computers data is processed using logic gates 7. Location in memory
and stored in registers, logic gates work on current 8. Debugging
signals ON and OFF represented by 1 and 0. 9. ASCII//Unicode
10. Assembly Language
Q) Write down different numbers and their bases:
Denary Base 10 system Q 6) Describe what is meant by a MAC address. [4]

Binary Base 2 system • Unique identification of a network device.

Hexadecimal Base 16 system • it is a unique (address).


• 48 bit long, available for more than 281 billion

Q) How computer uses binary? computer.

Any form of data is converted to binary to be • it is represented in 12 hexadecimal digits.

processed by a computer, like numbers, text, • it is a static address // it does not change

images, and sound files. • it is set by the manufacturer


• the first part is the manufacturer ID / number /

Q 3) Write down the application of binary identifies the manufacturer

numbers. • the second part is the serial number / ID.

Everything stored in computer is in the form of 0


and 1 like text, images, audio and video. Q 5) Memory Size Measurement
It should be pointed out here that there is some

Q 4) Give reasons why a programmer may use confusion in the naming of memory sizes.

hexadecimal to represent binary numbers. There are two different methods:

1. Less prone to error 1. Denary Prefix System used in SI Units. It is

2. Easy to read and understand base 10 system. In this system 103 = 1000 i.e. Kilo

3. Easier to convert long binary into 2. Binary Prefix System used in IEC Units

hexadecimal than into denary. (International Elcrtro-Technical Commission). It is

4. Less screen space is required. a base 2 system. In this system 210=1024 i.e. kibi

Q 5) Write down uses/ applications of 0 or 1 = 1 bit

hexadecimal. 4 bits = 1 nibble


3 | Page
8 bits = 2 niblles = 1 byte Positive integer in twos complement:

SI Units IEC units Normal denary to binary conversion is used in two’s


Denary prefix Binary prefix complement method too. Just convert the positive
1 kilobyte = 103= 1000 1 kibibyte (1 KiB) = integer into binary. No more processing is required
Byte 210= 1024 Byte
+27 : 00011011
1 megabyte = 1 mebibyte (1 MiB)
Q) How binary addition is performed?
106=1000000 Byte = 220 Byte Binary addition is performed using sum and carry
1 gigabyte = 1 gibibyte (1 GiB) method just as we use in daily life for addition in denary
109=1000000000 Byte =230 Byte numbers.
1 terabyte = 1012 Byte 1 tebibyte (1 TiB)
=240= Byte
1 peta byte= 1015 Byte 1 pebibyte (1 PiB)
=250 Byte
1 exa byte= 1018= Byte 1 xbibyte (1 XiB)
=260= Byte

Binary addition: no mark if carry bit is not shown.

(a) One of the images has a resolution of 2048 x 4096 and


a colour depth of 4 bits. Calculate the file size of the
image. Give your answer in Mib bytes.
Total Pixel= 2048 * 4096 pixels
Q) Explain why overflow occurs when two binary
Total bits= 2048 * 4096 * 4 bits
Total Bytes= 2048 * 4096 * 4 byte numbers are added by a computer. [2]
8
• Overflow is an error in which number of bits are
File size in kibi byte= 2048 * 4096 * 4 Kib byte
1024*8 greater than the value can be stored in given register
• An overflow error will occur if the value is greater
File Size in mebi byte= 2048 * 4096 * 4 Mib byte
1024*1024*8 than 255 in an 8-bit register.
File Size = 4 MiB Byte

Q) What are the most significant and least


Two’s complement: is used to represent negative significant bits?
numbers in computer. The left most bit in the given register is
known as most significant bit while the
1. Convert the number into binary
right most bit is known as Least Significant
2. Flip the binary value bit.
3. Add 1. 128 64 32 16 8 4 2 1
1 0 0 1 0 0 1 1
Convert -74 into binary using two’s complement:
1. 74 = 0100 1010 Most Significant bit Least Significant bit
2. Flip all bit 1011 0101
3. Add 1 +1
-74 1011 0110
4 | Page
Character Set Images
Q1) Describe what is meant by a character set. Give Q) How is an image represented in computer?
different types of character sets. An image is a series of pixels that are converted to
binary, which is processed by a computer.
The character set is collection of all characters and
symbols can be represented by a computer system. Q) What is meant by pixel, Colour depth and bit depth.
Each character is assigned a unique value. Pixel is the smallest picture element that contains only
one colour.
ASCII Code: 7 bit used to represent The bit depth is the number of bits used to represent
t 128 characters. Available for English characters only. each colour.
The colour depth is the number of available colours in
Extended ASCII Code: 8 bit used to represent 256 pixel.
characters. Image Resolution is the total number of pixels in the
image. It is the product of number pixels in width and
Unicode: 8 to 32 bit used to represent up to 4 billion
number pixels in height.
characters. Available for all languages of world. Image Resolution = Pixels in width * Pixels in height
Note: ASCII code for ‘A’ is 65, ‘a’ is 97 (65+32=97) Pixel Density is the total number of pixels in a square
centi-meter area in an image.
In capital letters bit 32 is always off. Q) Describe effects of changing resolution and colour
depth.
The file size and quality of the image increases as the
Q2) Give one advantage and one disadvantage of
resolution and colour depth increase.
Unicode. State reason too.
Advantage: ASCII code represents 128 or 256
characters while Unicode can represents 4 billion
characters.
Disadvantage: text stored in Unicode character set,
takes up more storage.
Reason. In Unicode, each character is encoded using
Bit Colour Available
more bits, so more combinations are available as well
Depth Depth Colours
it takes more space.
Monochrome
1-bit 21 = 2
( Black & White)
Q3) Describe how text is represented in binary, for 2-bit 22 = 4 Grey Scale
example a word ‘PATEL’ is represented by the ASCII 3-bit 23 = 8 RGB 8 Colours
character set. [2]
7-bit 27 = 128 128 Colours
Each character has its own unique code.
8-bit= 256 Colour
each character in the word is replaced by its code. 28 = 256
1 byte
The codes are written in the order in the word. Firstly 224 = True colours
24-bit=
P is replaced with its code, then A, then T, then E and at 16 16,777,216 Colours
3 byte
Million
last L.
5 | Page
Sound
Sound is a vibration that propagates as an acoustic
wave, through a transmission medium such as a gas,
liquid or solid.
A sound waves are longitudinal as they consist of
alternating compressions and rarefactions, or regions
of high pressure and low pressure, moving at a certain
speed. The longitudinal sound waves are converted
into transverse waves.
File Compression
Q 5) What is data or file compression?
The method of reducing file size is known as file
compression.

Q 11) Why file is compressed?


File is compressed to
 To transmit quickly
 To transmit using lesser internet data
 To store it in computer using lesser disc space
 To open it using lesser memory space
How sound is stored in computer?
 To make file small enough to email.
Q) How sound is represented in computer?
A sound wave is broken down into samples at a regular Q 12) What are types of file compression?
interval of time then amplitude of each sample is Lossless Compression reduces the file size without
found, at last the amplitude is converted to binary, permanent loss of data, e.g. run length encoding (RLE).
which is processed by a computer. It is used when all data needs to be recovered on
Q) Define Sampling Rate and Sampling Resolution. decompression.
Sampling Rate is the number of samples taken in a Lossy compression reduces the file size by
second. permanently removing data, e.g. reducing resolution or
Sampling Resolution is the number of bits per sample. colour depth, reducing sample rate or resolution.
Q) Describe the effects of changing sampling rate and It is used when file size needs to be reduced as much
sampling resolution on the file size and accuracy of as possible.
sound.
The accuracy of the recording and the file size increases Q 13) Benefits and drawbacks of file compression.
as the sample rate and resolution increase. Lossy File Compression: Unnecessary data is removed
Q) Describe the effects of changing sampling rate and permanently; file is compressed to smallest possible
sampling resolution on the file size and accuracy of
sound. file size.
The accuracy of the recording and the file size increases
as the sample rate and resolution increase.
6 | Page
Lossless File Compression: Nothing of the data is lost. Q) Describe steps of lossless compression of
Compressed file is not as small as in lossy file image file.
compression. To perform lossless compression of image RLE is
Q) How text file is compressed? used following steps are taken:
Text file is compressed lossless, using Dictionary
1. A lossless file compression algorithm RLE is
encoding or Run-length encoding methods
used
Dictionary Encoding: Each word in text is replaced with
2. Consecutive pattern on images are identified.
a symbol, that is not part of the text and a dictionary is
3. Consecutive identical pattern values
prepared containing all words and their replacement
converted into a code consisting of the image
characters. To decompress replacement characters are
replaced with original words, none of the data is lost. pattern and the number marking the length

Run-length Encoding: Repeated characters are of the run.


identified and stored once along with number of 4. The more similar values there are, the more
repetitions. To decompress characters are repeated as values can be compressed.
per number of repetition, none of the data is lost. 5. The sequence of data is stored as a single
For example, to compress a text string value and count.
“aaaabbbbcccccccddddd” as “a4b4c7d5”

Q) Describe steps of lossy compression of Image File.


Lossy File Compression for Images
For example, in row 2, 4 white pixels, 10 black
For lossy file compression of image file following steps
pixels, and then 2 white pixels:
are taken:
1. A lossy file compression algorithm is used 1111 0000 0000 0011 or WWWW BBBB BBBB

2. Bit Depth (bits per pixel) is reduced resulting in BBWW


reduction in colour depth. This would be represented after Run Length
3. Pixel density (pixel per inch) is decreased Encoding as follows: 1 4 0 10 1 2 or W4 B10 W2
resulting decrease in image resolution. Audio File Compression
4. Reducing bit depth and pixel density reduces Lossy File Compression of Audio using

the file size. MP3: Following steps are taken:


1. Lossy file compression algorithm is used
2. It removes the background noise.
3. It removes sounds that human ear cannot
hear.
4. Sampling rate is reduced.
5. Samling resolution is reduced.

Lossless File Compression of Images


7 | Page
Lossless File Compression of Audio File
For lossless file compression of audio file
following steps are taken:
1. A lossless file compression algorithm RLE
is used
2. Consecutive sound patterns are identified.
3. Consecutive identical sound pattern
values are converted into a code
consisting of the sound pattern and the
number marking the length of the run.
4. The more similar values there are, the
more values can be compressed.
5. The sequence of data is stored as a single
value and count.
Video File Compression

1. A compression algorithm is used


2. Redundant data is removed
3. Reduce colour depth
4. Reduce image resolution
5. Reduce sample rate
6. Reduce sample resolution
7. Reduce frame rate
8. Use perceptual music shaping
9. Some data is permanently removed
8 | Page
Chapter 2: Communication Example: a walkie-talkie, fax machine,
Q ) Describe the structure of a packet. reading or burning data on CDs or DVDs,
A packet of data contains a both but not at the same time.
– packet header 3) Full-duplex data transmission is sending
– payload data in both directions simultaneously (i.e.
– trailer
data can be sent from ‘A’ to ‘B’ and from ‘B’ to
The packet header includes the:
‘A’ along the same line, both at the same
– destination address
time). Example: a phone line, reading and
– packet number
– originator’s address writing data on HDD.
Q 2) Describe methods of transmission with

Q) Describe the process of packet benefits and drawbacks.


Serial transmission of data
switching.
Bit by bit transmission of data using single wire
• Data is broken down into packets
is known as Serial Transmission.
• Each packet could take a different
route Example: It is best for external transmission
• A router controls the route a packet and longer distance (like from CPU to printer,
takes keyboard to CPU).
• Packets may arrive out of order.
Benefits: More reliable
• Once the last packet has arrived,
packets are reordered Data arrived in sequence (bit by bit)
Lesser expensive (only one wire is needed)
Drawback: It is slow (using only one wire)
Q 1) Describe different types of data Parallel transmission of data
transmission with applications. Multiple bits are transmitted using several
Types of Communication wires.
Example: It is best for internal transmission
1) Simplex data transmission is sending
and shorter distance (like among ICs on
data in one direction only (i.e. from sender to
motherboard).
receiver).
Benefits:
Example: Radio, TV. Data being sent from a
Faster,
computer to a printer, from keyboard to CPU
more reliable for shorter distance
etc.
Drawback: It is less reliable (may be skewed)
2) Half-duplex data transmission is sending
More expensive (multiple wires needed).
data in both directions but only one at a time
(i.e. data can be sent from ‘A’ to ‘B’ or from ‘B’
to ‘A’ along the same line, but not at the same
time).
9 | Page
Q 3) Describe USB and its benefits 5. If it doesn’t match with the decided parity
USB (Universal Serial Bus) there is an error in transmission.
is a plug-and-play interface that allows a Q 5) When parity check cannot detect
computer to communicate with peripheral and error?
other devices. Parity check cannot identify error if there are
NOTE: USB is errors in more than one bit and parity remain
a method of connection not a storage same.
device. Transposition Errors can also not be detected
Benefits by parity check.
1. It is a BUS as it has wires to transmit data.
Q 6) how checksum is used to identify errors?
2. It is UNIVERSAL as it connects devices cover a Steps of Check Sum
broad range. This is a verification method
3. It is more reliable as it is SERIAL A value is calculated on the block of data
4. It can be used to charge portable devices. using an algorithm
5. Devices are automatically detected. appended on the block of data
Q 4) Describe how parity check detects errors. Data is transmitted with checksum
Receiver recalculates the check sum using
Q) describe the errors occur during data same algorithm

transmission. Both the checksum are compared

Errors can occur during data transmission due to If both the checksum are not same, there

interference, e.g. data loss, data gain and data will be an error in data transmission.

change. Q 6) How ARQ works?


Automatic Repeat Request (ARQ) is an
error-control method for data transmission
Parity Check is an error detection method.
that uses negative, positive
Additional bit is added for error detection.
acknowledgements and timeout.
1. Even or Odd parity is decided among
sender and receiver. Step of ARQ
1. Sending computer transmits a block of
2. The number of 1s are counted in each
byte and 0 or 1 is added to make it Even data.
or Odd whatever is decided. 2. The sending computer waits for a period

3. Data is sent. of time to see if receiving computer


acknowledges receipt of the data.
4. Receiver counts number of 1s in each
byte to check is it matching with the 3. After a set period of time, a timeout occurs
decided parity. which triggers the data to be automatically
resent by the sending computer.
10 | P a g e
4. This will continue until the receiving one to encrypt data and other to decrypt. One
computer acknowledges the data has key is kept hidden called Private key, other
been received. key is published called public key.
Q 6) Describe Echo Check Example 1: When Bob wants to send a
Echo Check: In this method the receiver secure message to Alice, he uses Alice’s
sends data back to sender. The sender public key to encrypt the message. Alice then
compares with the copy of the data sent. If the uses her private key to decrypt it.(To make
not-understandable for others)
data sent back are the same as the data sent
in the first place, then the original data must
have reached the destination unaltered. If not,
the data must be sent again.

Q 7) Describe Check Digit.


Check Digit is a digit added to a string of
numbers for error detection purposes.
This is a validation method
A digit is calculated on the item code using an Example 2: When Alice wants to ensure that
algorithm at point of manufacturing the message is sent by her (to verify the
appended on the item code sender and message is not altered, not to
At point of sale the check digit is recalculated make message secure (not-understandable
by others)),
using same algorithm
she encrypts her message using her own
If both the check digits are not same three will
private key.
be an error in scanning reading item code. Then the message is transmitted to Bob.
Bob decrypts the message using Alice’s
2.3 Encryption public key.
Q) What is meant by encryption? The decryption of message by Alice’s public
key confirms that this is Alice’s message, and
Encryption is the conversion of plain text into
is without any alteration.
cipher text, which cannot be easily
understood by anyone except authorized
parties.
Q) Describe the difference between
symmetric and asymmetric key
encryption.
Symmetric key encryption uses single key to
encrypt and decrypt the data. While
asymmetric key encryption uses two keys,

You might also like