data rep+fundamentals of algorithm Flashcards
number base
-number of digits used to represent numbers
decimal number base
-base of 10
binary number base
-base=2
hexadecimal number base
-base value 16
purpose of hexadecimal
-large numbers can be shown with fewer digits
-used to show memory addresses
using hexadecimal to write numbers
if number >16, divide by 16 and use the amt it divided by, and the remainder, use each number as a hex
i.e:
8 to hexadecimal:
8
22 to hex:
22/16 = 1 remainder 6
1=Hex 1
6 = hex 6
ans=16
bit
smallest unit of data, rep by 1
byte
8 bits
Kilobyte
1000 bytes
megabyte
1000 kilobytes
gigabyte
1000 megabytes
petabyte
1000 gigabyte
character set
-defined post of recognised characters that can be stored in a computer system
ASCII
—uses 7 bits, up to 128
unicode
-uses 2 bytes, uo to 65k+ characters, universal character set
pixel
-single point in an image, 1 pixel=1 binary code
what factors affect file size?
size:
le image=larger file
colour depth:
-more colour depth = larger image file
analogue
data that varies in value
sound sampling
process where analogie wave is converted to digital signal
sampling rate
-measured in Hz
-number of samples/second taken from analogue signal to convert it to digital
sample resolution
-number of bits used to represent each sample
calculating file size
sample resolution x rate x length
data compression
-reducing data size but keeping most/all info
—faster transmission, saves space
huffman trees
-lossless compression
-follow path, most used at top, least popular at bottom
-find total, x by frequency, compare with how much would’ve taken in ascii
RLE run length coding
-lossless compression
-freq table, where how many times show up in a row
e.g:
book = b(1) o (2) k (1)
-good for large texts, images w same colour
algorithm
set of instructions for carrying out a task
flowchart symbols
-rectangle=process/instruction
-parallelogram=input/output
-diamond=decision
-oval=start/stop
-weird rectangle w lines=subroutine
decomposition
-breaking problem into smaller, more manageable chunks
abstraction
-removing unnecessary detail from problem
efficiency
-shorter=more efficient