Data representation Flashcards
What are logic gates?
Special circuits built into computer systems, they receive binary information and apply a Boolean operation, then output a result.
What does a not gate do?
- Outputs the opposite of the input,
- It looks like a triangle with a circle on the end.
What does an and gate do?
- Needs both inputs to be true in order for the output to be true, otherwise the output is false,
- Looks like a letter ‘D’
What does an or gate do?
- Needs at least one of the inputs to be true in order for the output to be true,
- Looks like a rocket ship/ sideways shield.
What is a truth table?
A table that shows the individual inputs and outputs of each logic gate in a logic circuit.
How do you figure out how many rows are needed in a logic table?
2^n
‘n’ being the number of inputs
What are the different units of data and their sizes?
bit = 1 binary digit (1 or 0) nibble = 4 bits byte = 8 bits/ 2 nibble Kilobytes = 1,000 bytes/ 8,000 bits Megabytes = 1,000 kilobytes/ 8 mil bits Gigabytes = 1,000 Megabytes/ 8 bil bits Terabytes = 1,000 Gigabytes/ 8 tril bits Petabytes = 1,000 Terabytes/ 8 quadril bits
How do you convert bits to to bytes?
Divide by 8
What is ‘base 10’ also known as?
Denary/ decimal
What is ‘Base 2’ also known as?
Binary
What is ‘Base 8’ also known as?
Octal
What is ‘Base 16’ also known as?
Hexadecimal
What is the formula for number of possible binary combinations?
(2^n)
Where ‘n’ is number of bits,
- So in 8 bit binary, there are 256 combinations,
- You could also add up all the denary numbers in the columns.
How do you convert binary into denary?
- Put the binary values in an 8 bit table, one digit each column,
- The furthest right column represents the denary number 1,
- The next column (moving left) is doubled, so the second column is the denary number 2,
- Then add all the digits up that are represented by a binary 1.
How do you convert denary to binary?
- Draw an 8 bit table,
- Move along the column (left to right) subtracting the denary number in each column from your running total f it gives a positive number,
- Put a 1 where the column gives a positive number and a 0 in the rest.
How do you add binary?
- Either convert to denary and add then convert back to binary.
- Or:
1+1 = 10
1+0 = 1
1+1+1 = 11
When two 1s add together, it makes a 0 and carries a 1 over to the next columns.
What is a left shift?
- Where the binary code digits all move along to the left by the specified shift,
- 0s will place hold on the right side,
- This multiplies the entire number by 2^n
‘n’ being the number of shifts
What is a right shift?
- Where the binary code digits all move along to the right by the specified shift,
- 0s will place hold on the left side,
- This divides the entire number by 2^n
‘n’ being the number of shifts
How do you convert Binary to Hex?
- Draw 2 binary tables of 4 columns (8,4,2,1)
- Split the binary code in two and fill the columns,
- Then work out the denary values of the 2 separate 4 bit binary codes ,
- If the denary value is over 10 then replace them with:
10 = A
11 = B
12 = C
13 = D
14 = E
15 = F - The put the two values next to each other (e.g. f4 is hex for 11110100)
How do you convert hex to denary?
- Draw a table with 2 columns (16,1) it is different because it is a table for base 16 not base 2, so each column is multiplied by 16 instead of 2,
- Put one hex value in each column,
- Multiply the first hex value by 16, and the second by 1,
- Then add these two numbers together (e.g. 87 is 135 in denary).
How do you convert denary to hex?
- Denary > binary > hex
- Or divide the value by 16 and hold onto the remainder,
- Put the value in the first column of the hex table (if it is over 10 then it has t be changed to A-F respectively),
- Then put the remainder in the second column (again convert if necessary)
- Then put the two hex values together (e.g. 106 is 6A in Hex)