05 Data Representation Flashcards
What are natural numbers?
Any number from 1-9
What are integers?
Any positive or negative whole numbers
What are rational numbers?
Values that can be expressed as fractions
What are irrational numbers?
Numbers that cannot be expressed as fractions
Decimal values that are endless
(Pi)
What is a real number?
Any rational or irrational number
What are ordinal numbers?
Numbers that describe the position that values appear in
1st,2nd
What are the binary and denary number systems?
Binary is base 2 with digits 0 and 1
Denary is base 10
How do you convert from denary to binary?
Draw the table from 128 to 1 and add up
What is hexadecimal?
Base 16 which uses 1-9 then from A=10 B=11 and so on
What are the rules of place value for hexadecimal?
Last digit must be times by 16^0 and next must be times by16^1 and so on
E.g
F5 = (16^1 x 15) + (16^0 x 5)
= 16x15 + 1x5
=240 + 5
=245
How do convert denary to hexadecimal?
Divide the number by 16 and add the remainder
Example: 2468
2400 ÷ 16 = 154
remainder 4
154 ÷ 16 = 9 remainder A
9 ÷ 16 = 0 remainder 9
2468 in denary is 9A4 in hex
How do you convert from binary to hexadecimal?
Split the binary number in halves of 4 bits and convert them to hex
11011000
8421 8421
1101 1000
13 8
D8
How do you convert from hexadecimal to binary?
Turn each digit into 4 bit binary
Why use hexadecimal?
Hexadecimal is easier to read than binary
Quicker to write
Less chance of making an error
Used to define colours, in MAC addresses, machine code and assembly language
Easy to convert to and from binary
How do you add binary numbers?
0+0 = 0 1+0 = 1 1+1 = 0 carry 1 1+1+1 = 1 carry 1
What is overflow error?
When the result of addition is too large for the number of bits the computer can work with
How do you multiply binary numbers?
Same as decimal multiplication where u multiply everything by last digit then add 0 to end and use second digit
0x0 = 0 0x1 = 0 1x0 = 0 1x1 = 1
How are negative numbers represented in binary?
Using two’s complement
How do you calculate two’s complement?
Flip all of the bits and add 1 to the end
E.g.
-3 = 11111101 3 = 00000011
What is the range of values that can be counted in binary and using two’s complement?
Binary = 2^n-1
Two’s complement = -(2(^n-1)) … 2(^n-1) - 1
How do you subtract two binary numbers?
Turn one into a negative using two’s complement and add them together
How do you show binary fractions?
Use bits to the right as fractions
Instead of 128 64 32 16 8 4 2 1
It would be 8 4 2 1 1/2 1/4 1/8 1/16
They are negative powers of 2 (2^-1, 2^-2)
What is a fixed point binary value?
It uses a specified number of bits where the binary point is fixed
How many bits is a byte?
8 bits
How many bytes are in one kilo, mega, giga and tera byte?
Kilo = 10^3 = 1000 Mega = 10^6 = 1,000,000 Giga = 10^9 Tera = 10^12
How many bytes are in one kibi, mebi, gibi and tebi byte?
Kibi = 2^10 Mebi = 2^20 Gibi = 2^30 Tebi = 2^40