0% found this document useful (0 votes)
37 views16 pages

Chapter 1-Data Representation

Igcse computer science

Uploaded by

Faria Adnan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views16 pages

Chapter 1-Data Representation

Igcse computer science

Uploaded by

Faria Adnan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 16

Chapter 1: Number Systems

Q.1. What are Number System?


 “The system of counting and calculating is called number system.”
 Number system is based on some characters called digits.
 The number of digits is known as base of the number system.
 For example: binary number system uses two characters 0 and 1
and its base is 2.
Q.2. Write down the names of number systems used by Computer?
1. Binary Number System
2. Denary (Decimal) Number System
3. Hexadecimal Number System
Q.3. What is binary number system?
 The number system which is based on 2 characters:0 and 1
Q.4. What is denary number system?
 The number system based on 10 characters: 0 to 9
Q.5.What is Hexadecimal number system?
 The number system based on 16 characters: 0 to 9 , A,B,C,D,E and F
 A=10, B=11, C=12, D=13, E=14, F=15
Q.6. Write down the uses of hexadecimal number system?
1. Error Codes
2. HTML Color Codes
3. MAC Address
4. IPv6 Address
Q.7. How are hexadecimal numbers used in error codes?
 Error codes are often shown as hexadecimal values.
 These values refer to the memory location of the error
 They are automatically generated by the computer.
 The programmer needs to know how to interpret the hexadecimal
error codes.
Q.8. How are hexadecimal numbers used in Mac address?
 MAC Addresses are unique number of Network Interface Card
(NIC)
 They are 48 bit long, converted in 12 hexadecimal digits making
them short and easier to understand.
 First half is the identity number of the manufacturer of the device
 Second half is the serial number of the device
Q.9. How are hexadecimal numbers used in HTML?
 Hexadecimal are used in HTML to represent color codes.
FFFFFF - White FF0000 – Bright Red
Q.10. How are hexadecimal numbers used in IP address?
 Each device connected to a network is given an address know as
the Internet Protocol (IP) address.
 An IPv4 address is a 32-bit number written in denary or
hexadecimal form and a dot is used in between.
 An IPv6 address is a 128 bit number broken down into 16-bit
chunks, represented by hexadecimal and a colon is used in
between.
IPv4 address – 12.13.4a.56
IPv6 address – a1bc:2c44:555h:768j:2085:fff0
Addition Of Binary Numbers:
Conversions:
Binary to Denary:
 Each time a 1-value appears in a binary number column, the column
value (heading) is added to a total.

Denary to Binary:
 Show the denary number in the binary register.

Binary to Hexadecimal:
 Starting from the right and moving left, split the binary number into
groups of 4 bits. If the last group
has less than 4 bits, then simply
fill in with 0s from the left. Take
each group of 4 bits and convert
it into the equivalent
hexadecimal digit.
Hexadecimal to Binary:
 Simply take each hexadecimal
digit and write down the 4-bit
code which corresponds to the
digit.
Hexadecimal to Denary:
 Value headings of each hexadecimal digit; that is, 4096, 256, 16
and 1. Take each of the hexadecimal digits and multiply it by the
heading values. Add all the resultant totals together to give the
denary number.

Denary to Hexadecimal:
 Successive division by 16 until the value “0” is reached.
Q. What is 2’s complement?
 It is a method of representing negative numbers in binary.
 When applied to an 8-bit register, the left-most bit (most significant
bit) is given the value -128.
 The left-most bit always determines the sign of the binary number.
1. 1-value in the left most bit indicates a negative number.
2. 0-value in the left most bit indicates a positive number.
Method
1.Write 79 in binary
2.Invert the binary digits
3.Add 1 to the inverted number.
4.Thus giving -79

Q. What is overflow error?


 The maximum denary value of an 8-bit binary register is 255. The
generation of a 9th bit is a clear indication that the sum has
exceeded this value. This is known as an overflow error.
 Overflow error clearly indicates that a number is too big to be
stored in the computer using 8 bits.
 The greater the number of bits which can be used to represent a
