4.5 Data representation Flashcards

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

Write down the natural numbers

A

{ 0, 1, 2, 3, …}

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

What are ordinal numbers?

A

Natural numbers used to describe the numerical position of a value. e.g. in the alphabet (1st 2nd etc.)

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

Why use hexadecimal?

A

Long sequences of binary digits are hard for humans to read and understand, so hexadecimal is often used as a shorthand

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

How many bytes in a megabyte?

A

One million

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

How many bytes in a mebibyte?

A

1024^2 (or 2^20)

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

List the prefixes starting kibi…

A
  • kibi
  • mebi
  • gibi
  • tebi
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the significance of the leftmost bit in two’s complement?

A

The most significant bit (leftmost) is the sign bit, which represents a negative number when set to 1

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

What is 1111…111 in two’s complement binary?

A

-1

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

Range of 8 bits for:
1. unsigned binary number
2. two’s complement number

A

Unsigned: 0 to 255
Two’s complement: -128 to 127

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

The sum of two 8-bit two’s complement binary numbers can be between ___ and ___

A

-128 and 127
(Can ignore the overflow in this case)

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

How to turn a negative number into a positive number in two’s complement (and vice versa)?

A
  1. From the right, up to and including the first 1 stays the same.
  2. Everything other value gets flipped.

(This is the same as flipping everything then adding 1)

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

How to subtract two binary numbers A - B?

A
  • Convert B into two’s complement
  • Add this to A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How can you identify normalised floating point numbers?

A

Mantissa must begin with 01 or 10

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

2 advantages of normalisation of floating point numbers

A
  1. It maximises precision for a given number of bits
  2. It ensures that there is a unique representation of each number, making it simpler to test for equality of numbers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

If the exponent of a number is negative, what do you need to do to the mantissa when converting from binary to decimal?

A

Fill in with 0s if the leftmost bit is a 0, and fill in 1s if its a 1.

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

Advantages of fixed point binary numbers

A
  • More representable numbers, as numbers don’t need to be normalised
  • Maximum precision for the given number of bits
  • Can be simpler, and faster, to work with
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

3 advantages of floating point numbers

A
  • Can represent a much larger range of numbers
  • The trade-off between range and precision can be tailored to the context the system is being used in
  • Additional non-numeric values can be represented using the unnormalised range (e.g. NaN, infinity)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is meant by the precision of a binary number?

A

The maximum number of significant digits that can be represented in a number format.

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

When the result of an arithmetic operation is a real number (e.g. pi), what options are there for storing it in binary?

A
  • Rounding to the nearest representable value
  • Truncating
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is absolute error?

A

The difference between the actual value and the nearest representable value

(always positive)

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

What is relative error?

A

The absolute error ÷ the actual value
(could be given as 0.05, 1/20 or 5%)

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

When does overflow occur?

A

When a number is too large to be represented using the available number of bits

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

When does underflow occur?

A

When a number is too small to be represented using the available number of bits

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

What is a character set?

A

A character set is a standardised collection of characters and the bit-patterns used to represent them

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

How many bits does ASCII use? How many characters can it represent?

A
  • ASCII uses 7 bits to represent characters (hence max 128 characters)
  • However, 8 bits are used to store each character (preceding 0)
  • The leading 0 sometimes used as parity bit instead
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

How does ASCII work?

A
  • Each of the characters is assigned a denary character code
  • Which is represented and stored in the computer as binary
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

What is the downside of ASCII?

A

ASCII is not sufficient to represent all of the languages and scripts used around the world

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

Why is unicode needed?

A
  1. ASCII can’t represent all languages and scripts
  2. ASCII can’t represent all possible symbols
  3. The World Wide Web made it important to have a universal international coding system
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

Which is the most common unicode encoding standard used?

A

UTF-8

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

How does UTF-8 (unicode) use variable width encoding?

A

UTF-8 can be expanded to a greater number of bits when dealing with larger sets of characters

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

What are the first 128 codes in unicode the same as?

A

The first 128 codes in ASCII

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

Example of where parity bits are typically used

A

In the transmission of 7-bit standard ASCII codes

33
Q

What is a downside of majority voting?

A

If you choose a large odd number of repetitions, there is lots of redundant information that needs to be transmitted across the channel

34
Q

What is a checksum? (3*)

A
  • A checksum is a piece of data that is added to a block of data to enable error detection.
  • It is produced by applying a checksum algorithm (often MOD to limit magnitude of checksum).
  • The receiver recalculates the checksum and if it doesn’t match the data’s checksum then there is an error in the data
35
Q

What is a check digit? (3*)

A
  • An extra digit that is placed at the beginning or end of a number and is used to identify a product or verify a user
  • It allows for error detection
  • They are produced by algorithms that often use modulo arithmetic
36
Q

What is a bitmapped graphic made of?

A

A grid of pixels

37
Q

What is a pixel?

A
  • Pixel is short for picture element
  • It is the smallest addressable area of an image
38
Q

What is colour depth?

A

The number of bits used to represent the colour of a single pixel in a bitmap image

39
Q

What determines the minimum colour depth?

A

The number of different colours that need to be used in an image

40
Q

What is the image size in pixels?

A

(image width in pixels) * (image height in pixels)

41
Q

What is the image resolution measured in?

A

dots per inch (ppi)

42
Q

How do you calculate image file size? (ignoring metadata)

A

file size
= (image size in pixels) x colour depth
= (image width in pixels) x (image height in pixels) x colour depth

43
Q

5 examples of metadata for a bitmap image

