Topic 2: Data Flashcards

1
Q

Why Binary?

A

Computers contain billions of transistors. These act as switches that have two states: on and off. These states are then represented in binary by 1(on) or 0(off). These are called bits.

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

Binary naming

A

Bits ( 1 bit)
Nibble ( 4 bits)
Byte (8 bits)

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

An arithmetic expression to show that 256 different colours can be represented in 8 bits

A

2¡(nr of bits) –> 2¡8

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

How to convert 6 to binary

A

0 1 1 0

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

Convert 78 into binary

A

0 1 0 0 1 1 1 0

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

1101 1001 into denary

A

128—64—-32—-16—–8—–4—–2—–1
——————————————————
1——1—–0——1——1—–0—–0—–1
——————————————————
128 + 64 + 6 + 8 + 1 = 217

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

Two’s complement signed integers

A

-Remove the - sign
-Convert the number to binary
-Flip the bits
-Add 1

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

How to represent -4 in binary

A

0 1 0 0 (convert +4 to binary)
1 0 1 1 (flip the bits)
1 1 0 0 (add 1)

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

Binary addition

A

0 + 0 = 0
0 + 1 = 1
1 + 1 = 0 and carry 1

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

Logical shift left by 2 places: 0001 0100

A

0101 0000

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

Logical shift right by 3 places: 1011 1000

A

0001 0111

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

Arithemtic shift right by 1 place: 1000 1000

A

1100 0100

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

Overflow

A

when an operation produces a result which requires more bits than available to store result

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

Consequences of overflow

A

Programs may crash or produce unreliable or incorrect results

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

1 reason why the result of adding 16 bit patterns must be 16 bit in length

A

The registers inside the machine that hold the original patterns are fixed in width, and so no more that 16 bits can be held.

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

Hexadecimal (10-16)

A

A-F

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

Convert C3 to binary

A

1) Each hexadecimal digit is converted to denary (C = 12) and 3)
2) Each denary number is converted into a nibble (1100)(0011)
3) The nibbles are combined to five the binary number (1100 0011)

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

ASCII in python

A

ord() returns the ASCII code in denary (“c”)–> 99
chr() returns the character for a denary code 100–> (“d”)

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

Upper case characters

A

65-90

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

Lower case characters

A

97-122

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

Digits 0 to 9

A

48-57

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

Image file size equation

A

W (width) * H (height) * D (colour depth)

23
Q

Pixel

A
  • PICture ELement
  • Each pixel has its own individual colour
  • The greater the number of pixels, the greater the detail
24
Q

Colour depth

A

the number of bits used to encode the colour of each pixel

25
Q

Resolution

A
  • number of pixels per inch when
  • e.g on a monitor or on paper
26
Q

calculate size of image with:
- 24-bit colour depth
- 410 * 270 pixels
in (MiB)

A

(410 x270x24) / (8x1024x1024)

27
Q

2 Factors that affect quality of a digital image

A
  • Nr of pixels that make it up (more pixels more resolution)
  • Nr of bits used to encode the colour of each pixel (more bits used, more colours can be displayed)
28
Q

Sample interval

A

samples of a sound wave taken at regular fixed intervals

29
Q

Sample rate

A

number of samples over a given time period

30
Q

Analogue recordings

A

convert the changes in air pressure into voltage changes

31
Q

Audio file size equation

A

file size (bits) = sample rate * bit depth * recording length (seconds)

32
Q

CDs sample rate

A

44 100 per second (44.1 kHz)

33
Q

Blu-ray sample rate

A

96 000 per second (96 kHz)

34
Q

CDs important info

A

They are recorded in STEREO and so have two channels.
Total file size needs to be doubled

35
Q

Calculate size in MiB digital audio file of
- 3 minutes
- 44.1 kHz sample rate
- 16 bits of bit depth

A

(44 100 * (3*60) * 16) / (8 * 1024 * 1024)

36
Q

Why analogue signal is never fully reproducible

A

It is recorded at fixed intervals (sample frequency)
Therefore the entire analogue signal is not represented in the digital recording.

37
Q

Nr of values of unsigned integers

A

4 bits (0 to 15)
8 bits (0 to 255)

38
Q

Nr of values of signed integers

A

4 bits (-7 to 8)
8 bits (-127 to 128)

39
Q

One reason that a 5-bit colour depth is needed to store 24 colours in an image

A

because 2¡4 = 16, which is less than 24
and 2¡5 = 32, which is the next largest power of 2 greater than 24

40
Q

Conversion units

A

Byte
Kibibyte (KiB)
Mebibyte (MiB)
Gibibyte (GiB)
Tebibyte (TiB)

41
Q

How to convert units

A

multiply or divide by 1024

42
Q

32 GiB to bits

A

32 * 1024 * 1024 * 1024 * 8

43
Q

Lossless compresion

A
  • Reduces file sizes without deleting any data
  • Nothing is lost
44
Q

Lossy compression

A
  • Reduces file size by deleting some data.
  • The original can never be reconstituted (it has been irreversibly changed)
45
Q

How is lossless compressed?

A
  • Looks for redundancy where the same data is stored many times and groups this data into one reference
46
Q

How is lossy compressed?

A
  • In image files, algorithms analyse the image and find areas where there are only slight differences. These are given the same value and the file can be rewritten using fewer bits.
  • In digital sound recordings, very small variations in frequency, tone and volume are removed to reduce the file size as the human ear cannot detect these small differences.
47
Q

Uses of lossless compression

A
  • Text files
  • Graphic files with a low colour depth
48
Q

Uses of lossy compression

A
  • Image files
  • DIgital sound recordings
49
Q

Less successful uses of lossles compression

A
  • Audio files
  • 24-bit colour files
50
Q

Less successful uses of lossy compression

A
  • Text files
  • Executable software
51
Q

Examples of lossless compression

A
  • Compressed text files
  • GIF and PNG image files
  • FLAC and ALAC audio files
52
Q

Examples of lossy compression

A
  • MP3 audio files
  • JPG image files
53
Q

Advantages of file compression :

A
  • less internet bandwidth
  • transfer time is faster
  • less storage
  • reduce congestion on the internet
  • audio and video files can be streamed
54
Q

Differences between lossy and lossless

A

In lossy:
- when uncompressed it is not exactly the same as the original
- for example audio files (MP3) or image files (JPG)
In lossless:
- when uncompressed, it is restored completely as the original
- for example compressed text files