5 - Fundamentals of Data Representation Flashcards

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

What does MIDI stand for?

A

Musical Instrument Digital Interface

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

Describe the advantages of using MIDI files for representing music.

A
  • A MIDI file is a more compact representation than an equivalent sampled recording.
  • The performance data be easily manipulated, for example, it’s easy to change instruments or change the pitch or duration of a note.
  • MIDI supports a very wide range of instruments providing more choices for music production.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Explain how MIDI represents music and the advantages of using MIDI for representing music instead of using sampled sound.

A

Music is represented as a sequence of MIDI event messages. Examples of data that might be contained in a message are channel, volume and note envelope. MIDI messages are usually two or three bytes long and 16 channels are supported.

Advantages:
• More compact representation
• Easy to modify the music, such as change the instrument
• Musical score can be generated directly from a MIDI file

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

How do you add two unsigned binary integers?

eg. 01001101 + 01101010

A

Align the binary numbers and perform column addition.

eg.0 1 0 0 1 1 0 1
0 1 1 0 1 0 1 0  +
──────────
1 0 1 1 0 1 1 1
──────────
¹¹
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do you multiply two unsigned binary integers?

eg. 11011 x 11

A

Align the binary numbers and perform long multiplication.

eg. 110 11
11x
───────
110 11
110 11 0+
─────────
1 0 1 0 0 0 1
─────────
¹¹¹¹¹
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is two’s complement?

A

A method of working with signed numbers using fixed-width binary where the most significant (left most) bit is the sign bit.

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

How do you convert from decimal to signed binary (using two’s complement)?

eg. -97₁₀

A

If the number is negative, place a 1 under the MSB then add a 1 under the column headings which, when added to the value of the MSB, give the number.

eg. -128 + 16 = -112
- 112 + 8 = -104
- 104 + 4 = -100
- 100 + 2 = -98
- 100 + 1 = -97

-128 64 32 16 8 4 2 1
1 0 0 1 1 1 1 1

-97₁₀ → 10011111₂

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

How do you convert from signed binary to decimal (using two’s complement)?

eg. 10011010₂

A

Add up the column heading with a 1 under them (where the MSB is negative).

eg. -128 64 32 16 8 4 2 1
1 0 0 1 1 0 1 0

-128 + 16 + 8 + 2 = -102

10011010₂ → -102₁₀

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

How do you perform binary subtraction using two’s complement?

eg. 0101₂ - 0011₂

A

Turn the value that is being subtracted into a negative, then add the two values.

eg. 0101₂ - 0011₂
→ 0101₂ + (-0011₂)
→ 0101₂ + 1101₂
→ (1)0010₂

a carry is generated which is ignored

0101₂ - 0011₂ → (1)0010₂

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

What is the range of values that can be represented using two’s complement with n bits.

A

the range is -2ⁿ⁻¹ to 2ⁿ⁻¹ - 1

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

What is fixed point binary?

A

Fixed point binary is a method of representing numbers with a fractional part, where the binary point is in a fixed position.

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

How do you convert from fixed point binary to decimal?

eg. 0110.0110₂

A

Set up the correct column headings according to where the point is positioned. Then add up the values of the column headings with a 1 under them.

eg. 8 4 2 1 . ½ ¼ ⅛ ¹⁄₁₆
0 1 1 0 . 0 1 1 0

4 + 2 + ¼ + ⅛ = 6.375₁₀

0110.0110₂ → 6.375₁₀

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

How do you convert from decimal to fixed point binary?

eg. 10.6875₁₀ (8 bits where the binary point is between the 4th and 5th bits)

A

eg. 10.6875 - 8 = 2.6875
2. 6875 - 2 = 0.6875

    0. 8675 - ½ = 0.1875
    0. 1875 - ⅛ = 0.0625
    0. 0625 - ¹⁄₁₆ = 0

8 4 2 1 . ½ ¼ ⅛ ¹⁄₁₆
1 0 1 0 . 1 0 1 1

10.6875₁₀ → 1010.1011₂

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

How do you convert from floating point binary to decimal?

eg. 0100100100 000100

A

Convert the exponent and move the binary point accordingly (adding preceding 1s for negative mantissa and 0s for positive mantissa for negative exponents). Then convert to decimal.

eg. exponent → 4
0. 100100100 → 01001.00100 → 9.125

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

How do you convert from decimal to floating point binary?

eg. 12.125

A

Convert to fixed point binary move the binary point so that it’s normalised (when the first two bits are different) and convert the exponent to binary.

eg.  -16 8  4  2  1  . ½  ¼  ⅛
         0  1   1  0  0 .  0   0   1 
       01100.001 → 0.1100001
       exponent = 4 → 000100
       → 01100001 000100
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How do you calculate the absolute error?

A

