Data Representation Flashcards
What is a number base?
The amount of symbols, notations it used to represent value
How many digits are in it’s number system
Describe the binary base
Base 2 : 0 and 1
Starts from 1 and double up the column, right to left
How do you do binary addition?
1+0=1
0+0=0
1+1=0 carried 1
1+ 1+1 = 1 carried 1
What are binary shifts used for?
Multiplying or dividing by powers of 2
Left shift =✖️
Right shift = ➗
Eg : n shifts left is ✖️2^n
What happens when 1s are lost?
The answer will be a lot more inaccurate
What is hexadecimal?
Base 16
0-15 (0-F)
Each hexadecimal is represented in nibbles
*still not understood by computers
Why is hex preferred?
💻reduces large binary strings into nibbles
💻 Simpler to remember large number
💻easier to convert between hex and binary than decimal
💻less chance of input errors
What is an overflow error?
The calculation requires more bits than available
What is a bit?
Smallest measure of data
0 or 1
What is a nibble?
4 bits
What is a byte?
8 bits
What is a kilobyte?
1000 bytes **3
8000 bits
What is a megabyte?
1000 kilobytes
1,000,000 bytes
8,000,000 bits
1*10^6
What is a gigabyte
1000 megabytes
1*10^9
1,000,000,000 bytes
What is a terabyte?
1000 gigabytes
1*10^12
1,000,000,000,000 bytes
How do you calculate how many values can be made from a specific number of bytes?
Eg a nibble - 4 bits
n = amount of bits
2^n =how many different values can be made
What is a character set?
A group of characters that a computer recognises from their binary representation
Describe ASCII
〽️7 bits , 128 characters
〽️represents English alphabet, numbers , symbols, commands
〽️A=65
Describe Unicode
〽️used for all languages
〽️used 16 bits, 65,000 characters
〽️first 128 codes are the same as ASCII
Which is easier dec to hex or binary to hex?
Binary to hex as splitting into nibbles is a lot easier
How do you convert from hex to decimal?
Put it into a 16&1 chart
How do you convert from decimal to hex?
Divide number by 16 and remainder goes in one’s column
How do you convert binary to hex?
Split in nibbles
In the 8421 column find the decimal value
Place it so that it fits in hex
Eg 15: F
How do you convert hex to binary?
Convert to nibbles
Add the two nibbles together to forms byte