Organisation and structure of data #4 Flashcards
What are the 3 different counting systems in computers?
Denary
Binary
Hexadecimal
How does denary work?
also known as the base₁₀ counting system. the digits 0₁₀ 1₁₀ 2₁₀ 3₁₀ 4₁₀ 5₁₀ 6₁₀ 7₁₀ 8₁₀ 9₁₀ are used to represent umbers.
eg. 138₁₀ means
1 ‘hundred’
3 ‘tens’
8 ‘units’
giving the total number 138
How does binary work?
‘B’inary digI’Ts’, also known as BITs
a BIT is either a 1₂ or 0₂
you may think of this as a light switch, where if the switch is on, it is stored as the digit 1
if the switch is off, its stored as the digit 0
IT IS BASE 2 COUNTING SYSTEM
How does hexadecimal work?
- Also known as the base₁₆ counting system.
the digits 0₁₆ 1₁₆ 2₁₆ 3₁₆ 4₁₆ 5₁₆ 6₁₆ 7₁₆ 8₁₆ 9₁₆ represent 1-9
the characters A₁₆ B₁₆ C₁₆ D₁₆ E₁₆ F₁₆ represent 10-15
e.g. 8A₁₆ means
8 ‘sixteens’
10 ‘units’
giving the total number 138
How to perform Denary to binary?
Create a base 2 table
(somewhat ok representation)
128|64|32|16|8|4|2|1|
[ ][ ][ ][ ][ ][ ][ ][ ]
To convert 198₁₀ into binary, it’ll just look like this
128|64|32|16|8|4|2|1|
1 1 0 0 0 1 1 0
11000110₂
Hopefully self explanatory, like they all add up 198
How to perform Denary to hexadecimal?
Create a base 16 table
(somewhat ok representation)
256|16|1
[ ][ ][ ]
To convert 198₁₀ think about the hexadecimal digits and characters
256|16|1
0 C 6
Adds up to 198 and also it would be C6₁₆
(you should have a calculator, now its just all up to your maths skills)
How to perform Binary to denary?
Create base 2 table
(insert the binary in table)
00100011₂
128|64|32|16|8|4|2|1|
0 0 1 0 0 0 1 1
and ye thats 35₁₀
How to perform Binary to hexadecimal?
Create base 2 table
(insert the binary in table)
00101011₂
128|64|32|16|8|4|2|1|
0 0 1 0 1 0 1 1
Split it to 4-bit base 2 tables
128|64|32|16—————–8|4|2|1|
0 0 1 0——————1 0 1 1
=
8|4|2|1|—————-8|4|2|1|
0 0 1 0——————-1 0 1 1
Think about hexadecimal digits and characters
= 2B₁₆
256|16|1
0 2 B
”-“ = fuuuuuucking space
How to perform Hexadecimal to denary?
Create base 16 table
(insert hexadecimal in table)
C6₁₆
256|16|1
0 C 6
Then multiply each heading
C(12) x 16 = 192₁₀
6 x 1 = 6₁₀
192₁₀+6₁₀
= 198₁₀
^^^^ the denary number
How to perform hexadecimal to binary?
Create 2 4-bit base 2 tables
8|4|2|1|————– 8|4|2|1|
[] [] [] [] ————— [] [] [] []
Convert hexadecimal number 2B₁₆
start with 2
8|4|2|1|—————-8|4|2|1|
0 0 1 0 —————- [] [] [] []
then B (think about hexadecimal digits and characters)
8|4|2|1|————— 8|4|2|1|
0 0 1 0 —————–1 0 1 1
connect 4-bit tables as 8-bit table
128|64|32|16|8|4|2|1|
0 0 1 0 1 0 1 1
Binary = 0010101₂
”-“ = space, fucking space
What are arithmetic shift functions?
Manipulations of bit patterns for 8-bit registers
(think of it as like x10 or /10)
Arithmetic shift right 01000000₂ by 2
01000000₂
00010000₂
You need workings out for the mark sooo idk
write down og denary number to new denary number
Arithmetic shift left 01111001₂ by 1
01111001₂
11110010₂
You need workings out for the mark sooo idk
write down og denary number to new denary number
Explain binary addition
0₂ + 0₂ = 0₂
1₂ + 0₂ = 1₂
1₂ + 1₂ = 10₂ (which is 0 and a carry of 1)
Remember this
Solve
1₂+11₂= ?
Calculations:
____1₂
+ 1 1₂
Start from right then left
1₂ + 1₂ = 10₂ = 0₂ carry 1
Last digit is 0
Next column becomes:
0₂ + 1₂ + 1₂ due to the carried 1
0₂ + 1₂ + 1₂ = 10₂ = 0₂ carry 1
Next digit is 0 but then since theres no other column, 1 remains which is the last digit
answer = 100₂
”-“ = fuckign space
Solve
1010₂ + 11₂ = ?
Calculations:
1 0 1 0₂
+ 1 1₂
First column:
0₂ + 1₂ = 1₂
Last digit = 1
Second column:
1₂ + 1₂ = 0₂ carry 1
Next digit = 0₂
Third column:
0₂ + 0₂ + 1₂ = 1₂ (due to carried 1)
Next digit = 1₂
Final column:
1₂ + 0₂ = 1₂ <– final digit
answer = 1101₂
Now solve
100101₂ + 10101₂ = ?
(this time no calculations so idk use a paper)
(u cba to use paper, so u winging this shit)
Answer = 111010₂
(Calculations on page 60)
What’s different with sound in terms of signals?
It is an analogue signal
How can sound be stored in a pc?
Converts into a digital signal to become processed
Whats the method of converting sound into a digital signal?
Sampling
What is sampling?
- When hardware (microphone)
- Measures level of sound
- Many times per second
- And records it as binary digits
Look at page 61 for diagram of sampling analogue sound
Whatever