Podcast
Questions and Answers
A number ______ is a technique to represent and work with numbers.
A number ______ is a technique to represent and work with numbers.
system
The value of each digit in the denary system depends upon its ______.
The value of each digit in the denary system depends upon its ______.
weight
The binary number system is a base ______ system.
The binary number system is a base ______ system.
2
The least significant bit (LSB) is the ______ binary digit.
The least significant bit (LSB) is the ______ binary digit.
The hexadecimal number system is a base ______ system.
The hexadecimal number system is a base ______ system.
Computers use ______ to represent all forms of data.
Computers use ______ to represent all forms of data.
______ numbers are shorter representations of binary numbers and hence they are easier to read.
______ numbers are shorter representations of binary numbers and hence they are easier to read.
Converting binary to ______ is typically easy.
Converting binary to ______ is typically easy.
When writing HTML code, hexadecimal values are often used to represent different ______ of text on the screen.
When writing HTML code, hexadecimal values are often used to represent different ______ of text on the screen.
A ______ Address is a number which is used to uniquely identify a device on a network.
A ______ Address is a number which is used to uniquely identify a device on a network.
URLs can only be sent over the Internet using the ______ character set.
URLs can only be sent over the Internet using the ______ character set.
Some programmers use machine code or ______ code when developing programs as computer memory can be directly referred to using low-level languages.
Some programmers use machine code or ______ code when developing programs as computer memory can be directly referred to using low-level languages.
To convert from positive to negative or vice versa, compute the ______ complement of the number.
To convert from positive to negative or vice versa, compute the ______ complement of the number.
The leftmost bit in two's complement representation is a ______ bit - 0 for positive and 1 for negative.
The leftmost bit in two's complement representation is a ______ bit - 0 for positive and 1 for negative.
A shift involves moving the ______ stored in a register a given number of places within the register.
A shift involves moving the ______ stored in a register a given number of places within the register.
In a logical left shift, bits are shifted to the left and bit positions on the right hand side of the accumulator are filled with ______ bits.
In a logical left shift, bits are shifted to the left and bit positions on the right hand side of the accumulator are filled with ______ bits.
Positive numbers can be represented in both signed and ______ ways.
Positive numbers can be represented in both signed and ______ ways.
A ______ is the basic unit of all computing memory storage terms and is either 1 or 0.
A ______ is the basic unit of all computing memory storage terms and is either 1 or 0.
The standard ASCII code character set consists of 7-bit codes (0 to 127 in denary or 00
to 7F
in ______).
The standard ASCII code character set consists of 7-bit codes (0 to 127 in denary or 00
to 7F
in ______).
______ uses between 8 and 32 bits and can represent most of the world's languages.
______ uses between 8 and 32 bits and can represent most of the world's languages.
Unlike ASCII, ______ will support up to four bytes per character.
Unlike ASCII, ______ will support up to four bytes per character.
______ is a technique where the file size is reduced but no information is discarded.
______ is a technique where the file size is reduced but no information is discarded.
______ is a technique where the file size is reduced with some loss of information and the original file can never be recovered.
______ is a technique where the file size is reduced with some loss of information and the original file can never be recovered.
MP3 audio compression reduces a file size through perceptual music ______ and by reducing the audio bitrate.
MP3 audio compression reduces a file size through perceptual music ______ and by reducing the audio bitrate.
______ is a compression algorithm for images is split into the blocks of 8*8.
______ is a compression algorithm for images is split into the blocks of 8*8.
______ encodes data which is repeated consecutively into two values.
______ encodes data which is repeated consecutively into two values.
Since unsigned numbers don't have any sign, unsigned numbers are always ______.
Since unsigned numbers don't have any sign, unsigned numbers are always ______.
A ______ bit number is called a nibble.
A ______ bit number is called a nibble.
A media Access Control (MAC) Address is number which is used to uniquely ______ a device on a network
A media Access Control (MAC) Address is number which is used to uniquely ______ a device on a network
Sound is ______ which means that the waves vary continuously and should be digitised
Sound is ______ which means that the waves vary continuously and should be digitised
The ______ rate is the number of measurements taken per second measured in hertz (Hz) and defines the range of volumes storable for each measurement.
The ______ rate is the number of measurements taken per second measured in hertz (Hz) and defines the range of volumes storable for each measurement.
A ______ graphic are made up of pixels and the images are stored in a 2D matrix of pixels
A ______ graphic are made up of pixels and the images are stored in a 2D matrix of pixels
[Blank] depth is the number of bits used to represent the colours of pixels .
[Blank] depth is the number of bits used to represent the colours of pixels .
[Blank] is the technique of reducing the size of a file
[Blank] is the technique of reducing the size of a file
Larger units of bytes are often measured in kilobytes, megabytes, and gigabytes but the size of these units can be ______
Larger units of bytes are often measured in kilobytes, megabytes, and gigabytes but the size of these units can be ______
A sound wave is a ______ wave and requires a medium such as gas, liquid or solid to travel
A sound wave is a ______ wave and requires a medium such as gas, liquid or solid to travel
The signal ______ has a stepped-up shape, rather than that of the original smooth analogue signal.
The signal ______ has a stepped-up shape, rather than that of the original smooth analogue signal.
Lossy compression is a technique where the file size is reduced with some loss of information and original file can ______ be recovered
Lossy compression is a technique where the file size is reduced with some loss of information and original file can ______ be recovered
[Blank] has 128 characters in all in this character set. and have control codes and printable characters
[Blank] has 128 characters in all in this character set. and have control codes and printable characters
Unicode uses between 8 and 32 ______ and can represent most of the world's languages.
Unicode uses between 8 and 32 ______ and can represent most of the world's languages.
A ______ is the smallest picture element that makes up an image.
A ______ is the smallest picture element that makes up an image.
In a logical _____ shift, bits that are shifted out of the register are replaced with zeros.
In a logical _____ shift, bits that are shifted out of the register are replaced with zeros.
Flashcards
What is a number system?
What is a number system?
A method to represent and work with numbers.
What is a denary (decimal) number system?
What is a denary (decimal) number system?
A base-10 number system consisting of digits 0-9. Digit value depends on its weight (powers of 10).
What is a binary number system?
What is a binary number system?
A base-2 number system consisting of digits 0 and 1. Weights are based on powers of 2.
What is the Least Significant Bit (LSB)?
What is the Least Significant Bit (LSB)?
Signup and view all the flashcards
What is the Most Significant Bit (MSB)?
What is the Most Significant Bit (MSB)?
Signup and view all the flashcards
What is a hexadecimal number system?
What is a hexadecimal number system?
Signup and view all the flashcards
Why use the Binary number system?
Why use the Binary number system?
Signup and view all the flashcards
Why use the Hexadecimal number system?
Why use the Hexadecimal number system?
Signup and view all the flashcards
What is a memory dump?
What is a memory dump?
Signup and view all the flashcards
What is the Hexadecimal use in HTML?
What is the Hexadecimal use in HTML?
Signup and view all the flashcards
What is a MAC Address?
What is a MAC Address?
Signup and view all the flashcards
What is a Universally Administered MAC Address (UAA)?
What is a Universally Administered MAC Address (UAA)?
Signup and view all the flashcards
What is a Locally Administered MAC Address (LAA)?
What is a Locally Administered MAC Address (LAA)?
Signup and view all the flashcards
Hexadecimal use in web addresses
Hexadecimal use in web addresses
Signup and view all the flashcards
What is the Hexadecimal use in assembly code?
What is the Hexadecimal use in assembly code?
Signup and view all the flashcards
How to do Binary to Decimal conversion
How to do Binary to Decimal conversion
Signup and view all the flashcards
How to do Decimal to Binary conversion
How to do Decimal to Binary conversion
Signup and view all the flashcards
How to do Hexadecimal to Denary conversion
How to do Hexadecimal to Denary conversion
Signup and view all the flashcards
How to do Decimal to Hexadecimal conversion
How to do Decimal to Hexadecimal conversion
Signup and view all the flashcards
How to do Binary to Hexadecimal conversion
How to do Binary to Hexadecimal conversion
Signup and view all the flashcards
How to do Hexadecimal to Binary conversion
How to do Hexadecimal to Binary conversion
Signup and view all the flashcards
What is an Overflow?
What is an Overflow?
Signup and view all the flashcards
What are Binary shifts?
What are Binary shifts?
Signup and view all the flashcards
What is a Logical shift?
What is a Logical shift?
Signup and view all the flashcards
What are Signed numbers?
What are Signed numbers?
Signup and view all the flashcards
What are Unsigned numbers?
What are Unsigned numbers?
Signup and view all the flashcards
What is a two's complement?
What is a two's complement?
Signup and view all the flashcards
Two's complement to decimal
Two's complement to decimal
Signup and view all the flashcards
What is a character set?
What is a character set?
Signup and view all the flashcards
What is a character code?
What is a character code?
Signup and view all the flashcards
What is ASCII code?
What is ASCII code?
Signup and view all the flashcards
What is a Extended ASCII?
What is a Extended ASCII?
Signup and view all the flashcards
What is Unicode?
What is Unicode?
Signup and view all the flashcards
What are the units of memory?
What are the units of memory?
Signup and view all the flashcards
What is Nibble
What is Nibble
Signup and view all the flashcards
What is Compression?
What is Compression?
Signup and view all the flashcards
What is Lossless compression?
What is Lossless compression?
Signup and view all the flashcards
What is Lossy compression?
What is Lossy compression?
Signup and view all the flashcards
What is MPEG-3 (MP3)?
What is MPEG-3 (MP3)?
Signup and view all the flashcards
What is MPEG-4 (MP4)?
What is MPEG-4 (MP4)?
Signup and view all the flashcards
What is JPEG?
What is JPEG?
Signup and view all the flashcards
What is Run-length encoding (RLE)?
What is Run-length encoding (RLE)?
Signup and view all the flashcards
Study Notes
- A number system is a technique for representing and manipulating numbers.
Commonly Used Number Systems
- Denary (decimal) number system
- Binary number system
- Hexadecimal number system
Denary (Decimal) Number System
- The denary system is base 10
- It uses 10 digits, from 0 to 9
- Each digit's value depends on its weight
- Weights are based on powers of 10
- Example: the denary number 3514 has place values as follows:
- 3 * 10^3 + 5 * 10^2 + 1 * 10^1 + 4 * 10^0
Binary Number System
- The binary number system is base 2
- It uses 2 digits: 0 and 1
- Weights are based on powers of 2
- Example: the binary number 1001 has place values as follows:
- 1 * 2^3 + 0 * 2^2 + 0 * 2^1 + 1 * 2^0
- The least significant bit (LSB) is the rightmost digit
- The most significant bit (MSB) is the leftmost digit
Hexadecimal Number System
- The hexadecimal system is base 16
- It uses 16 numeric and alphabetic characters
- Uses digits 0 to 9 and letters A to F (A=10, B=11, C=12, D=13, E=14, F=15)
- Weights are based on powers of 16
- Example: the hexadecimal number 13AB has place values as follows:
- 1 * 16^3 + 3 * 16^2 + A * 16^1 + B * 16^0
Binary Number Use in Computers
- Binary represents all forms of data in computers
- A binary digit (bit) is the smallest unit of data, represented by 0 or 1
- Instructions and data are converted into binary for processing
- Computer processors use transistors (tiny switches activated by electrical signals)
- The ON and OFF states of transistors are represented by 1 and 0 Note: Data goes to the CPU via wires, processed by logic gates, and stored in registers.
Use of Hexadecimal Numbers
- Shorter representations of binary numbers, easier to read, write, and understand
- Conversion between binary and hexadecimal is straightforward
- Large numbers can be represented with fewer digits
Uses of Hexadecimal System
- Memory dumps
- HTML
- MAC Addresses
- Web Addresses
- Assembly Code and Machine Code
Memory Dumps
- Display memory contents, helping programmers trace errors or develop new software
HTML
- Hexadecimal values represent different colors on screen
- Specify intensities of primary colors (red, blue, green)
MAC Address
- Media Access Control (MAC) address uniquely identifies a device on a network
- Embedded in the network interface card
- Usually 48 bits, written as 6 groups of hexadecimal digits
- Formats: separated by hyphens or colons (e.g., NN-NN-NN-DD-DD-DD or NN:NN:NN:DD:DD:DD)
- The first half identifies the manufacturer; the second half is the serial number
- Universally Administered MAC Address (UAA) is set by the manufacturer
- Most common
- Locally Administered MAC Address (LAA) is set by the user
- Reasons to change to LAA:
- Bypass a MAC address filter on a router or firewall
- Conform to a specific format required by mainframe software
Web Addresses
- ASCII (American Standard Code for Information Interchange) represents characters as decimal or hexadecimal values
- URLs use ASCII codes and sometimes hexadecimal numbers for web pages or files
- URL Encoding converts special characters into a universally accepted format using a "%" followed by two hexadecimal digits
Assembly Code and Machine Code
- Programmers use machine code or assembly code for low-level programming
- Hexadecimal digits make coding faster and less prone to error compared to binary
- Assembly code example: STO FFA4
- Machine code example using hexadecimal values: A5E4 FFA4
- Machine code example using binary: 1010 0101 1110 0100 1111 1111 1010 0100
Conversions
Decimal | Binary | Hexadecimal |
---|---|---|
0 | 0000 | 0 |
1 | 0001 | 1 |
2 | 0010 | 2 |
3 | 0011 | 3 |
4 | 0100 | 4 |
5 | 0101 | 5 |
6 | 0110 | 6 |
7 | 0111 | 7 |
8 | 1000 | 8 |
9 | 1001 | 9 |
10 | 1010 | A |
11 | 1011 | B |
12 | 1100 | C |
13 | 1101 | D |
14 | 1110 | E |
15 | 1111 | F |
Binary to Decimal Conversion
- Add the weights of all bits that are 1.
- Example: (11101100)2 = (128x1) + (64x1) + (32x1) + (8x1) + (4x1) = (236)10
Decimal to Binary Conversion: Method 1 (Sum of Weights)
- Place 1’s in the appropriate positions such that the total equals the denary number
- Note: This is time-consuming
- Example: Converting (115)10 to binary
- (115)10 = (01110011)2
Decimal to Binary Conversion: Method 2 (Repeated Division)
- Divide the quotient by two
- Record the remainder
- Repeat the steps above until a quotient of 0 is obtained
- Read the remainders from bottom to top to get the binary number
- Add zeros at the beginning if the result is not 8 bits
- Example: Converting (115)10 to binary results in (01110011)2
Hexadecimal to Denary Conversion
- Multiply the decimal value of each hexadecimal digit by its weight
- Add the products
- Example: Convert (13B)16 to denary
- (13B)16 = (1 x 256) + (3 x 16) + (11 x 1) = (315)10
Decimal to Hexadecimal Conversion
- Successive division by 16
- Divide the quotient by 16
- Record the remainder
- Repeat the steps until a quotient of 0 is obtained
- Write the remainders from bottom to top
- Example: Converting (918)10 to hexadecimal
- (918)10 = (396)16
Binary to Hexadecimal Conversion
- Break the binary number into groups of 4, starting from right to left
- Add zeros on the left-hand side (MSB) to complete the grouping if necessary
- Use the conversion table to convert each group into its equivalent hexadecimal digit
- Example: 1011001111 to hexadecimal:
- (1011001111)2 = (0010 1100 1111)2 = (2CF)16
Hexadecimal to Binary Conversion
- Use the conversion table to convert each hexadecimal digit to its equivalent binary number.
- Example:Convert the hexadecimal number 9E3 to binary.
- (9E3)16 = (1001 1110 0011)2
Binary Addition Rules
SUM CARRY
0+0 0 0
0+1 1 0
1+0 1 0
1+1 0 1
1+1+1 1 1
Binary Addition Examples
- 10 + 01 = 11
- 010 + 101 = 111
- 100 + 110 = 1010
Overflow
- Occurs when a calculation result has more bits than available to store it
- For example, adding 1 to an 8-bit register holding 11111111
- Result: 9 bits, causing an overflow
- Can lead to program crash or digit ignored
Binary Shifts
- A shift moves bits in a register a number of places
- Includes: logical shift, arithmetic shift, and cyclic shift
Note:
- Left shift moves bits to the left
- Right shift moves bits to the right
Logical Shift
- Bits shifted out are replaced with zeros
- Logical Right Shift: bits shift right; left side filled with zeros
- Logical Left Shift: bits shift left; right side filled with zeros For example, a left shift by one place involves:
- Moving all bits in the string one place to the left
- Discarding the most significant (leftmost) bit
- Putting a 0 into the empty place on the right A right shift by one place involves:
- Moving all bits in the string one place to the right
- Discarding the least significant (rightmost) bit
- Putting a 0 into the empty place on the left Examples: LSR # 1 1 0 0 0 1 1 0 1 —————> 0 1 0 0 0 1 1 0
LSL #3 1 0 0 0 1 1 0 1 —————> 0 1 1 0 1 0 0 0
Note: The left shift operation is a fast way to multiply a positive binary integer by two and the right shift divides positive binary integer by two. For example: 00110010 (denary 50) -> if right shifted -> 00011001 (denary 25) 00110001 (denary 49) -> if right shifted -> 00011000 (denary 24) Note: For 49, since there are no extra places in the register to store the rightmost 1-bit, it is discarded, causing truncation. As a result, the denary answer is not an exact division by 2.
Two’s Complement
- Binary numbers can be signed or unsigned
- Positive numbers can be signed or unsigned
- Negative numbers are only represented in a signed way
- Signed numbers use a sign bit
- Indicates if the number is positive or negative
Unsigned Numbers
- They don't have a sign, so they are always positive
- Decimal representation is positive
- Range is 0 to (2n -1)
- Example: 8-bit unsigned binary numbers range from 0 to 255
Signed Numbers
- They contain a sign bit
- Differentiates between positive and negative numbers
- Three representation ways include:
- 1's complement
- 2's complement
- Sign and magnitude method
- Focus is on 2's complement only
Note:
- The two’s complement is obtained by changing zeros to ones & ones to zeros and adding 1 to the LSB
- In two's complement representation, integers are represented as:
- Positive numbers: Binary equivalent.
- Negative numbers:
- Take the binary equivalent of the corresponding positive number
- Complement each bit
- Add 1 to the LSB
The leftmost bit is the sign bit
- Represents 0 for positive and 1 for negative.
- Converting from positive to negative or vice versa is done by computing the two’s complement
Two’s Complement Calculation
- Change all zeros to ones, and vice versa, then add 1 to the LSB
- Example: Find the 2's complement of 10101110
- Invert bits: 01010001
- Add 1: 01010010
- Hence the 2's complement is 01010010
Two’s Complement Representation notes
- Positive numbers keep their Binary equivalent
- Steps for Negative numbers:
- Take the binary equivalent of the corresponding positive number.
- Complement each bit. (Change all zeros to ones and all ones to zeros)
- Add 1 to the LSB
Examples 4-bit numbers
Decimal Representation | Four Bit Example Value |
---|---|
0 | 0000 |
1 | 0001 |
2 | 0010 |
3 | 0011 |
4 | 0100 |
5 | 0101 |
6 | 0110 |
7 | 0111 |
-1 | 1111 |
-2 | 1110 |
-3 | 1101 |
-4 | 1100 |
-5 | 1011 |
-6 | 1010 |
-7 | 1001 |
-8 | 1000 |
Notes
- The sign bit is on the left.
- It is 0 for positive numbers and 1 for negative numbers.
- The range is from −2n−1 to 2n−1 − 1, where n is the number of bits available.
- For example, the range for an 8-bit word length, numbers from (-128)10 to (+127)10 can be represented.
- Two's complement has only one representation of zero.
Converting 2's Complement to Decimal
Method 1:
- If the number is positive, convert directly to decimal.
- If the number is negative, complement all the bits (replace ones with zeros and zeros with ones), add 1 to the LSB and then convert to decimal. Add a negative sign for completeness.
- Example: Convert 11111011
- Complement each bit = 00000100
- add 1 = 00000101
- The given value is -5
Method 2: Treat the most significant bit as a negative value.
- Example: 11111011
- (1 x -128) + (1 x 64) + (1 x 32) + (1 x 16) + (1 x 8) + (0 x 4) + (1 x 2) + (1 x 1) = -5
Representing data
- All types of data in a computer, whether text, images or sound, must be converted into binary form in order to be processed by the computer.
Representing Text
- ASCII and Unicode
- All the characters that a computer can use form part of a character set.
- The characters include letters, digits, punctuations and non-printing commands such as enter and delete.
- When a key is pressed on the keyboard, the character is converted into binary form to be processed by the computer.
- Each character is represented by a binary code which is referred to as a character code.
Two common character coding schemes used:
- ASCII code
- Unicode
ASCII CODE
-
American Standard Code for Information Interchange standard ASCII code character set consists of 7-bit codes
-
(0 to 127 in denary or 00 to 7F in hexadecimal).
-
It was set up in 1963 for use in communication systems and computer systems.
-
We have 128 characters in all in this character set.
-
The 128 characters include:
-
33 control codes
-
95 printable characters (including space, punctuation marks, symbols, upper case letters, lower case letters and numeric digits 0-9)
###ASCII Code - Observations
- Character sets such as ‘a to z’ and ‘0 to 9’ are grouped together in sequence to speed up usability.
- When comparing an upper case letter and its corresponding lower case, only the 6th bit is different. Therefore, converting from upper case to lower case or vice-versa is easy. a 1 1 0 0 0 0 1 A 1 0 0 0 0 0 1
- A limited number of the codes are reserved for non-printing or control characters.
- They help in data transmission or in data handling at a computer terminal.
- Most of the codes are for characters that can be found in English text and that are available on a standard keyboard.
Extended ASCII - Notes
- The extended ASCII uses 8-bit codes, giving a character set of 256 characters (0 to 255 in denary and 00 to FF in hexadecimal).
- It allows special characters such as accents used in languages such as French to be represented
- Extended ASCII also includes some graphical characters.
UNICODE- notes
- ASCII codes do not cover all the characters needed for some uses.
- In order to be able to represent any possible text in code form, another coding scheme has been developed known as Unicode
- Unicode uses between 8 and 32 bits and can represent most of the world's languages. Today, most popular operating systems support Unicode as well as many search engines and internet browsers which are used globally.
Notes:
- There is an overlap with ASCII code since the first 128 characters are the same.
- ASCII uses one byte to represent a character, whereas Unicode will support up to four bytes per character.
-
UTF-8: The most popular version of Unicode is UTF-8. It is a variable-size encoding.
-
A character in UTF-8 can be from 1 to 4 bytes long.
-
UTF-16: UTF-16 encodes characters using either one or two 16-bit sequences.
-
UTF-32: UTF-32 encodes characters using 32 bits.
-
Encoding is how the numbers are translated into binary to be stored in a computer.
Memory size
- A bit is the basic unit of all computing memory storage terms and is either 1 or 0.
- Comes from binary digit.
- The byte is the smallest unit of memory in a computer.
- 1 byte is 8 bits.
A 4-bit number is called a nibble - half a byte Higher units of measurement:
- Larger units of bytes are often measured in kilobytes, megabytes, and gigabytes
- But the size of these units can be ambiguous. Depending on the context in which it is used, a kilobyte can equal 1,024 bytes or 1,000 bytes.
Decimal & Binary Naming Convention Comparison
Name | Number of Bytes (Decimal) | Equivalent Denary Value | Name | Number of bytes |
---|---|---|---|---|
1 kilobyte (1 KB) | 103 | 1 000 bytes | 1 kibibyte (1 KiB) | 210 |
1 megabyte (1 MB) | 106 | 1 000 000 bytes | 1 mebibyte (1 MiB) | 220 |
1 gigabyte (1 GB) | 109 | 1 000 000 000 bytes | 1 gibibyte (1 GiB) | 230 |
1 terabyte (1 TB) | 1012 | 1 000 000 000 000 bytes | 1 tebibyte (1TiB) | 240 |
1 petabyte (1 PB) | 1015 | 1 000 000 000 000 000 bytes | 1 pebibyte (1 PiB) | 250 |
1 exabyte (1 EB) | 1018 | 1 000 000 000 000 000 000 bytes | 1 exbibyte (1 EiB) | 260 |
Representing image data
- A sound wave is a longitudinal wave and requires a medium such as gas, liquid or solid to travel Data is transmitted by causing oscillations of particles through the medium.
- When sound travels through air, layers of air are set into vibration parallel to the direction of propagation of the sound wave.
- Alternate regions of compressions and rarefactions are produced.
- When a compression occurs, the pressure of the air is higher than normal and when a rarefaction occurs, the pressure is lower than normal.
Terms to remember when talking about sound waves
- Amplitude (A): Represents the maximum deviation from the normal pressure
- Frequency: The number of completed oscillations in one second.
- Wavelength: The distance between two successive compressions or two successive rarefactions represents the wavelength of the sound wave.
Note:
-
The loudness of a sound depends on the amplitude of the sound wave. The larger the amplitude, the louder the sound. Also, the higher the frequency, the closer together the waves are, the higher the pitch.
-
A typical sound contains a large number of individual waves.
Digitization Notes
- Sound is analogue = the waves vary continuously. However, in order to be stored or to be transmitted, it should be digitised.
- When the sound wave is picked up by a microphone, a diaphragm vibrates producing an analogue electric signal which is sent to an encoder. 1.The first component of the encoder is a band-limiting filter which filters out frequencies which are outside the range of human hearing.
- The second component is an ADC which converts the analogue signal into a digital signal for transmission. The analogue signal is split into a number of discrete samples and the amplitude is measured at each point. The amplitude of the sound cannot be measured precisely, so approximate values are stored and approximated by the closest of the defined amplitudes represented by the horizontal lines.
Sampling - notes
- The computer takes measurements of the analogue signal at regular time intervals, and then a unique bit pattern of binary numbers- is assigned to each sample.
- The digitised sound can then be stored and processed by a computer as a sequence of 1s and 0s.
Sampling Rate
- Number of measurements taken per second. This is measured in hertz (Hz).
- A higher sampling rate means the waveform will be converted from analogue to digital form more accurately, hence giving a more faithful representation of the original sound. (1 Hz = 1 sample per second)
Sampling Resolution
-
The number of bits used to store each measurement. It is also known as bit depth
-
The sampling resolution defines the range of volumes storable for each measurement
-
Increasing the sampling resolution increases the number of possible values used to represent the sound amplitude.
-
Hence, increasing the sampling resolution results in less distortion of the sound and an increase in accuracy and quality of the sound.
-
a higher sampling rate and sampling resolution mean a larger file size.
-
The file will take longer to transmit and will require greater processing power.
At reception:
- The signal reconstructed has a stepped-up shape, rather than that of the original smooth analogue signal.
- This effect is removed by passing the signal through filters.
- There is a staircase approximation to the original analogue value.
Example:
File size information
Bit rate calculation
- Bit rate is the number of bits required to store one second of sound.
- Bit rate = Sampling rate (in Hertz) x Sampling Resolution (in bits) File size calculation
- File Size = Bit rate x Length of sound (in seconds)
Image Notes
- Images can be stored in two common formats: a) Bitmap graphic (For O’level you only need to learn this one) b) Vector graphic
Bitmap Images
-
Bitmap images are made up of pixels and the images are stored in a 2D matrix of pixels.
-
Each pixel is represented by a binary number and is defined by two properties: its position in the matrix and its colour
-
A bitmap image is thus stored in a computer as a series of binary numbers.
-
Bitmaps are also known as pixel maps or raster graphics.
-
Widely used in digital cameras, smartphones and online.
Pixels - Notes
- A pixel is the smallest picture element that makes up an image.
- In many displays, in order to represent colours, each pixel has three separate subpixels - red, blue and green.
Common bit image formats
- Bitmap (.bmp)
- PNG - Portable Network Graphic (.png)
- JPEG - Joint Photographic Experts Group - (.jpg or.jpeg)
- GIF - Graphics Interchange Format - (.gif)
Colour Depth Notes
- Colour depth is the number of bits used to represent the colours of pixels.
- The larger the colour depth, the better the colour quality and the larger the file size.
- A black and white image (monochrome) only requires 1 bit per pixel- this means that each pixel can be one of two colours, corresponding to either 1 or 0.
- If each pixel is represented by 2 bits, then each pixel can be one of four colours (22 = 4), corresponding to 00, 01, 10, or 11
- If each pixel is represented by 3 bits, then each pixel can be one of eight colours (23 = 8), corresponding to 000, 001, 010, 011, 100, 101, 110 or 111.
- Modern computers use 24 bits which means over 16 million different colours can be represented.
- Hence, a colour depth of 8 bits per pixel provides 256 different colours.
Resolution
- Image resolution: It is the number of pixels that make up an image
- Obtained by multiplying the number of horizontal pixels and the number of vertical pixels.
Note
- The resolution does not determine the physical dimensions of the image.
- Considering images having same physical dimensions, the greater the number of pixels, the better the quality of the image.
- The first image has the lowest resolution and is pixelated
- The last image, however, has the highest resolution because it has more pixels than the other two images. Drawback of increasing resolution
The main drawback of using high-resolution images is the increase in file size
- A higher resolution means a larger file size causes slower displaying, occupying memory in the device
Calculating the file size with different colour depths.
- File size = Number of pixels x Colour depth
Compression Terms
- Compression is the technique of reducing the size of a file
- Particularly in digital media such as photo, audio and video.
Reduce the file for:
- saving storage space
- transfer quickly and consumes less network bandwith
- To reduce storage costs on cloud storage services
- stream media quick
Bandwidth
- Refers to the number of bits per second that can be transmitted on the link. Lossy and lossless
There are two common forms of file compression: i) Lossless file compression. ii) Lossy file compression.
Loss-less Compression
- A technique where the file size is reduced but no information is discarded and the process can be reversed when necessary to recreate the original file.
- Lossless compression is especially important when a loss of data could be disastrous.
Lossy compression
- A technique where the file size is reduced with some loss of information and the original file can never be recovered.
- algorithms used need to decide which parts of the file need to be kept and which parts can be discarded.
Compression Ratio - Notes
Compression ratio gives an indication of the success of a compression method in reducing file size.
- Calculated by dividing the size of the compressed file by the size of the uncompressed file.
Audio file compression
MP3, MP4
Image file compression
JPEG
Code compression
RLE
RLE Notes
- Run-length encoding (RLE) is a form of lossless file compression
- It is useful for different file formats and applied to any form of compression where data is repeated consecutively, i.e., when adjacent data are identical. For example, repeated colours in an image.
- It is, however, only effective when there is a long run of repeated units/bits.
- RLE encodes data which is repeated consecutively into two values.
- The first value represents the number of identical data items in the run.
- The second value represents the code of the data item For example, in the case of a text string, the first character value will represent the number of times the character is repeated and the second character value will represent the ASCII code if it is a keyboard character. Using RLE on text data
Consider the text string ‘aaabbbbbbccddddd’. Assuming each character uses 1 byte, then the string needs 16 bytes. Assuming we are using ASCII code, then the string can be coded as follows: a a a b b b b b b c c d d d d d 03 97 06 98 02 99 05 100 The above means we have
- 3 characters with ASCII code 97,
- 6 characters with ASCII code 98,
- 2 characters with ASCII code 99 and
- 5 characters with ASCII code 100.
RLE efficiency notes
- Assuming each number in the second row requires 1 byte, the RLE code will be 8 bytes. This is half the original size.
- There are certain cases where this compression is not very effective such as if we have 'bcbcbcbc'.
- To deal with this issue, a flag is normally used. A flag preceding data indicates that what follows is the number of repeating units.
- When there is no flag, the next byte(s) are taken as their face value and with a run of 1.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.