Computer Science Mocks Flashcards
What is a bit?
A binary digit that is a 0 or 1
What is a nibble?
A group of 4 bits or 1/2 a byte
What is a byte?
A group of 8 bits that can store 1 of 256 numbers
How many bytes in a kilobyte?
1000
Order of bytes?
Bit - Nibble - Byte - Kilobyte - Megabyte - Gigabyte - Terabyte - Petabyte
How many kilobytes in a megabyte?
1000
How many megabytes in a gigabyte?
1000
How many gigabytes in a terabyte?
1000
How many terabytes in a petabyte?
1000
How do overflow errors occur?
When binary addition results in a 9 digit number
What is a binary shift?
A way of multiplying or dividing binary by powers of 2
Is a right binary shift multiplying or dividing?
Dividing
Is a left binary shift multiplying or dividing?
Multiplying
Why might the size of a file need to be reduced?
- Less storage space required
- Faster download times for better online experience
- Faster streaming of video/audio files
Two types of compression?
- Lossy
- Lossless
What is lossy compression?
When unrequired data is removed from a file
An example of lossy compression?
MP3s where sound quality may reduce but not enough to notice.
What is lossless compression?
When data is temporarily removed from a file but added back (rebuilt) when the file is used again
An example of lossless compression?
Zip files, they need to be extracted before they can be used
How do MP3s use lossy compression?
Certain frequencies that are not noticeable are removed which reduces data but no noticeable loss of quality
How do online chatting and mobile phone networks use lossy compression?
Used to ensure only a small amount of bandwidth is used which reduces sound quality but is still understandable by the other person
How do images use lossy compression?
Details of the image may be lost but not impairing overall quality
Why is lossy compression important on websites?
Page load speeds can be affected by images that are especially large in size
Two types of lossless compression?
- Run Length Encoding
- Dictionary Coding
What is the largest number that a byte can hold?
255
How do you convert hexadecimal to binary?
Find the binary value of the first digit, find the binary value of the second digit and put them together
How do you convert binary to hexidecimal?
- Split it into nibbles or add 0’s if you can’t
- Draw tables with 8, 4, 2, 1
- Fill in the table with the binary numbers
- Convert each value into hexadecimal
How do you convert hexadecimal to denary?
- Draw a table with 16 then 1
- Put the hexadecimal values into the table
- Multiply the first value by 16 and the second value by 1
- Add these values together, this is your denary number
How do you convert denary to hexadecimal?
- Draw table with 16 then 1
- Divide the denary number by 16
- Divide the remainder by 1
- Put the first and second value together to get the hexadecimal number
Does lossy or lossless compression give a smaller file?
Lossy
What is machine code?
A very low level language that a CPU can understand
Examples of machine code?
Binary and hexadecimal
What is assembly language?
Low level language
Features of machine code?
Hard for humans to write and read
Features of assembly language?
Easier for humans to write but still difficult`
Purpose of high level langauge?
Easy to understand and write and can be translated into a language that can be understood by the CPU
What are translators?
Programs that convert high level language commands into something that the CPU can understand and process
What are the three types of translators?
- Compiler
- Interpreter
- Assembler
What does a compiler do?
Converts the whole code into one file which can be run on any computer without a translator, can take a long tim
What does an interpreter do?
Converts source code into machine code 1 line at a time so is very slow but good for programs in development for programmers to highlight issues
What does an assembler do?
Converts assembly level language into machine code
What is an IDE?
Integrated development environment
What are the parts of an IDE?
- Source Code Editor
- Interpreter
- Automation Tools
- Debugger
- Compiler
- Auto-Documentation