Chap 1 - Data representation (no. systems, [text, sound, video, image], [data storage and file compression]) Flashcards
name the number systems
-binary
-hexadecimal
-Octal
-denary
note: sequence for 2 powers starts form 1
what are the bases for the number systems
-binary - 2
-hexadecimal -16
-Octal - 8
-denary- 10
numbers in Hexadecimal
0 to F
numbers in octal
0 - 7
numbers in denary
0 - 9
numbers in binary
0 - 1
what does 1 mean in binary
- ON, TRUE, HIGH
- flow of electrical signals
what does 0 mean in binary
- OFF, FALSE, LOW
- absence of flow of electrical signals
sequence for binary until 2^13
1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192
what are numbers in binary called
bit
what is Least significant bit (LSB)
bit on the extreme right
what is Most significant bit (MSB)
bit on the extreme left
what is assigned to each bit
index value
what does index value start and end with
0 until MSB in denary
how do you go binary to denary
- use sequence
- multiply the 1 bit by 2 to the power of its index value. and add values
eg, 101 - 1x2^0 + 1x2^2 = 5
how do you go denary to binary
-divide number by 2 until you get 0
-track remainders and take from bottom to top
eg, 2| 12 0
2| 6 0
2| 3 1
2|1
0
9 = 1100
-bottom will be MSB
how do you go from binary to hexadecimal
-group bits into groups of 4 starting from LSB
-add 00 at MSB to complete groups
-convert each group to hexadecimal
-write the numbers starting from MSB group
eg. 0001 1010 = 1A
1 A (hexadecimal)
-MSB no. will start
how do you go binary to ocotal
-group bits into groups of 3 starting from LSB
-add 00 at MSB to complete groups
-convert each group to denary
-write the numbers starting from MSB group
eg. 001 010 = 12 - octal
1 2 (denary)
-MSB no. will start
how do you go from octal to binary
-write the binary bits for each octal digit
how do you go from hexadecimal to binary
-write the binary bits for each hex digit
the bits for hex 9 - F
hex - binary - denary
9 - 1001 |9
A - 1010 |10
B - 1011 |11
C - 1100 |12
D - 1101 |13
E - 1110 |14
F - 1111 |15
number systems conversion algorithms
Hex
|
Octal - Binary - Denary
H - B - 1 digit = 4 bits
O - B - 1 digit = 3 bits
D - B - divide by 2
B - D - sequence
why is binary used in computers
-computers are made up of logic gates
-which only have 2 states (0 or 1)
why is hex used over binary by users
-easier to read/ identify errors because it shortens binary
-takes less screen space
-less chance of making an error
5 uses of Hex
-MAC address
-IP address
-HTML colour codes
-Error code / memory dump
-ASCII
what does MAC address stand for
Media Access Control
what is error codes
locate error
what does Ox and Ob mean in error codes
Ox - hex
Ob - binary
What is HTML colour codes
Hypertext Markup Language colour codes
-represent colour on screen
-diff. values = diff. colours
-intensity of colour depends on Hex value
-primary colours: RGB - Red, Green, Blue
eg. # FF FF FF - white
# 00 00 00 - black
what is ASCII
American Standard Code for Information Interchange
-unique 7 bit values for characters on standard keyboard
-base 256, 0 - 255
Unicode
-support all languages
-up to 4 byte per character
-overlaps first 128 character with ASCII
-Extended ASCII
-1 byte (8 bits) for non-English characters
how do you add or subtract binary
two’s complement
rules for two’s complement
- 0 + 0 = 0
- 0 + 1 = 1
- 1+ 0 = 1
- 1 + 1 = 10 (move 1 to other side)
- 1+ 1 + 1 = 11
note: when asked to find 2’s complement of a number, just do 2’s complement - find the other value
what does each binary value have
a positive and negative number
how to find two’s complement of a number
-find the first 1 from the LSB and flip the bits beyond it
how to convert two complement bit (negative bit) into denary
-find value of first 1 from MSB & make it negative
-add negative no. with the values of the other 1 bits
eg. 10100011 is a two’s complement integer
-128 + (1+2+32) = -93
what does you call when there is an extra number when doing two’s complement addition
carry
eg. 10100 + 10001 = 100101
| this 1 is overflow
how do you add binary
add the number using the two’s complement rules
how do you subtract binary
-convert the subtracting number to negative by finding the first 1 from LSB and flipping the other numbers
-add the numbers
-if answer is supposed to be negative flip the binary result
-if there
eg. 0111 - 1010 (7 - 10)
(10) 1010 - (-10) 0110
0111 + 0110 = 1101 -> - 0011 (flipped)
(7 + (-10) = -3)
-make both no. same no. bits first
why does overflow error happen
-when the binary value is larger than the __ bit register
-so all the bits required to represent the value cannot fit
how to do multiplication and division
logical binary shifts
which direction is multiplication and division in logical binary shift
multiplication - left
division - right
what is each shift in logical binary shift worth
an power of 2
how do you do logical binary shifts
add a 0 to MSB or LSB based on multiplication or division
what will happen when computers don’t have enough bits to store date from logical shift
error message
define a bit
smallest unit of data a computer can process
define bitmap
image made up of 2D matrix pixels
define pixel
single element of a bit-map image
define colour depth
no. bit allocated for each colour
define image resolution
number of pixels required for an image
define screen resolution
number of pixels on a screen
are file size and image size the same
yes
what is image size/ file size
total bits needed for an image
how to get file size for image
colour depth x image resolution
what happens when you increase colour depth or image resolution
file size increases
variables when finding file size of image
-colour depth
-image resolution
define sample resolution
number of bits allocated for each sample
variable when finding file size of sound
-sample resolution
-sample rate
-audio size
define sample rate
number of samples collected per second
define audio size
length of sound
what happens when you increase sample resolution or sample rate or audio size
file size increases
how to get file size for sound
sample rate x sample resolution x audio size
what must sample rate be
consistant
benefits of increased variables for sound
-larger dynamic sound
-better faithful sound quality
-less sound distortion
drawbacks of increased variables for sound
-produce larger files
-longer to transmit or download file
-require greater processing power
how to compress an image
-reduce colour depth
-reduce image resolution
how to compress an audio
-reduce sample rate
-reduce sample resolution
2 types of file compression
-lossy
-lossless
what is lossy compression
-compression algorithm removes unnecessary data from the original file
-original file cannot be reconstructed once compressed
what is lossless compression
-reduces file size without removing any information
-original file can be reconstructed once decompressed
describe how lossy compression reduces file size in a video
-uses compression algorithm
-reduntant data is removed
-reduce: colour depth, image resolution, sample rate, sample resolution, frame rate
-use perceptual music sharpening
-data is permanently removed
reasons to use lossy over lossless
-more decreases file size
-less storage space on computer
-quicker to download/ upload
-may not need to be high quality
-website will load faster for user
-less lag/ buffering when watching (video)
-use less data allowance
what does lossy do to images
decreases image resolution, colour depth and crop image
3 lossy compression algorithms
-JPEG
-MPEG-3
-MPEG-4
what is done when there is perceptual music sharpening
-decrease sample rate
-decreases sample resolution
-remove frequency outside of human hearing
-remover softer sounds
what is the human hearing range
20Hz - 20 000Hz
what is the size reduced by perceptual music sharpening
90%
how does JPEG do lossy
-reduce colour depth
-separate pixel colour from brightness - allows some data to be distorted
how does MPEG-3 do lossy
-use perceptual music sharpening
how does MPEG-4 do lossy
-extended version of MPEG-3
-reduce sound quality, image quality, frames per second
3 lossless algorithms
-GIF
-PNG
-RLE
what is RLE
-Run Length Encoding
-reduces size of identical and adjacent string data
-first repeated strong is encoded with no. identical data items and code of data item- respectively
what compression does text, image, audio and video data use
-text: lossless
-audio: lossy
-image: lossy, lossless
-video: lossy, lossless
how is RLE used for text data
eg. aaa aa - 05 97
05 - number of identical data items
97 - ASCII code for “a”
-it changed from 5 bits to 4 bits
How is RLE used for image data
eg. 2 black, 1 white, 3 black (image)
-go with 1 colour and change it when the next one comes
02 00 00 00
02 - number of times
00 00 00 - code of colour
2 memroy conversion style
-Binary
-Denary
3 reasons to reduce file size
-shorter time to transmit file
-shorter time to download/ upload file
-less storage space
what is a byte worth
8 bits
what is half a byte called
nibble
write the names for binary style memory conversion
-Bits
-Byte
-Kibibytes (Kib)
-Mebibytes (Mib)
-Gibibytes (Gib)
-Tebibytes (Tib)
-Pebibytes (Pib)
-Exibibytes (Eib)
what is the conversion between bits and byte
2^3
what is the conversion except bit to byte in binary memory conversion
2^ 10 = 1024
if go from bottom in memory conversion:
if go from top in memory conversion
-multiply
-divide
write the names for denary style memory conversion
-Bits
-Byte
-Kilobytes (KB)
-Megabytes (MB)
-Gigabytes (GB)
-Terabyte (TB)
-Petabyte (PB)
-Exabyte (EB)
what is the conversion except bit to byte in denary memory conversion
10^3 = 1 000