5: Fundamentals of Data Representation Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Natural Numbers

A

N = {0, 1, 2, 3, …}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Integers

A

Z = {…, -3, -2, -1, 0, 1, 2, 3, …}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Rational Numbers

A

Q - the set of numbers that can be written as a fraction (includes integers)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Irrational Numbers

A

The set of numbers that can’t be written as a fraction

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Real Numbers

A

R - the set of all possible real world quantities (includes natural, rational & irrational numbers)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Ordinal Numbers

A

Describe the numerical position of an object in a list

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Counting & Measurement

A

Natural numbers are used for counting and real for measurement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Number Bases (3)

A
  • Decimal (base 10)
  • Binary (base 2)
  • Hexadecimal (base 16)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Benefits of using Hexadecimal as Shorthand for Binary (4)

A
  • Numbers are more compact when displayed
  • It is easier for people to understand and read
  • There is a lower likelihood of an error when typing in data
  • It saves the programmer time when typing in data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Bit

A

Fundamental unit of information (0 or 1)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Byte

A

A group of 8 bits

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Binary Values Representable with n Bits

A

2ⁿ

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Binary Prefixes (4)

A
  • Kibi, Ki – x2^10
  • Mebi, Mi – x2^20
  • Gibi, Gi – x2^30
  • Tebi, Ti – x2^40
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Decimal Prefixes (4)

A
  • Kilo, k – x10^3
  • Mega, M – x10^6
  • Giga, G – x10^9
  • Tera, T – x10^12
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Unsigned vs Signed Binary

A

Unsigned binary can only represent positive numbers (has a sign bit of 0) whereas signed binary can represent both positive & negative

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Minimum & Maximum Values in Unsigned Binary

A

For n bits: 0, 2ⁿ - 1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Unsigned Binary Arithmetic (2)

A
  • Add two integers
  • Multiply two integers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Two’s Complement

A

A possible coding scheme for signed binary

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Signed Binary Operations (2)

A
  • Represent negative and positive integers
  • Perform subtraction
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Minimum & Maximum Values in Signed Binary using Two’s Complement

A

For n bits: -2ⁿ⁻¹, 2ⁿ⁻¹ - 1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Convert Signed Binary to Decimal (4)

A
  • Flip bits
  • Add 1
  • Convert to decimal as unsigned binary
  • Flip the sign
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Convert Negative Decimal to Signed Binary (4)

A
  • Flip sign
  • Convert to unsigned binary
  • Flip bits
  • Add 1
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Perform Binary Subtraction (2)

A
  • Convert the number, which is being subtracted, into signed binary
  • Add the two binary numbers ignoring the overflow bit
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Fixed Point Form

A

Numbers with a fractional part can be represented using fixed point form in binary, where the binary point is programmed into the system not stored in the data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

Numbers with a Fractional Part Conversions (2)

A
  • Decimal to binary in a given number of bits
  • Binary to decimal in a given number of bits
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

Convert 0011 1001₂ to Decimal (4 Bits Before & After Binary Point)

A

8x0 + 4x0 + 2x1 + 1x1 + 0.5x1 + 0.25x0 + 0.125x0 + 0.0625x1
= 2 + 1 + 0.5 + 0.0625
= 3.5625₁₀

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

Convert 3.5625₁₀ to 8-bit binary (4 bits before and after binary point)

A

3.5625 - 2 = 1.5625
1.5625 - 1 = 0.5625
0.5625 - 0.5 = 0.0625
0.0625 - 0.0625 = 0
0011 1001₂

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

Differentiation between Decimal Digit Representations

A

Can be represented as a character code or pure binary (e.g., 65₁₀ is ‘A’ in ASCII but 01000001₂ in binary)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

ASCII (3)

A
  • Uses 7 bits to encode characters
  • Can represent 128 different characters
  • Extended ASCII has been developed, which uses 8 bits to encode characters
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

Unicode (3)

A
  • Introduced to support a larger range of characters than ASCII
  • Due to increased international communication and use of files in multiple countries
  • Each character code is always interpreted as the same character
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

Error Checking & Correction Methods (4)

A
  • Parity bits
  • Majority voting
  • Checksums
  • Check digits
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

Parity Bits (3)

A
  • Two types of systems: even & odd parity
  • Transmitting computer attaches a parity bit to start of binary to make number of 1s in binary odd / even (e.g., for even: 0101 → 00101 & 0100 → 10100)
  • Receiving computer checks there are odd / even number of 1s in binary
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

Parity Bits Disadvantages (2)

A
  • Cannot detect all errors (e.g., if two bits change)
  • Doesn’t show where error is, only that error has occurred
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

Majority Voting (2)

A
  • Each bit is transmitted multiple times
  • The receiver checks the bits it has received and if they are not all the same it assumes the one it received the most copies of is the correct value for the bit
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

Majority Voting Disadvantages (3)

