Data Types Flashcards
What is meant by primitive data type
a basic data type provided by the programming language as a basic building block
types of primitive data types (5)
integer
real/float
boolean
character
string
What is denary
base 10 number. uses the combination of ten symbols to represent any number
What is binary
base 2 number. uses the combination of 2 symbols (0 or 1) to represent every number
What is hexadecimal
based 16 number. uses the combination of 16 symbols (10 numbers and 6 letters) to represent every number
why use hexadecimal?
easier to read/ remember
quicker to write/type
less chance of making an error
easy to convert
uses of hex
define colours
in MAC addresses
in assembly language and machine code
what is a integer
any positive or negative whole number e.g. 3, 0, -14
What is real (floating point)
a positive or negative number with a fractional component e.g. 0.002 or -1.98
What is a character
Any single letter, symbol, number, character or control character
what is a string
any combination of letters, symbols, numbers, characters or control characters e.g. Hello, £4.56
What is Boolean
Any true/ false data types which often represent logical situations
What is ASCII?
American Standard Code. For Information Interchange
7 bit standard ASCII is able to represent 128 different characters
MSB is set to 0
128 unused code points
What is extended ASCII?
Makes use of remaining 128 codes
represents special characters
many different extended ASCII code sets
useful for representing different languages
What is Unicode?
ASCII uses 1 byte per character, so can only store 256 characters
some languages have > 12,000 characters
Unicode uses 2 bytes per character
This equates to 65,536 different characters
Eliminates the need for extended character sets
Extended Unicode uses 21 bits allowing us to represent dead languages
What are sound cards?
- Translate analogue sound into digital signals for the computer to understand
How are sound waves converted so a computer can understand them?
Converted via equipment such as microphone into voltage changes
Changing voltage is sampled at intervals, sample rate
Sampled values converted into binary
Collection of binary values stored as a sound file
What is a digital analogue converter?
Stored sound data recreated using DAC
Binary numbers converted back into a varying voltage
When the voltage is fed to a speaker driver it results in vibrations which reproduce the sound
What is the sampling rate?
Number of samples taken per second (from analogue sound waves)
Measured in hertz (44.1 KHz for an audio CD)
Higher sample rates means the closer the match between the original analogue sound waves and digital version. However more processing power is required to manipulate data and the file size will be larger
What is the bit rate?
Number of memory bits used to store each sample per given time period
Higher bit rate = larger file
What is a bitmap image?
Groups of pixels
colour of each pixel stored as binary code
Becomes pixelated when enlarged. The pixels are larger and more visible
To store large or high res images a bitmap needs to store more information and the size of the file increases with size and resolution
What is the colour depth?
The number of bits used for each pixel
More bits per pixel means bigger size
More combinations of pixels means more colours possible
1 bit/pixel = 2 possible colours
24 bit / pixel = 16 million possible colours
What are vector graphics?
Stored as set of instructions
How to draw each shape
Geometric shapes, logos and text
When enlarged, entire image is redrawn
No pixelation occurs. Smooth rescaling
Usually smaller files sizes
Size of file it not affected by size of image as the definition for the primitive shapes and control points remain unchanged
What is metadata?
Information about the image that allows the computer to interpret the stored binary accurately to reproduce the image.
Contains width, height and colour depth
What is the resolution of an image?
-The number of pixels per unit (ppi)
What is hex?
Short form of binary that is easy to remember
How do you add FLPB?
1-convert exponent back to SF
2-Reverse the exponent
3-add like normal binary
How do you sub FLPB?
1-convert exponent back to SF
2-reverse the exponent
3-make both mantissas the same size
4-convert the negative using 2’s compliment
5-add one to the negative value
6-add like normal binary
What does shifting do?
logical shift moves each binary value left or right with any voids being filled with a 0
shift to the left by 2 = value*4
shift to right by 2 = value/4
What is a mask? (Bitwise manipulation)
-bits in the mask chosen to manipulate the bits in the operand, allowing them through or blocking them
What does the ALU use NOT operations for?
-NOT = creates a ones compliment value (all 1’s switch to 0’s and vise versa)
What does the ALU use AND operations for?
-AND = can be used to return bits by using a 1 in the mask or exclude bits by using a 0. Useful for checking conditions stored in a binary value