approximate value - original value |

17
Q

How do you calculate the relative error?

A

Absolute error ÷ original value

Then converted to a percentage

18
Q

What are the advantages of using a normalised representation for floating point numbers?

A
  • Maximises precision for a given number of bits

* There is a unique representation of each number

19
Q

How do you normalise un-normalised floating point numbers?

eg. 00001011 0101

A

Move the binary point so that the first two bits are different. Then adjust the exponent to reflect the movement of the binary point.

eg. 0.0001011 → 0.1011
old exponent = 5
new exponent = 5 - 3 = 2 → 0010
→ 01011000 0010

20
Q

How do you calculate the minimum amount of storage required to store a sound file?

A

storage requirement (in bits) = sampling rate × seconds × sample resolution

21
Q

What is binary?

A

Binary represents numbers using 2 digits, 0 and 1. Binary is base 2.

22
Q

What is hexadecimal?

A

Hexadecimal represents numbers using 16 digits, the numbers 0 - 9 and the letters A - F. Hexadecimal is base 16.

23
Q

What is decimal?

A

Decimal represents numbers using 10 digits, 0 - 9. Decimal is base 10.

24
Q

How do you convert from Decimal to Binary?

eg. 119₁₀

A

Set up the column headings and move from left to right putting a 1 under the combination of numbers that make up the decimal value.

eg.  119 - 64 = 55
        55 - 32 = 23
        23 - 16 = 7
        7 - 4 = 3
        3 - 2 = 1
        1 - 1 = 0

1286432168421
01110111

119₁₀→01110111₂

25
Q

How do you convert from Binary to Decimal?

eg. 11010111₂

A

Add up the column headings with a 1 under them.

eg. 128 64 32 16 8 4 2 1
1 1 0 1 0 1 1 1

128 + 64 + 16 + 4 + 2 + 1 = 215

11010111₂ → 215₁₀

26
Q

How do you convert from Decimal to Hexadecimal?

eg. 527₁₀

A

Divide the decimal number by 16 (treating as integer division). Write down the remainder (in hexadecimal). Then repeat with the result of the division until the result is 0. The number in hexadecimal is the sequence of remainders in reverse order.

eg.  527 DIV 16 = 32
       527 MOD 16 = 15  15 → F
       32 DIV 16 = 2
       32 MOD 16 = 0
       2 DIV 16 = 0
       2 MOD 16 = 2

256 16 1
2 0 F

527₁₀ → 20F₁₆

27
Q

How do you convert from Hexadecimal to Decimal?

eg. C7F₁₆

A

Multiple each of the column headings by the value under them. The total is the decimal value.

eg. 256 16 1
C 7 F

256 * 12 + 16 * 7 + 1 * 15 = 3199

C7F₁₆ → 3199₁₀

28
Q

How do you convert from Binary to Hexadecimal?

eg. 10111110₂

A

Split the binary number into nibbles and find the hexadecimal value that represents each nibble.

eg. 8 4 2 1 8 4 2 1
1 0 1 1 1 1 1 0
→ B → E

10111110₂ → BE₁₆

29
Q

How do you convert from Hexadecimal to Binary?

eg. 7D₁₆

A

Find the binary value that represents each digit of the hexadecimal number and join them together.

eg. ↓ 7 ↓ D
8 4 2 1 8 4 2 1
0 1 1 1 1 1 0 1

7D₁₆ → 01111101₂

30
Q

Why is hexadecimal used as a shorthand for binary?

A
  • Long strings of 1s and 0s are difficult for a human to read.
  • Writing numbers in hexadecimal form is less error prone than writing the same numbers in binary.
  • It can be displayed in less space.
31
Q

What is hexadecimal used for?

A
  • To define memory locations.
  • To represent MAC addresses.
  • To define colours on web pages.
32
Q

What is a bit?

A

A bit is the fundamental unit of information. It is an abbreviation of binary digit. A bit can be either a 0 or a 1.

33
Q

What is a byte?

What is a nibble?

A

A byte is a group of 8 bits.

A nibble is a group of 4 bits.

34
Q

How many different values can be represented with n bits.

A

2ⁿ different values.

35
Q

What are the quantities of bytes using binary prefixes?

A

Kibibyte - KiB - 2¹⁰ bytes
Mebibyte - MiB - 2²⁰ bytes

Gibibyte - GiB - 2³⁰ bytes
Tebibyte - TiB - 2⁴⁰ bytes

36
Q

What are the quantities of bytes using decimal prefixes?

A

Kilobyte - kB - 10³ bytes
Megabyte - MB - 10⁶ bytes

Gigabyte - GB - 10⁹ bytes
Terabyte - TB - 10¹² bytes

37
Q

What symbol is used to represent bits?

What symbol is used to represent bytes?

A

b

B