A
  • If there are multiple errors in a group of 3 bits, the receiving computer will correct the final bit wrongly and assume that is correct
  • Transmission time is 3 times longer
  • Increased processing time
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

Checksums (3)

A
  • Checksum is a number which is calculated from the data in the packet
  • Checksum is recalculated when packet is received
  • If the checksum received in packet matches the recalculated checksum then data has been received correctly
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q

Checksums Disadvantages (2)

A
  • Multiple bits can change without changing the checksum value resulting in an undetected error in the data
  • Doesn’t tell the receiver how to correct the error
38
Q

Check Digits (4)

A
  • A check digit consists of a digit calculated using an algorithm from the other digits in the input sequence
  • The digit is added to the end of the data and then transmitted
  • The receiving computer applies the same algorithm
  • If the two check digits are the same, the data is deemed as correct
39
Q

Check Digits - (2)

A
  • Increased transmission length
  • Increased processing time
40
Q

Bit Patterns

A

Can represent various forms of data (e.g., text, numbers, graphics & sound) by storing and reading data as a string of binary numbers

41
Q

Analogue Data (2)

A
  • Wave is recorded in its original form and continuously varying quantities are measured
  • Uses a continuous range of values to represent information
42
Q

Digital Data (2)

A
  • Waves are sampled at intervals, converted to a discrete set of numbers and stored
  • Quantities are counted and it uses discrete values to represent information
43
Q

Analogue Signal

A

A continuous signal, which represents a physical wave

44
Q

Digital Signal

A

A discrete signal generated at regular time intervals

45
Q

Analogue to Digital Converter – ADC (3)

A
  • Analogue signal sampled at regular time intervals
  • Amplitude of signal measured at each sample point
  • Measurement coded into a fixed number of bits
46
Q

Digital to Analogue Converter – DAC (3)

A
  • Takes a binary value
  • Converts the digital data to an analogue signal
  • DACs are speakers
47
Q

Representation of Bitmaps

A

Represented by lots of pixels (the smallest addressable element of a picture), whose colours are represented by binary codes

48
Q

Bitmap Resolution

A

Number of dots (pixels) per inch; determines image quality and sometimes used to describe the size of an image

49
Q

Colour Depth

A

Number of bits stored per pixel; determines the number of different colours each pixel can represent

50
Q

Bitmap Size in Pixels

A

Width of image in pixels x Height of image in pixels

51
Q

Storage Requirements for Bitmapped Images

A

Size in pixels x Colour depth

52
Q

Typical Metadata for Bitmap Image File (5)

A
  • Width
  • Height
  • Colour depth
  • File type
  • File size
53
Q

Digital Representation of Sound (4)

A
  • Microphone picks up sound
  • ADC samples sound at regular time intervals
  • Samples are quantised – approximated to an integer value
  • Binary value representing sample is stored
54
Q

Sample Rate

A

Number of samples per second – measured in Hertz (Hz)

55
Q

Sample Resolution

A

Number of bits used to store each sample (usually 16 bits)

56
Q

Higher Sample Rate & Resolution (2)

A
  • Better quality / resolution
  • Larger file size
57
Q

Nyquist Theorem (3)

A
  • To properly measure all frequencies, the sample rate must be double the highest frequency in the original sound
  • Humans can hear frequencies from 20 Hz to 20 kHz
  • Hence, most recordings have a sample rate of 44.1 kHz
58
Q

Sound Sample Size

A

Sample rate x Sample resolution x Time (s)

59
Q

Musical Instrument Digital Interface (1, 1:4, 6)

A
  • Music represented as sequence of MIDI event messages
  • Examples of data in event messages:
    • Channel
    • Note on / note off
    • Pitch
    • Volume / loudness
  • MIDI messages are usually two or three bytes long
  • First byte of each MIDI message is a status byte and others are data bytes
  • Bit rate is 3 250 bits per second
  • MSB value of 1 indicates status byte, 0 indicates data bytes
  • Status bytes are divided into a command and a
    channel number (4 bits for each)
  • Sixteen channels are supported
60
Q

Advantages of MIDI File over Conventional Sound File (8)

A
  • More compact representation
  • Easy to modify notes
  • Easy to change instruments
  • Simple method to compose algorithmically
  • Musical score can be generated directly from a MIDI file
  • No data lost about musical notes
  • The MIDI file can be directly output to control a device
  • MIDI records the musician’s inputs rather than the sound produced
61
Q

Reasons for Compressing Image & Sound Files (3)

A
  • Take up less storage space
  • Faster transmission times
  • To fit within certain system restrictions (such as, e-mail attachment restrictions)
62
Q

____ can also be compressed

A

Other files, such as text files

63
Q

Lossless Compression

A

No data is lost about the original image in compression

64
Q

Lossy Compression

A

Data is lost about the original image in compression

65
Q

Lossless Compression +/- (4)

A

+ The file can be reproduced exactly as it was originally
+ The quality of image / sound / video would not be reduced
- Less effective at reducing file size than lossy
Used for executable and text files