number then the larger the number that can be stored.
Q. What is logical binary shifts?
 Computer can carry out a logical shift on a sequence of binary
numbers.
 The logical shift means moving the binary number to the left or to
the right.
 Each shift left is equivalent to multiplying the binary number by 2
 Each shift right is equivalent to dividing the binary number by 2.
Q. What is character sets?
 A list of characters that have been defined by computer hardware
and software.
 The character set is necessary so that the computer can
understand human characters.
Q. What is ASCII Code?
 It is a character set for all characters on a standard keyboard and
control codes.
 The standard ASCII code character set consists of 7-bit codes that
represents letters, numbers and characters found on a standard
keyboard, together with 32 control codes.
Q. What is Extended ASCII Code?
• Extended ASCII uses 8-bit codes.
• This gives another 128 codes to allow for characters in non-English
alphabets and some graphical characters to be included.
Q. What is the disadvantage of ASCII Code?
• It does not represent characters in non Western (except for english)
languages, for example Chinese characters.
• Different methods of coding have been developed over the years.
One coding system is Unicode.
Q. What is Unicode?
• A character set which represent all the languages of the world (the
first 128 characters are same as ASCII code).
• It is also supporting many operating systems, search engines and
internet browser used globally.
• ASCII uses one byte to represent a character , whereas Unicode will
support up to four bytes per character.
Q. How are sounds stored in computer?
 Sound waves are vibration in the air. The human ear senses these
vibration and interpret them as sound.
 Each sound wave has frequency, wave length and amplitude.
 The amplitude specifies the loudness of the sound.
 Sound waves are continuous. This means that sound is analogue.
 Computers cannot work with analogue data, so sound waves need
to be sampled in order to be stored in a computer.
 This is done using an analogue to digital converter(ADC).
 To convert the analogue data to digital, the sound waves are
sampled at regular time intervals. The amplitude of the sound
cannot be measured precisely, so approximate values are stored.
Sampling Resolution: The number of bits used to represent sound
amplitude in digital sound recording (also known as bit depth )
Sampling Rate: The number of sound samples taken per second in
digital sound recording.
Q. How is sampling used to record a sound clip?
 The amplitude of the sound wave is first determined at set time
intervals (the sampling rate)
 This gives an approximate representation of the sound wave
 Each sample of the sound wave is then encoded as a series of
binary digits.
 Using a higher sampling rate or larger resolution will result in a
more faithful representation of the original sound source.
 However, the higher the sampling rate and/or sampling resolution,
the greater the file size.
Q. Write down the benefits and drawbacks of using a larger sampling
resolution.
Benefits:
1. Larger dynamic range
2. Better sound quality
3. Less sound distortion
Drawbacks:
1. Produces larger file size
2. Takes longer to transmit/ download music files
3. Requires greater processing power
Q. What are bitmap images?
 Bitmap images made up of pixels (picture element).
 An image is made up of a two-dimension matrix of pixel.
 Pixels can take different shapes.
 Each pixel can be represented as a binary number, and so a bitmap
image is stored in a computer as a series of binary numbers.
 A black and white image only requires 1 bit per pixel- means that
each pixel can be one of two colours, corresponding to 0 or 1.
Q.What is colour depth?
 The number of bits used to represent each colour is called the
colour depth.
 Increasing colour depth also increases the size of the file when
storing image.
 An 8-bit colour depth means that each pixel can be one of 256
colours (28 =256)
 Modern computers have a 24 bit colour depth.
Image resolution: number of pixels in the image.
Q. What is the drawback of high resolution image?
 High resolution image increase the file in size.
 As the number of pixels used to represent the image is increased,
the size of the file is also increase.
 It also impact on the time to download an image from the internet
or the time to transfer image from device to device .
Q. How to calculate file size?
 The calculation of file size required to hold a bitmap image and a
sound sample.
 File size of image= image resolution (in pixels) x color depth (in
bits)
 File size of sound= sample rate(in Hz) x sample resolution ( in bits)
x length of sample (in seconds)
Q. What is Data Compression?
 It is the reduction of the size of the file by removing repeated or
