4. Data Representation Flashcards
How does binary work?
Each digit is a 0 or 1. The system works in base 2. That means each digit from right to left represents 1, 2, 4, 8, etc.
What is hex short for?
Hexadecimal
How many digits are there in hex?
16
0 - 9 and A - F
How is hex linked to binary?
Each hex digit is equivalent to a binary nibble of 4 digits. For example, 1110 is E.
How can an 8-bit binary number be written in hex?
Each of the two nibbles is converted to hex and then these are joined together.
For example, 1101 is D and 0100 is 4.
So, 11010100 is D4 in hex.
How do you convert from hex to denary?
- Convert each digit to a nibble of binary
- Put the two nibbles together
- Convert this to denary
How do you add two binary numbers?
Using column addition.
0 and a 0 make 0.
0 and 1 make 1.
1 and 1 make 0 but carry 1 to the next column.
What is an overflow error?
When the processor does not have enough bytes available to process an instruction.
What is a nibble?
4 bits
What is a byte?
8 bits
What is a kilobyte?
1024 bytes
What is a megabyte?
1024 kilobytes
What is a gigabyte?
1024 megabytes
What is a terrabyte?
1024 gigabytes
What is the order of ‘bytes’ in increasing size?
Nibble Byte Kilobyte Megabyte Gigabyte Terrabyte
What is a bitmap image?
An image stored as a series of values per pixel. The colour of each pixel is stored in a file.
What is a pixel?
A picture element - the smallest part of a bitmap picture.
What does DPI stand for?
Dots per inch
What is resolution?
The amount of pixels in an image. Usually measured in DPI.
How is binary used in a black and white bitmap picture?
Each pixel is represented by a 0 or 1. Only two are needed because there is only black and white.
What is colour depth?
The amount of bits used per pixel to encode the colour information.
How is binary used to represent pixels in a colourful image?
Each colour is given a binary number. If there are only 4 colours then they can be represented using 00, 01, 10 and 11.
What is the difference between vector and bitmap images?
BITMAP
• Each pixel is mapped and given a colour
• Suitable for photographs
• Quality is lost when stretched or resized
VECTOR
• Instruction for how to draw the picture are included
• Length of line, angles, curves, thickness of lines, etc.
• Best for cartoons and clip art
• Quality not lost when resized
What is lossless compression?
When a file is compressed so that picture quality remains the same and it can be decompressed into its original quality.
What is lossy compression?
When a file is compressed so that it permanently removed data. It cannot be decompressed into a file of the same quality.
What does analogue mean?
A continuously varying signal - like a car speedometer
What does digital mean?
A discrete value (a single number)
0s and 1s in computers
What does ADC stand for?
Analogue to Digital Converter
What is the sample rate?
The number of samples taken per second.
What is sample resolution?
The number of bits allocated per sample.
How is an analogue sound converted to a digital representation?
Using an ADC.
- Samples are taken multiple times per second
- A digital value is assigned to each sample.
- If a value falls between bit values, the value is rounded.
- The samples can be used to make a ‘graph’ showing the change in amplitude over time
The more samples taken per second…
…The better the quality of the recorded sound
What is quantisation?
The process of digitising an analogue sound signal.
What is the largest number which can be shown in a byte?
255
How many numbers can be shown in a byte?
256
What is a character set?
The set of symbols that can be represented by a computer.
What does ASCii stand for?
American Standard Code for Information Interchange
What is needed for a bitmap pixel to have 4 colours?
2 bits per pixel
What is Unicode?
Larger character set than ASCii (16 or 32 bits) and can represent many more characters from all languages.
What is ASCii code?
- 7-bit character set used by PCs.
* 128 characters represented
What is a bit?
A single binary digit: 0 or 1
What is 1024 equal to?
2^10
How do you convert from denary to binary?
- Convert to binary
- Convert each nibble to hex
- Put these together
What is F in hex equal to?
15
How is a key press transmitted to a computer?
- The code number of the key is transmitted to the computer
* The code number is stored as binary
How many characters can ASCII and Unicode represent?
ASCII - 2^7
Unicode - 2^16 or 2^32
Give 3 examples of character encoding systems.
- ASCII
- Unicode
- EBCDIC
What is EBCDIC?
- Extended Binary Coded Decimal Interchange Code
* An 8-bit encoding system
How many bits do ASCII, Unicode and EBCDIC use?
ASCII - 7
Unicode - 16 or 32
EBCDIC - 8
What is metadata?
Data about a data file (e.g. the resolution)
What is a vector graphic?
An image file that is made up of lines and shapes that have certain properties.
What factors affect the sound quality of a digital sound?
- Sample resolution
* Sample interval
What is sound synthesis?
When the sound from a digital file is recreated and played through speakers.
What is an instruction set?
The group of instruction available for a specific processor to use.
What determines the number of bits used in an instruction set?
The number of instructions.
E.g. With 4 bits there could potentially be 16 different instructions.
What is opcode?
The group of bits in a machine code instruction that represents the instruction, such as EAT, MOVE or TURN.
What is operand?
The data in a machine code instruction that the operation will use, such as 5.
What two things could the operand be?
- An actual value (e.g. 5)
* An address in memory where the data can be found
What is the difference between opcode and operand?
Opcode is the operation to be carried out, while operand is the data to do this with.
How does a computer know which memory locations hold instructions and which ones hold data?
• Every location in memory has a specific address
• A compiled program is stored in memory with the machine code and related variables all in adjacent memory locations
• When the OS loads the program, it loads it into free space in memory and loads the start address into the processor
• The processor will continue executing instructions until it reaches a stop statement or until an error happens.
• The operand in each instruction indicates where to look for data.
• Therefore, it doesn’t matter where the program is stored in memory because the instructions in it will always be consecutive.
(See pg 59 of textbook)