A
  • Image width in pixels
  • Image height in pixels
  • Colour depth
  • File format
  • Geographical location of creation
44
Q

How are vector graphics stored?

A
  • Images are described using a list of objects.
  • The properties of each object in the vector graphic image are also stored as a list
45
Q

5 examples of properties of objects in a vector graphic image

A
  • Coordinates of object
  • Shape
  • Border colour
  • Fill colour
  • Border thickness
46
Q

3 advantages of vector graphics

A
  1. Vectors can be enlarged without distortion, whereas bitmapped graphics can look pixelated when the size changes
  2. In general, vector graphics tend to result in smaller file sizes. Especially when they are composed of relatively simple geometric shapes
  3. It is much simpler to create and edit vector graphic images as each object in a vector graphic can be adapted independently by accessing its set of attributes
47
Q

What is the advantage of bitmapped graphics?

A
  • The variety of images that can be created by the geometric shapes implemented by vector graphics is limited.
  • On the other hand, bitmapped graphics can depict almost any level of complexity and detail.
  • Photographs are always stored as bitmaps.
48
Q

What are vector graphics mostly used for?

A

Illustrations and logos

49
Q

What is symmetric encryption?

A

When the same key is used for both encryption and decryption

50
Q

What does computationally secure mean for a cipher?

A

A cipher is computationally secure if it cannot be cracked in ‘reasonable time’.

51
Q

What are disadvantages of Caesar cipher?

A
  • Easy to crack because there are only 25 keys
    • → so very quick to crack with brute force
  • Frequency analysis reveals the likely shift
  • Word structure is preserved
  • Key length is such shorter than the message
  • So NOT computationally secure
52
Q

What is encryption?

A

The process of converting plaintext to ciphertext, so that it cannot be understood if intercepted

53
Q

What is special about a Vernam cipher key?

A
  • The key is randomly generated, or taken from a ‘one-time pad’.
  • and key length = plaintext length
54
Q

What operation does the Vernam cipher use for encryption and decryption?

A

XOR

55
Q

What are the 5 conditions for perfect security?

A
  • Key is chosen truly randomly
  • Key is only used once
  • Key is known only to the sender and receiver
  • Key must be destroyed after use
  • Key length at least message length
56
Q

What does MIDI stand for?

A

Musical Instrument Digital Interface

57
Q

Describe what MIDI is and what its purpose is

A
  • MIDI is a technical standard that describes
    1. A protocol
    2. Digital interface
    3. Standard set of connectors
  • MIDI allows for a wide range of electronic musical instruments to communicate with each other so as to manipulate music
58
Q

Describe the use of event messages in MIDI. Include examples of event messages.

A

Event messages are a list of instructions that specify how the music should be played. For example
- Note on / note off
- Pitch
- Volume
- Instrument
- Vibrato

59
Q

3 advantages of using MIDI files for representing music

A
  • A MIDI file provides a more compact representation of sound, often leading to MIDI files using far less storage than an equivalent sampled recording.
  • The performance data can be easily manipulated (e.g. duration of a note can be changed, or even an entire instrument)
  • No information about a note is lost through sampling
60
Q

Difference between analogue data and digital data

A
  • Analogue ​data is ​continuous​, there are ​no limits​ to the values that the data can take
  • Digital data is ​discrete​, meaning that it can only take ​particular values​.
61
Q

Where do ADCs get the analogue signal from?

A

Analogue sensors

62
Q

Most common use for a DAC?

A

Converting a digital audio signal to an analogue audio signal

63
Q

Why are files compressed?

A
  • To reduce their size
  • Smaller files can be transferred faster between storage devices or over the internet
64
Q

What is lossy compression?

A
  • When the file is compressed, there is loss of information from the original version.
  • When decompressed, the file will be lower quality than the original
65
Q

Name two methods of lossless compression

A
  • Run length encoding
  • Dictionary-based compression
66
Q

How does run length encoding work?

A

RLE reduces the size​ of a file by removing ​repeated information​ and replacing it with ​one occurrence ​of the repeated information followed by the number of times​ it is to be repeated

67
Q

When are RLE and dictionary-based compression most effective?

A

On files that contain a lot of repeated data

68
Q

True or False: relative error is always given as positive

A

True (in this A-level)

69
Q

What is sampling rate measured in?

A

Hertz

70
Q

What does Nyquist’s theorem state?

A

The sampling rate must be at least double the highest frequency present in the signal

71
Q

What is the advantage of lossless compression?

A

The size of a file can be reduced without decreasing its quality (there is no loss of information)

72
Q

What is the key difference between lossy and lossless compression?

A

Lossy : original data cannot be recovered. lossy compression cannot be reversed

Lossless : original data can be fully recovered. lossless compression can be reversed

73
Q

Describe how dictionary-based compression could be used on a paragraph of text

A
  1. Each word in the text is allocated a shorter code
  2. The paragraph is then represented as a sequence of these codes
  3. The dictionary containing the repeated data is appended to the file
74
Q

What is a bit?

A
  • The fundamental unit of information
  • A bit is either 0 or 1
75
Q

What does ASCII stand for?

A

American Standard Code for Information Interchange

76
Q

If the actual number is A, but B is stored, what is the absolute error?

A

|A-B|
absolute error is positive

77
Q

Describe the principles of operation of an ADC

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

4 reasons the Vernam cipher can be considered perfectly secure

A
  • Key length = plaintext length
  • The ciphertext contains no useful information about the plaintext
  • Bruteforce would reveal every possible plaintext
  • Frequency analysis does not help as ciphertext letters have uniform probability