Computer science - data representation
Computer science - data representation
- Bite: 8 bits
- Nibble: 4 bits Denary -> Hexadecimal
A computer system is a digital system that accepts input, and can Hexadecimal -> Denary
store, retrieve, process, and produce an output.
Resolution: W x H = Resolution
Bit depth is how many colors there are in an image. The higher
the bit depth the more colors there are.
Image compression
- Reduces file size
Analogue to Digital conversion
There are two types:
- Lossy compression (JPG, GIF, MP3, MP4)
- Lossless compression (PNG, TIF, SVG)
Lossy compression
Removes data permanently and reconstructs the file using the
remaining data.
- This allows much smaller file sizes but some loss of quality.
How it works:
Decreases the color depth to save space. Similarly colored pixels
are made the same.
- Things like record players and vinyl's sound better as they
Lossless compression
are analogue.
How it works:
Finds areas of the same color and records them as a group Digitized sound quality
instead of individually. Recording quality improves:
- Example: 15 blue pixels rather than blue pixel, blue pixel,
- The more frequently we sample the sound.
and blue pixel.
- The more frequently we record the wave height.
- 11011010, 11011010, 11011010 becomes 00000100-
11011010. Increasing sampling rate and resolution means recording more
No data is lost, and it retains the quality. (Keeps the quality the data points.
same).
- The size of the sound file will therefore increase.
Sound Humans can hear between 20-20,000 Hz – This varies depending
on age.
Lossy compression - MP3 But for text a different system is needed.
MIDI files is a set of instructions for digital instruments to play Converting ASCII to pure binary
synthesized sounds. We cannot do arithmetic (math) with ASCII characters, because
programming languages deal with the input of numbers in
- MIDI stands for musical instrument digital interface. different ways. (So we convert them
- It is not a recording of a live musical source. ASCII represents characters, not numerical values that
Character sets can be used for arithmetic operations.
- Some languages need to decare a variable as type char,
Positive integers can be represented in binary, numbers &
string, int.
negative numbers can be represented as “pure” binary numbers.
- Other languages such as python, all data is input as string,
so it has to be converted using a built-in function.