66
Q

Lossy Compression +/- (4)

A

+ Much lower file sizes
- Loss in quality of image / sound / video
- Lossy compression cannot be reversed
Used for image, video and sound files

67
Q

Techniques for Lossless Compression (2)

A
  • Run length encoding (RLE)
  • Dictionary-based methods
68
Q

Run Length Encoding – RLE (3)

A
  • Reduces the size of a run (repeated string)
  • Encodes run into two values:
    1. Run count: Number of repeated characters in a run
    2. Run value: Value of each character
  • Does this for every run in data
69
Q

Dictionary-Based Methods (3)

A
  • Variable length strings of symbols (substrings) of original data are represented by single tokens
  • A dictionary is formed using the tokens as the keys
  • The strings of symbols are used as the entries
70
Q

Encryption

A

The encoding of a message, converting plaintext to ciphertext, so that other parties cannot read it. The message can only be decrypted by the authorised receiver

71
Q

Cipher

A

An algorithm that encrypts and decrypts data

72
Q

Plaintext

A

Unencrypted data

73
Q

Ciphertext

A

Encrypted data

74
Q

Caesar Cipher (2)

A
  • Each letter in the plaintext is substituted by the letter, which is a set number of places ahead of it in the alphabet / character code tables, to produce the ciphertext
  • The set number of places is called the key
75
Q

Why is Caesar Cipher Easily Cracked? (2)

A
  • There are only 26 different values for the key
  • You can use frequency analysis to find the most common letter in the ciphertext. This letter’s displacement from e (usually the most frequent letter in the plaintext) is likely to be the key
76
Q

Vernam Cipher (4)

A
  • A completely random key (equal in length to the plaintext) is generated
  • A bitwise logical XOR operation is performed on the Baudot character codes of each of the corresponding characters of the plaintext and key
  • The string of characters represented by the resultant character codes is the ciphertext
  • To decrypt, perform the same steps with the same key but using the ciphertext instead of the plaintext
77
Q

Why does Vernam Cipher have Perfect Security?

A

Frequency analysis does not provide any clues to the ciphertext

78
Q

Vernam Cipher vs Computationally Secure Ciphers (4)

A
  • Vernam cipher (if implemented correctly) is unbreakable
  • Frequency analysis of ciphertext reveals nothing about plaintext
  • More possible keys
  • Vernam cipher does not always translate a ciphertext character to the same plaintext character
79
Q

Convert 01101011 to Decimal (floating point form: 5-bit mantissa, 3-bit exponent)

A

Exponent: 3
Mantissa: 0.1101 -> 0110.1 = 6.5

80
Q

Convert 10101110 to Decimal (floating point form: 5-bit mantissa, 3-bit exponent)

A

Exponent: -2
Mantissa: 1.0101 -> -0.1011 -> -0.001011 = -0.171875

81
Q

Rounding Errors (3)

A
  • To represent a decimal number in binary, the fractional part needs to be broken down into a sum of fractions with denominators of powers of two (binary fractions)
  • This is not always possible for some fractional parts or there are not enough bits to do so
  • Hence, fixed and floating point representations of decimal numbers may be inaccurate
82
Q

Fixed Point vs Floating Point (3)

A
  • Floating point form has a larger range of possible numbers than fixed point form if more bits are used in the exponent
  • Floating point form has a larger precision than fixed point form if more bits are used in the mantissa
  • Calculations using floating point form are slower than calculations using fixed point form
83
Q

Normalising Floating Point Numbers + (2)

A
  • Maximises precision for given number of bits
  • Unique representation of each number
84
Q

A normalised positive number starts as ____

A

0.1

85
Q

A normalised negative numbers starts as ____

A

1.0

86
Q

Overflow (2)

A
  • Occurs when the result of a calculation is too large to be represented with the available number of bits
  • Can arise due to addition of two numbers of the same sign
87
Q

Underflow (2)

A
  • Occurs when the result of a calculation is too close to 0 to be represented with the available number of bits
  • Can arise from subtracting two numbers with similar values and the same sign
88
Q

Vector Graphics

A

Images made up of a drawing list of geometric objects / shapes whose properties are stored as a list

89
Q

Examples of Typical Properties of Objects in Vector Graphics (5)

A
  • Centre of a circle
  • Radius of a circle
  • Fill colour of a shape
  • Position of a shape
  • Side length of a square
90
Q

Vectors Graphics + (4)

A
  • Can be scaled without loss of quality
  • Small file sizes
  • Easy to manipulate the objects
  • If an object is deleted, the software knows what is behind it
91
Q

Bitmap Graphics + (2)

A
  • Can represent a wide range of images
  • Can depict any level of complexity and detail
92
Q

Uses of Vector & Bitmap Graphics (1:4, 1)

A
  • Vector:
    • Illustrations
    • Cartoons
    • Logos
    • Web designs
  • Photographs are always stored as bitmaps