S4 - Data representation (Done) Flashcards
What are the three logic gates ?
NOT, AND and OR.
What are logic gates ?
Special circuits built into computer chips, which receive binary data, apply a boolean operation and then output a binary result.
What is a NOT gate ?
They take and give a single output, the output being the opposite of the input.
What is an AND gate ?
They take two inputs and give one output, if both inputs are 1 the output is one, otherwise the output is 0.
What is an OR gate ?
They take two inputs and give one output, if one or more inputs are 1 then the output will be one, otherwise the output is 0.
What do the 1s and 0s used by computers actually represent ?
The flow of electricity, 1 meaning there is a flow, 0 meaning there isn’t a flow.
What is a bit ?
A single binary digit.
What is a nibble ?
4 bits.
What is a byte ?
8 bits.
What is a kilobyte ?
1000 bytes.
What is a megabyte ?
1000 kilobytes.
What is a gigabyte ?
1000 megabytes.
What is a terabyte ?
1000 gigabytes.
How many values can a nibble take ?
Made up of 4 bits so 2^n (where n equals number of bits) so 2^4 = 16 different values.
How many values can a byte take ?
Made up of 8 bits so 2^8 = 256 different values.
What is the standard number system called ?
Decimal, denary or base-10, as it uses 10 different digits.
What is binary called ?
Base-2, as it only uses 2 digits (1 and 0).
What are the rules for addition in binary ?
0 + 0 = 0, 1 + 0 = 1, 1 + 1 = 0 carry the 1, 1 + 1 + 1 = 1 carry the 1.
What does a left binary shift do ?
Multiplies the number, for every place shifted left the number is doubled. So 2^n (n = number of places shifted) to calculate what the number is multiplied by.
What does a right binary shift do ?
Divides the number, for every place shifted right the number is halved. So 2^n (n = number of places shifted) to calculate what the number is divided by.
What is hexadecimal ?
Base-16, uses 16 different digits - each hex character equates to a nibble in binary.
Why is hex preferred when coding ?
Simpler to remember large numbers in hex - they’re shorter than binary, due to this lower chance of input errors and it’s easier to convert between binary and hex than binary and decimal.
How do place values in hex change ?
Increase in powers of 16 from right to left - 4096, 256, 16, 1
How can you convert between hex to decimal ?
Write the hex digits under each ones correct place value and then multiply the hex digit by the place value and add the products together to get the decimal number.
How do you convert from decimal straight to hex ?
Check what the maximum place holder value that the decimal number can be divided by to be greater than 1 and draw out the place holder table up to this number, divide the decimal number by the first place value and then take the remainder and put this in the other place holder.
How can you convert from binary to hex ?
If each hex digit equates to a nibble in binary split the binary into 4-bit chunks and work out the decimal and then subsequent hex value for each chunk and then put the hex digits back together.