Save
Computer science
Topic 2 data
Save
Share
Learn
Content
Leaderboard
Share
Learn
Created by
Myesha ali
Visit profile
Cards (37)
Binary
Computers only understand 2 states: on and off (
0
or
1)
This is represented by
switches
, and computers are essentially
calculators
made up of
billions
of switches.
Everything needs to be converted to
binary
for a computer to
process
1
byte
has 8
bits
and a
nibble
is
4
bits
2^n
shows how many unique
binary
patterns can be generated where n is the amount of
bits
signed intergers use the MSB (
most
significant
bit
) to represent whether the number is
negative
or
positive
If the MSB is
1,
the number is negative. If the MSB is
0
, the number is positive
Two's complement
is a way to show negative numbers. To make a positive number negative, flip the
bits
and
add
1
a
binary shift
to the left
multiplies
the number by 2, a binary shift to the right
divides
by 2.
A logical shift replaces all the empty spaces with a 0
An
arithmetic shift
replaces all the empty spaces with the
MSB
logical -
unsigned
integers
arithmetic -
signed
and
two's complement
integers
an
overflow
error is when an operation produces a result that requires more
bits
to store than available
Consequences of
overflow errors
are: The
program
crashing or producing unreliable or incorrect results.
hexadecimal
is a
base 16
number system that has 16 unique digits. 0 to 9 and
A to F
b =
bits
B =
bytes
(8 bits)
KB =
kilobytes
(1000
bytes
)
MB =
megabytes
(1000
kilobytes
)
GB =
gigabytes
(1000
megabytes
)
TB =
terabytes
(1000
gigabytes
)
B =
bytes
(8 bits)
KiB =
kibibytes
(1024
bytes
)
MiB =
mebibytes
( 1024
kibibytes
)
GiB =
gibibytes
(1024
mebibytes
)
TiB =
tebibytes
( 1024
gibibytes
)
there are 3 main
datatypes
=
string
,
integer
and
float
.
a string is a combination of
text
,
number
and
symbols
an integer is a
whole
number
a float is a number with a
decimal
point
a character set is a set of
letters
,
symbols
and
digits
that are all represented by its own
binary code
.
ASCII =
american
standard
code
for
information
interchange. Its a
7 bit
code that can represent
128
different
characters.
Extended
ASCII = has 8
bits
so
256
unique
characters.
Bitmap
images are made of
pixels
.
a pixel is the smallest
identifiable
area
of an image. each pixel is a
single
colour and is given a
binary
value that represents the colour.
colour depth
is the number of
bits
used to encode the colour of each pixel 8 bits =
256
colours
image size
=
width
x
height
resolution
is the number of
pixels
per inch of the displayed image
file size =
width
x
height
x
colour depth
analogue sounds = sound caused by
vibrations
travelling through a
medium
such as air or water
sound sampling is when
samples
of
sound
are taken at regular fixed
intervals
sample rate = number of samples per second, measured in Hz
bit depth = number of
bits
used to
encode
each sample
audio file size =
sample rate
x
bit depth
x
recording length
data compression
= reduces the size of a
file
lossy compression -some of the data is
permenantly
lost
, but enough remains so the file is
useful.
lossless compression =
none
of the
original
data
is
lost
, and it can be perfectly
restored