You are on page 1of 1

Chapter

1: Data Representation

1. Comparison between the 3 number systems:


Binary Denary Hexadecimal
A system of numbers of A system of numbers of A system of numbers of base 16.
base 2. base 10.
It uses 2 digits, 0 and 1. It uses 10 digits, 0 to 9. It uses 16 digits, 0 to 9 and A to F.
Its place values/ units Its place values/ units Its place values/ units increase by the power
increase by the power of 2. increase by the power of of 16.
10.
It is the only system It is used in daily human It is used for memory dumps, HTML, MAC
understood by the life. addresses, web addresses, and machine
computer. code.
Binary has more digits for Denary has less digits for
the same value. the same value.

2. Memory size measurements:


Unit Abbreviation Conversion Number of bytes as the power of 2
Bit b 1 bit
Byte B 8 bites = 1 byte 20
Kilobyte KB 1024 bytes 210
Megabyte MB 1024 KB 220
= (1024 x 1024) bytes
Gigabyte GB 1024 MB 230
Terabyte TB 1024 GB 240
Petabyte PB 1024 TB 250

3. Conversions and calculations


○ Conversions between number systems:

- E.g. convert the following binary number into denary: 0 0 1 1 0 1 1 1

○ Conversions between memory size measurement:

4. Registers
○ A register is a small piece of memory where bits are held in the CPU.
○ This is an 8-bit register:

○ It may be used as part of a control system.


○ Examples of registers are the MAR and MDR (discussed in chapter 3).

5. Four benefits of hexadecimal in computer science


○ Easier for programmers to read and understand.
○ Easier to debug (find errors).
○ Takes up less space on the screen as fewer digits are used.
○ Smaller display screens can be used.
○ Easier to convert to binary.

6. Five examples where hexadecimal is used in computer science


1. Used in memory dumps when debugging.
a. A memory dump is when the contents of the memory are displayed on a screen
represented by hexadecimal digits.
b. This allows software developers to locate errors.
c. Hexadecimal is shorter than binary so errors are easier to debug.
2. Used in HTML colour notation.
a. Hexadecimal colour notations are 6 digits.
b. The first 2 code for red, the second 2 code for green, and the final 2 code for blue.
c. Different combination of hex digits from 0 to F are combined to create different hex codes
to represent different colour shades.
d. E.g. red is represented as #FF0000.
3. MAC addresses.
a. They are 12-digit hex codes.
b. They uniquely identify each device in a network.
c. E.g. 00-1B-63-84-4A-E6
4. Machine code.
a. Machine code is a low level language.
b. Hexadecimal is used to replace a string of binary bits, which is shorter and easier to
understand by developers.
c. Each byte can be represented as two hexadecimal digits.
d. E.g. 5F 4A 09 F1.
5. ASCII code.
a. The ASCII code represents each alphanumeric character or symbol as a hexadecimal value.
b. E.g. A is represented as %41.

7. Storing text (alphanumeric characters):


○ Alphanumeric characters include text, numbers and symbols.
○ Two systems are used for character representation:
ASCII Unicode
Each character uses 8 bits (1 byte) of Each character uses 16 bits (2 bytes) of storage
storage
This gives a total of 28 (256) possible This gives a total of 216 (65536) possible characters
characters
Suitable for storing characters for Contains a large enough character set for other
Standard English only languages and symbols

8. Storing pictures
○ An image/ picture is made up of pixels.
○ A pixel is the smallest element that makes up a picture.
○ Each pixel is assigned a single colour.
○ Each colour is coded for by a binary value.
○ In the RGB colour system, each colour is denoted by a six digit hexadecimal code (the shade for
red, blue and green is represented by a byte (2 hex digits) for each).
- E.g. #FF0000 is red
○ Metadata: is what tells a computer how many pixels wide and high an image is. This is the
resolution of the image.
○ In high quality/ resolution images, more pixels are used to get the correct colour depth for the
image, so more binary data is used.

9. Storing sound (music)


○ Sound is captured/ recorded.
○ An ADC (analogue to digital convertor) samples the sound wave by recording it at set timed
intervals.
○ The samples are then converted to binary.
○ If the frequency at which the sample is taken (sampling rate) is higher, the sound quality
becomes higher.
○ 1 hertz = 1 sample per second

10. Multimedia standard file formats


○ A file format is a standard way that information is encoded for storage in a computer file.
1. MIDI (Musical Instrument Digital Interface):
a. A standard system associated with the storage of music files, adopted by the electronic
music industry.
b. It is a form of communications protocol allowing musical instruments to interact.
c. It does not store actual sounds, but rather a series commands which instruct a device (e.g.
a computer sound card) how to produce a note/ sound.
- E.g. NOTE on/ off, KEYPRESSURE, etc.
d. Since they do not contain actual audio, their size is considerably small compared to MP3.

2. JPEG (Joint Photographic Experts Group):


a. A form of lossy compression of images.
b. The size of the file is reduced.
c. Leads to reduced quality of the image.
d. Can reduce images down to 5% their original size.
e. Relies on properties of the human eye in its limited ability to detect very slight differences
in brightness and in colour hues.
f. A raw bitmap image (.BMP) is a raw image in its highest quality before being compressed
by JPEG.
g. JPEG reduces the raw bitmap image by a factor between 5 and 15.

3. MP3 (MPEG-3: Motion Picture Experts Group):


a. A form of lossy audio compression.
b. Uses compression algorithms which use perceptual music shaping.
- Removes noises that may not be heard by the human ear.
- Removes background noise.
- Removes softer unnecessary sounds.
c. Able to retain most of the music quality.
d. Reduces the size of a normal music file by about 90%.

4. MP4 (MPEG-4):
a. A standard format for lossy compression of video files.
b. This format allows the storage of multimedia (music, video, photo and animation) files
rather than just sound.
c. Able to retain most of the quality.

11. Data compression


○ Compression algorithms are used to manipulate the data to reduce its size.
○ Smaller file size means less storage space is needed and it is easier to transmit the file across
devices.
Lossy Lossless
All the data bits from the original file are Unnecessary bits of data are removed and it is
reconstructed when the file is again impossible to get the original file back once it
uncompressed. is compressed.
This is important for files where loss of any It is chosen for files where removing certain
data would be disastrous – for example, a bits doesn’t detract from the quality, e.g.
spreadsheet file. multimedia.
Music: background sound, and sounds that can Music: repeating patterns of sounds are
be heard with the human ear are removed. indexed and the pattern is stored along with
This gives a close representation of the original how many times it is repeated.
track without taking much of the quality away.
Image: detail that can go unnoticed when lost Image: repeating patterns of colour (e.g.
is removed. background colour) is stored along with how
many times it is repeated.

○ Reducing the size of a text file:


- Save file as pdf
- Using lossless compression
- Repeated words can be indexed

You might also like