Bitmap
stores the colour (in binary) of every individual pixel
+ edit individual pixels
- fixed resolution (can only print at the resolution its saved at)
- saves the full screen, even if nothing there
- you can't layer object
Vector
stores the image as a list of objects storing their attributes (e.g shape, x and y co-ordinates, line thickness, colour)
+ Resolution Independant
+ can layer objects
+ can edit the individual objects
- can't edit individual pixels
Wednesday, 31 August 2011
Thursday, 25 August 2011
Wednesday, 24 August 2011
Parameter passing (modularisation)
ByRef - used when you need to change the value of a variable (physical address)
ByVal - used when the variable needs to not be changed (sends a local copy of variable)
IN:
OUT:
ByVal - used when the variable needs to not be changed (sends a local copy of variable)
IN:
OUT:
Monday, 22 August 2011
Floating Point Representation (Posse!)
Floating Point rep allows us to represent real numbers
We need two numbers to store it - The Mantissa and The Exponent
The Mantissa represents the actual number to represent the actual number
The Exponent represents the number of places to move the decimal place
Increasing the number of bits for the Mantissa increases the accuracy of the number
Increasing the number of bits for the Exponent increases the range of the number
(MARE!)
We need two numbers to store it - The Mantissa and The Exponent
The Mantissa represents the actual number to represent the actual number
The Exponent represents the number of places to move the decimal place
Increasing the number of bits for the Mantissa increases the accuracy of the number
Increasing the number of bits for the Exponent increases the range of the number
(MARE!)
Friday, 19 August 2011
Negative Numbers
Signed Bit Notation
has a leading 1 if its a negative number
1 0 0 1 0 0 0 0 = - 16
0 0 0 1 0 0 0 0 = + 16
Its Rubbish!
-Two Representations of zero
1 0 0 0 0 0 0
0 0 0 0 0 0 0
-Lose range because of the signed bit
Two's Complement
*Process
Invert and add 1
Only if its negative (and this has a leading 1)
1 1 1 1 0 1 1 1
0 0 0 0 1 0 0 0 INVERT
0 0 0 0 1 0 0 1 + 1 = - 9
has a leading 1 if its a negative number
1 0 0 1 0 0 0 0 = - 16
0 0 0 1 0 0 0 0 = + 16
Its Rubbish!
-Two Representations of zero
1 0 0 0 0 0 0
0 0 0 0 0 0 0
-Lose range because of the signed bit
Two's Complement
*Process
Invert and add 1
Only if its negative (and this has a leading 1)
1 1 1 1 0 1 1 1
0 0 0 0 1 0 0 0 INVERT
0 0 0 0 1 0 0 1 + 1 = - 9
Why do we use the Binary Numbering System?
Binary is a two state numbering system (0 and 1)
Computers are two state machines (On and Off)
Advantages??
* Less Rules of addition (/*-) to program into the processor
* Not affected by voltage degradation
* Easier to store the states in backing storage
Computers are two state machines (On and Off)
Advantages??
* Less Rules of addition (/*-) to program into the processor
* Not affected by voltage degradation
* Easier to store the states in backing storage
Subscribe to:
Posts (Atom)