Please enable JavaScript.
Coggle requires JavaScript to display documents.
1.4.1 - data types (real numbers (Normalisation starts with 10 or 01…
1.4.1 - data types
real numbers
a dot is added after 1
1/2, 1/4,/18
2.5 = 0010.1000
binary point is moved "floated"
this is represented by using twos complment
size increases the bigger the manitass but accruacy decrese
point is allways after MSB natrually
Normalisation starts with 10 or 01
makes sure its stroed with greates accuracy posoble
only one way to store each number
back fill with 0 for ois or 1 for neg
for addition move the point to the same place , add then re normalize
positive exponents move right negeitive move left
more numbers in manntiace means smaller range but larger accuracy
primitive data types
integers
whole value
positive or negetive
real
any fractional number
pos or neg
composite types can be constructed
String
array of chars
any set of chars together
char
any symbol Letter digit etc
control symbol
boolean
true or flase
one bit
used for flags
needed as computers do not instivly recognise charecters
Hex
base 16
0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
each binary nibbit is one hex char
27-1B
179-1011 0011 -B3
used as it is easier to see for humans to read and remember but also easer to convert to its binary equivilent
one nibit is one charicter
representativeness intergers
1 is current on 0 is off
128-64-32-16 8-4-2-1
25- 0001 1001
0100 0111-1+2+4+64 =71
sighn and magniride
take the MSB
turn it to repsent sighn
0- pos
1 for negative
twos complmet
ones complement add one
MSB is negetive
work out pos then swap unil you get to the last one then stop swapping
allows for arithmetic operations to be performed more easily
adding and subtracting in binary
add twos complement to minus
the carried one is outside the range so ignore
just add normally
convert then add
just add normaly
if subtracting carry 2 not 1
character sets
ASCII
orignally 1 byte
MSB is always 0 so 128 codes - used for error checking
American standed code for information inforchange
not enough to contain other special cahrictes
UNICODE
at least 16 bits
contines much more charcters
over 120000 chcters
universal encode all modern langages
requreres twice as much space
uses pages
same charter set is needed for commpuincation
instructions
the cpu donst know the diffrence
acts on what it exspects
star location is interpreted as an isntruction
bit wise manipulation
shift
shift moves all charters across one
left shift is *2
right shift is /2
<< or >>
bits that fall off is overflow or underflow
0101 0011 << (0)1010 0110
0101 0011 >> 0010 1001 (1)
circler shifting swaps underflow or overflow
Masking
AND
extracs
both 1 for one
1 mask returns bit 0 returns 0
routing too see if they have the same network
XOR
Toggle
same 0 different 1
checks to see if they are the same
1 reverses value 0 keeps it
OR
subset
00 -0 else 1
returns 1 if 1 returns original if 0
sets value or retains them
images and sound
image
each pixel has an amount of bits related too it that says whot it can be
bits are depbind by colour depth
images are repsented by binary
meta date- width, height, colour depth
can be vectors swhich work in proportions so dont blur
sound
sample rates -hztsa
bit rate is the space for each sound
the amount of waves is also combined to make size