redundant pieces of data; this can be lossy or lossless.
Q. Why is it necessary to reduce the size of the file?
 It is necessary to reduce the size of the file due to the following
reasons.
1. To save storage space on the devices such as the hard disk
drive/solid state drive
2. To reduce the time taken to stream a music or video file.
3. To reduce the time taken to upload /download or process a file
across a network
4. The download/upload process uses up network bandwidth- this
is the maximum rate of transfer of data across the network,
measured in bits per second.
5. Reduced file size also reduce the cost.
Q. What is Lossy file compression?
 With this technique, the file compression algorithm eliminates
unnecessary data from the file.
 This means the original file cannot be reconstructed once it has
been compressed.
 Lossy file compression results in some loss of details when
compared to the original file.
 The algorithm used in this technique must decide which part of a
file needs to be retained and which parts can be discarded.
 Lossy files are smaller than lossless files which is of great benefit
when considering storage and data transfer rate requirements.
 For example, when applying a lossy file compression algorithm to:
1. An image may reduce the resolution and/or the bit/color depth.
2. A sound file may reduce the sampling rate and/or the resolution.
 Common lossy file compression algorithms are.
1. MPEG-3 (MP-3) and MPEG-4(MP-4) 2. JPEG
Q. Why is Lossless file compression?
 With this technique, all the data from the original uncompressed
file can be reconstructed.
 This is particularly important for files where any loss of data would
be disastrous
 Lossless file compression is designed so that none of the original
detail from the file is lost.
 RLE (Run-length encoding) can be used for lossless compression of
a number of different file formats.
Q. Describe MPEG-3(MP3).
 MPEG-3(MP-3) uses technology known as AUDIO COMPRESSION to
convert music or other sounds into an MP3 file format.
 This compression technology will reduce the size of normal music
file by about 90%.
 MP3 files are used in MP3 players, computer or mobile phones.
 MP3 audio compression reduces a file size through:
1.Perceptual music shaping
2.Reducing the audio bitrate.
Perceptual Music Shaping:
 Perceptual music shaping refers to the process of removing
inaudible sounds in order to make a file size smaller.
 Inaudible sounds may include:
1. Noises at frequencies that humans cannot hear
2. Quiet sounds that cannot be heard over louder sounds.
Reducing the audio bitrate:
 In audio files, the bitrate is the number of bits that need to be
processed every second.
 This is measured in kilobits per second.
 The bigger the bitrate, the better the sound quality, but the larger
the file size.
 So by reducing the audio bitrate, the sound / audio file could be
compressed.
Q. Describe MPEG-4 (MP4).
 MP4s are video files (with audio) compressed using lossy
compression.
 MPEG-4 (MP-4) files are slightly different to MP3 files . This format
allows the storage of multimedia files rather than just sound.
 Music, videos , photos and animation can be stored in the MP4
format.
 Videos could be streamed over the internet using MP4 format
without losing any real discernable quality.
Q. Describe jpeg files.
 JPEG stands for Joint Photographic Experts Group.
 JPEG files use a lossy format file compression method.
 JPEG is used to store photographs as a reduced file image.
 JPEG file reduction process is based on two key concepts.
 They rely on certain properties of the human eye (i.e. inability to
detect small brightness differences or colour hues).
 Human eyes do not detect differences in colour shades quite as well
as they detect differences in image brightness.
 By separating pixel colour from brightness, which then allows
certain ‘information’ to be discarded from the image without
causing any real noticeable deterioration in quality.
Q. What is Run-length encoding (RLE)?
 It is a lossless file compression technique used to reduce the size of
text and photo files in particular.
 It reduces the size of string of adjacent, identical data (e.g. repeated
colours in an image)
 A repeated string is encoded into two values:
 The first value represents the number of identical data items (e.g.
characters) in the run
 The second value represents the code of the data item(such as
ACSII code if it is a keyboard charecter)
 RLE is effective where there is a long run of repeated units/bits).
Units of Conversion:
Denary: (1024)

Use these:

You might also like