Professional Documents
Culture Documents
Cambridge IGCSE Computer Science Notes P
Cambridge IGCSE Computer Science Notes P
Cambridge IGCSE Computer Science Notes P
1. Data Representation
1.1 Binary systems
● Binary data
○ Computer
■ Electronic machine to process data
■ Data → Process → Information
○ Processor
■ Stores data using electrical switches (on/off)
■ Stores & processes data
○ Binary
■ Base 2 (on/off)
■ All data must be turned into binary for computer to process
■ Used for registers where a certain bit controls a specific thing
■ Disadvantages
● Hard to read/understand
● Easy for errors to occur
● Hard to spot/fix errors
● Writing them takes up a lot of space
● Bits & bytes
○ Bits
■ Binary digIT (1/0)
■ Signal on/off switch in the computer’s electronic memory
○ Byte
■ String of 8 bits
■ Computer organises data into a byte
○ Memory
■ Area of computer that stores data as on/off signals
■ RAM (random access memory)
■ Not enough space in RAM = data stored outside RAM (slower to access)
■ Processors contain registers
● Binary & denary
○ Denary
■ Base 10
○ Binary to denary
■ Eg. 0101011100 to denary (348)
512 256 128 64 32 16 8 4 2 1
0 1 0 1 0 1 1 1 0 0
■ Max: 16 bits
■ 4+8+16+64+256 =348
○ Denary to binary
■ Start with largest value you can subtract from the number
■ Continue to subtract until you have 0
■ Put 1 in the matching columns; 0 in all other columns
■ Eg. 40 to binary (00101000)
● 40-32=8, 8-8=0
128 64 32 16 8 4 2 1
0 0 1 0 1 0 0 0
1.2 Hexadecimal
● Digits
○ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F (Base 16)
○ Usage
■ Easy conversion (hex to binary vice versa)
■ Easy to read
■ Takes up less space
● Hexadecimal & Denary
○ Hex to Denary
■ Place into column
■ Multiply accordingly
■ Add them up
○ Denary to Hex
■ Divide denary number by 16
■ Result goes into the
16s column
■ Remainder goes into
the units
■ Larger numbers (> 225)
● Find largest column that is smaller than X
● Divide X by the common value
● Divide the remainder by the next smallest value
● Continue until you reach the units column
● Hexadecimal & Binary
○ Convert: match with the chart
● Benefits
○ Can represent 16 bit words as 4 hex digits
○ Easy to convert digit back to binary
● Usage
○ Defining colors in HTML
■ 24 bit colour
● Eg. #FF0000 (red), #00FF00 (green), #0000FF (blue)
○ Machine code & assembly language
■ Machine code is turned into hex
● Used to represent binary data & addresses
● Easier, faster, less errors
● Eg. 5F 3A 09 F1
■ Error messages displayed in hex code
● Eg. error #C04 door open
○ Media Access Code (MAC) addresses
■ Identifies a device on the internet
● Refers to network interface card (NIC): part of the device
● Unique address
● Static address (doesn’t change)
● Set by manufacturer
■ 48 bits shown as 6 groups of hex digits (eg. NN:NN:NN:DD:DD:DD)
● 1st half = identity number of manufacturer of the device
● 2nd half = device’s serial number
○ Debugging
■ Error message & debugging software are in hex
○ Main memory & registers (in the RAM)
■ Makes data/addresses easier to read
1.3 Data Storage
● Digital data
○ Digital: Something that has a precise value which can be represented as a number
○ Number values stored in binary/denary/hex
○ Text
■ Stored using basic character code
● American Standard Code for Information Interchange (ASCII)
○ Number code representing all standard keyboard characters
○ File types: .txt (storage for ASCII), .doc (text document format), .exe (instructions to be
executed)
■ Meaning of numbers are different in different formats
● Numbers can be stored in number value/text characters
■ Computer must detect file format
● Digital graphics
○ Images
■ Made out of pixels
● Pixel = 1 spot of light
■ Bitmap graphics (.bmp)
● File stores position & colour of every pixel
○ Each pixel has its own number code (lots of data)
● Full dot to dot detail colours of real life can be stored
● Good way to store real-life images
■ Vector graphic (.svg)
● Made of shapes
● Computer stores math formulas on how to draw it (no pixelation)
● Less information
● For cartoons, diagrams, graphs etc.
● Not for storing pictures
■ Pixelation: individual pixels can be seen
■ Colour depth: No. of colour used in an image
● Digital sound & video
○ High quality sound + video = high bit rate
○ Sample rate * No. of channels * bit depth = No. of bytes
○ File types
File format Main uses Advantages Disadvantages