4.5 Fundamentals of Data Representation Flashcards
Natural Numbers
All positive integers starting and including 0
Ordinal Numbers
Used to tell the position of a number that is placed in an order
Counting and Measurement
Counting = Natural Numbers
Measurement = Real Numbers
Hex vs Binary (3)
- Hex is easier to code/read/enter/spot errors/remember
- less change of human error
- less digits in hex: 2 in hex vs 8 in binary
The Bit (definition)
The fundamental unit of information
n bits can represent – values
2^n
Prefixes
- Powers of 10 prefixes:
- Kilo, K - 10^3
- Mega, M - 10^6
- Giga, G - 10^9
- Tera, T - 10^12
- Powers of 2 prefixes:
- Kibi, Ki - 2^10
- Mebi, Mi - 2^20
- Gibi, Gi - 2^30
- Tebi, Ti - 2^40
Signed vs Unsigned Binary
Unsigned = cannot represent -ve numbers
Signed = range of magnitude decreases
Binary Subtraction (3)
- Convert w/ 2’s complement (flip +1)
- Add numbers together
- Discard overflow
Decimal Numbers (2)
- Not accurate - close as possible, not over
- More bits available = greater precision
Error Calculations
- Absolute error = original - binary
- Relative error = absolute/original
- Percentage error = relative x 100%
Normalised Binary (5)
- +ve starts with
- -ve start with
- Parts
- +ve: start with 0.1
- -ve: start with 1.0
- Mantissa = main value
- Exponent = power
- Starts with 1 if -ve
Advantages of Normalised Binary (3)
- Maximise precision
- Better accuracy
- Unique representation of each number (distinguish +ve and -ve)
Character Sets (2)
- Every number, letter, symbol you can type has an ASCII code associated to it
- Globally recognised, uniform
ASCII (3)
- English alphabet
- Lower, upper, nums, some symbols
- 7 bits = 128 possibilities
Unicode (2)
- ASCII + all alphabets, symbols, emojis
- Use ASCII until character is only in Unicode
Parity Bit (3)
- Bit added to end of string of binary
- Ensures total num 1 bits is even/odd
- Simplest form of error checking
Advantages of Parity Bits (3)
- little storage
- less to process
- easy to make
Disadvantages of Parity Bits (3)
- can’t detect multiple errors
- doesn’t fix errors
- not very reliable
Majority Voting (2)
- Bits can change due to interference
- Each bit transmitted x3 - most common chosen
Advantages of Majority Voting (4)
- detects multiple errors
- fixes errors
- easier to make
- very reliable
Disadvantages of Majority Voting (2)
- more storage
- more to process
Check Sums Process (5)
- Data sent in block of several bytes
- Bytes added up
- Result transmitted with data
- Receiver works out checksum
- Data accepted if they match
Analog vs Digital
Analog = continuous stream of transmission
Digital = discrete set of fixed values
Check Digit (5)
- Process
- Purpose
- Many different algorithms used
- Calculated from all other digits in code
- Added to end
- Compared when received
- Purpose: spot human error of data entry
Vector Images
- Process
- Examples
- Objects layered + properties recorded
- Size (width/height/radius), colour fill/outline, weight
- e.g. Logos
Advantages of Vector Images (4)
- better quality
- small file size
- edit easily
- scalable
Disadvantages of Vector Images (2)
- can’t represent real life images
- can’t compress
Bitmap Images (7)
- Process
- More bits =
- Resolution =
- Colour Depth =
- Metadata (2)
- Examples
- Pixels with colour codes (in binary) stored in grid like pattern
- More bits = more colours = better quality = larger file size
- Resolution = num pixels per inch
- Colour depth = num bits for each pixel to assign colour (n bits = 2n colours)
- Metadata: data attached to an image
- Width, height, colour depth, date, author, file type
- e.g. photos, videos, digital art
Advantages of Bitmap Images (1)
- can represent real life images
Disadvantages of Bitmap Images (4)
- large file size
- low quality
- can’t edit easily
- not scalable
Sound (3)
- Need analogue to digital converter
- Samples taken by measuring amplitude of waves at regular intervals
- Result stored in binary
Sample Rate (definition)
Num samples per second
Sample Resolution (definition)
num bits available for each sample
The higher the sample resolution/rate (2)
- the better the quality
- the larger the file size
Bit Rate (definition)
sample rate x resolution
Nyquist Theorem (definition)
To produce an accurate reading: sample rate >/ 2x highest freq in original sound
MIDI (8)
- Technical standard
- Describes: Protocol, digital interface, standard set of connectors
- Allows for range of instruments/computers to communicate
- Controller sends+receives event messages
- Duration of note, pitch, vibrato
- All easily changed
- No live audio - pre recordings of real instruments
- “List of instructions”
Advantages of MIDI (6)
- Easy modify/edit
- Score directly generated
- No data lost about notes
- Easy change instruments
- No background noise
- Smaller file sizes
Advantages of Lossless Compression (2)
- can be used on anything
- original data can be retrieved (quality not lost)
Disadvantages of Lossless Compression (2)
- smaller reduction
- slower transfer
Advantages of Lossy Compression (2)
- larger reduction
- faster transfer
Disadvantages of Lossy Compression (2)
- can’t use on text files/programs
- original data cannot be retrieved
Run Length Encoding (4)
- Type of compression
- Process
- Used On
- Lossless compression
- Identifies repeating patterns
- Stores one copy of pattern + how many times repeats in succession
- Used on: images, sound, text (unlikely)
Dictionary Encoding (5)
- Type of compression
- Process
- Lossless compression
- Long passages with lots repeated words
- Variable length of strings of symbols of original data represented by single tokens
- Dictionary formed using token as index
- Strings of symbols used as entries
Encryption (definition)
act of protecting data by making it unreadable
Caesar Cipher
shift right n places
Advantages of Caesar Cipher (2)
- easier to code
- easier to generate key
Disadvantages of Caesar Cipher (4)
- easy to hack
- 25 possible keys
- less secure
- key must be kept secure
Vernam Cipher (9)
- Process
- Key must be
- Features
- Plaintext XOR key = ciphertext
- Ciphertext XOR key = plaintext
- Key must be:
- Same length
- Completely random
- Only used once
- Kept secure
- Mathematically impossible to hack
- nothing can be learnt about plaintext from ciphertext
Advantages of Vernam Cipher (2)
- mathematically secure
- larger range of keys
Disadvantages of Vernam Cipher (3)
- harder to code
- harder to generate keys
- key must be kept secure
Digital Signature (4)
- Features
- Reasons
- Similar to real life signature
- Uses mathematical functions, private, public keys to create unique signature
- Reasons
- Know if message corrupted
- Sender verification
Process of Sending a Message Using Digital Signatures
- Hash plaintext → message digest
- Sender’s private + digest → signature
- Add signature to plaintext
- Encrypt (sign + pt) w/ receiver’s public
- Send message
- Decrypt (sign + pt) w/ receiver’s private
- Split signature and plaintext
- Sender’s public + signature → digest
- Rehash plaintext → message digest
- Compare digests
Underflow (definition)
Storing less bits in a given space
e.g. storing 3 bits as a nibble: 0011, 00 is the underflow
Why Normalise Floating Point (2)
- better accuracy for a given number of bits
- unique representation for all numbers (can tell easily if +ve or -ve)
Floating Point vs Fixed Point
- Floating: far greater range of values for a given amount of bits
- Floating: can take bits from exponent to add to mantissa to improve accuracy
- Fixed: greater precision for a given amount of bits (more accurate)
Mantissa =
Exponent =
Mantissa = Accuracy
Exponent = Range
Bytecode
- what is produced by a compiler
- intermediatory code
- not processor specific
- executable files are processor specific
- can convert into different processor specific executable files
- use a virtual machine to run security checks
- bytecode can be altered to be specific for a virtual machine