Converting from Binary to Denary
First draw an 8 bit binary value table.
Place the values at the top of each column (it should always look backwards i.e. 128 to 1).
Add your binary number into your value table.
Each digital will have a value.
If the tables column has a 1 in the column then you take the above value.
Add all of the values that have a 1 in their column and calculate a total.
This is your converted value.
Converting from Denary to Binary
First draw your 8 bit binary table.
Take your denary number and subtract the highest value from your table, i.e. for an 8 bit number the highest value is 128 as shown.
You cannot subtract that number from the denary number then you enter a 0 into that column of your bainry value table (their are no 128's).
repeat the process but move long the binary values.
take your denary value, subtract the next value in the binary table i.e. 64.
You cannot subtract that number from the denary number then you enter a 0 into that column of your bainry value table (their are no 64's).
repeat the process but move long the binary values.
take your denary value, subtract the next value in the binary table i.e. 32.
You cannot subtract that number from the denary number then you enter a 0 into that column of your bainry value table (their are no 32's).
repeat the process but move long the binary values.
Take your denary value, subtract the next value in the binary table i.e. 16.
You can subtract that number from the denary number then you enter a 1 into that column of your bainry value table (their is 1 16).
If you repeat this process through the whole binary value table you will have converted your denary number from denary to binary.
Before we attempt any binary addition we should first understand the different combinations of sums we will be asked to perform.
The diagram shows every conbination you will need to consider it also shows that when 1 is added to 1 the answer is 10.
This is due to us using binary for the values as well as the answer. i.e. the number 2 does not exist in a binary number system so to represent two we must use 10 (the binary representation of the denary number 2).
Step 1:
Adding two binary integers is similar to adding denary numbers, but we only use two digits: 0 and 1.
We start from the rightmost bit (least significant bit) and move towards the left, adding corresponding bits and any carry-over from the previous addition.
1+1 = 10, place the 0 within the column and carry the 1 to the next column.
Step 2:
1+1 + the carried 1 = 11, place the 1 within the column and carry the 1 to the next column.
Step 3:
0 + 1 + the carried 1 = 10, place the 0 in within the column and carry the 1 to the next column.
Step 4:
0 + 0 + the carried 1 = 1, place the 1 within the column.
Step 5:
Answer is 1010
An overflow error occurs when the result of an addition is too large to be represented within the given number of bits. In our case, we're working with up to 8 bits, so the largest number we can represent is 11111111 (denary 255).
What happens to the extra digit?
In the context of binary addition with a fixed number of bits (like 8 bits), the extra digit resulting from an overflow is typically discarded or lost. The system simply doesn't have the capacity to store it.
Converting Denary to Binary to Hexadecimal.
Convert your denary number to a 8 bit binary Byte.
Split the binary Byte into 2 4 bit binary nibbles.
Convert the nibbles to hexadecimal numbers
Put the hexidecimal numbers together.
Converting Hexadecimal to Binary to Decimal.
Separate the hexadecimal number.
Convert each hexadecimal number into a 4 bit binary nibble.
Push the two 4 bit binary nibbles together into an 8bit Byte.
Convert the 8bit binary Byte into a denary number.
Binary shifts are operations that move the bits within a binary number to the left or right.
Left Shift: Each bit is moved one position to the left, and a 0 is inserted into the least significant bit (rightmost) position.
Left shifts effectively multiply the original number by 2 for each shift position.
Right Shift: Each bit is moved one position to the right. What is inserted into the most significant bit (leftmost) position depends on the type of shift:
Logical right shifts effectively divide the original number by 2 for each shift position (rounding down, loss of accuracy / loss of 0.5).
🗝️ Key Points to Remember:
Shifts are often used for efficient bit manipulation and optimization in low-level programming.
❌✅ Misconceptions
❌Shifts cause bits to "wrap around".
✅ Bits shifted out of one end are lost, and new bits (usually 0s) are introduced at the other end.
A character set is a defined list of characters, each associated with a unique numeric code. It allows computers to represent and manipulate text.
Extended ASCII (American Standard Code for Information Interchange) is a widely used character set. It defines 256 characters, including uppercase and lowercase English letters, numbers, punctuation marks, and control characters.
ASCII Example:
The letter 'A' is represented by the binary value 01000001.
The number '0' is represented by the binary value 00110000.
256 characters this is the same as the total number of values that can be represented by 8bits / 1 Byte. This is no coincidence as for each of those binary values the computer assigns a character.
https://www.ascii-code.com/ This website will show you all of the characters and their binary values.
If you think about if you had a word file that contained 200 characters, it would need 200 Bytes of data storage to store that file as each character needs 1 Byte / 8 bits.
Unicode is a universal character set designed to encompass all characters from all languages and scripts worldwide. It aims to provide a consistent way to represent and handle text across different computing platforms and applications.
Unicode Example
Unicode includes characters from various languages like English, Chinese, Arabic, and many others, along with symbols, emojis, and even ancient scripts.
https://home.unicode.org/ This website will show you all of the characters and their values.
🗝️ Key Points to Remember:
Different character sets exist to support various languages and symbols.
Unicode is a universal character set that aims to encompass all characters from all languages.
UTF-8 is a common encoding scheme for Unicode, providing efficient storage and transmission of Unicode characters.
❌✅ Misconceptions
❌ All character sets can represent all possible characters.
✅ Older or less comprehensive character sets might have limitations.
❌Unicode is just an extended version of ASCII.
✅It is a comprehensive character set designed to encompass all characters.
Image Resolution
Image resolution refers to the level of detail an image holds. It is typically expressed as the number of pixels (width x height) that make up the image. A higher resolution means more pixels, leading to a sharper and more detailed image.
Example:
A 1920x1080 resolution image has 1920 pixels horizontally and 1080 pixels vertically.
Compared to a 640x480 image, the 1920x1080 image will have significantly more detail and clarity.
Colour depth, refers to the number of bits used to represent the colour of each pixel in an image. It determines the range of colours that can be displayed or stored.
Colour Depth is refered to in bits
Colour Palette is the maximum number of available colours possible in an image based on its colour depth.
If you had an image with a colour depth of 4b (4bits) you would have an image that for each pixel would have the ability to store 4 bits of cololur information. So that means that you could only have a colour palette of 16 colours.
2x2x2x2 = 16 combinations of 1's and 0's
When creating an image you do not need to use all of the colours in the palette but if you do not then you are wasting storage space. So if you know you are creating an image using only 6 colours you should ensure you have a colour depth of 3 bits, this would be the lowest colour depth that you could use in order to have access to 6 colours. This would reduce unnecassary storage being used for colours that have not been used.
Calculating Image Meta Data
Metadata is data that provides information about other data. It describes the characteristics, properties, or context of the data it is associated with, without being the actual data itself.
pixels tall * pixels wide = resolution (total number of pixels)
resolution * colour depth = total number of bits to represent the image
🗝️ Key Points to Remember:
The more pixels an image has, the higher its resolution and the more detailed it appears.
Higher colour depth allows for a wider range of colours but also increases file size.
Images are typically stored in compressed formats (like JPEG or PNG) to reduce file size.
❌✅ Misconceptions
❌Resolution is not the only factor determining image quality.
✅Other factors like colour depth, compression, and the original capture quality also play a role.
❌Simply enlarging an image does not increase its true resolution.
✅It might make it appear larger, but it won't add any additional detail.
❌Metadata is not the same as the data itself.
✅ It provides information about the data, not its content.
Sound Waves
Sounds are waves and they are not easy for a computer to reproduce.
To reproduce the sound the computer cannot record all of the sound, instead a Sampling rate is used to indicate how many times a second it will record a Sample of the sounds amplitude.
The more Samples per second the computer can store the better ts reproduction of the sound and the more binary bits it will take up.
When you record sound you also need to set a Bit Depth, which is the amount of binary bits recorded per sample. The more bits per sample the more clarity you achieve in your recording.
Samples
A Sample is a single point in time which would be a fraction of a second of sound. The number of samples per second is called the Sample Rate.
For each Sample we record the amplitude of the sound at that point in time.
The Bit Depth is how much data about the amplitude you record per Sample.
Sample Rate * Bit Depth = File Size in bits.
Wave amplitude is measured at each sample for recording
The computer calculates the binary value for each sample using a number of bits. The more bits used the higher the quality of the sound wave reproduction.
The Sample rate is 10 times a second and you can see that the wave has not been fully reproduced so sound quality will suffer.
In the example we are using 4 bits per sample, this is a really low Bit Depth and would result in a very poor reproduction.
Low Sample Rate can be seen as the sound wave has not been acurately reproduced.
Low Bit Rate will only record 4 bits per sample.
This will be a very poor recording.
Higher Sample Rate (x2) You can clearly see if we double the sample rate we can see the digital recording is closer to the actuyal sound wave and the quality will improve.
The greater the Sample Rate the better
Example:
A real world song that we all listen to on Google Play or iTunes usually uses at least 44,000 samples per second and each second uses 320 bits per sample.
44,100 samples x 320 bits = 14,112000 bits
14,112000 bits x 100 seconds = 1,411,200,000 bits
1,411,200,000 bits / 8 = 176,400,000 Bytes
176,400,000 Bytes / 1000 = 176,400 KB
176,400 KB / 1000 = 176.4 MB
🗝️ Key Points to Remember:
The sample rate determines how often measurements are taken (measured in Hertz, or samples per second).
Higher sample rates capture more detail, resulting in better sound quality.
The bit depth determines the precision of each sample (the number of bits used to represent the amplitude).
Higher bit depth allows for a wider range of values, improving the dynamic range and reducing quantization noise.
❌✅ Misconceptions
❌Digital sound is a perfect replica of the original analogue sound.
✅ It is an approximation based on discrete samples.
❌Higher sample rates and bit depths generally lead to better sound quality, but they also increase the file size.
✅The choice of sample rate and bit depth depends on the desired quality and the intended use of the sound.