Why overflow?
- The number cannot be represented in the number of bits available (too long)
- Answer larger than maximum positive number that can be stored in the register
Why hexadecimal?
- Easier spot mistake
- Memory dump
- Html colour codes
- Mac & ip adress
BCD
- Uses
o Financial calculations
o Calculators, digital clocks
- Why
o Easier to convert between denary and BCD
o Remove floating point rounding error
o can represent monetary values exactly
- why cannot be bcd?
o The denary value in the group of 4 bits is greater than 9
Character set
- All of the characters that the computer can represent
- Each character has a unique number/binary number
- How is it represented?
o Each character has unique binary code
o Binary code stored in sequence
- ASCII
o Uses 7 bits (2^7 characters)
- Extended ASCII
o Uses 8 bits (2^8 characters)
- Ascii vs unicode
o Similarity
▪ Both can use 8 bits
▪ Both represent each character using a unique code
o differences
, ▪ Unique code: 16/32 bits; ascii: 7 or 8 bits
▪ Unicode can represent more characters
How word represent in ascii code
1. Each character has its own unique code
2. Each character in the word is replace by its unique code
3. Each code is stored in the word in the sequence
Analogue data
- Data values that are continuously changing
How analogue sound converted to digital (sampling )
- Value of analogue sound wave measured at set intervals
- Each sample given binary number and stored in sequence
Sound recording
- Amplitude is recorded a set number of times a second
- Each amplitude is given a corresponding binary number
- Binary number saved in sequence
- Sampling resolution (how many bits represent each sample)
- Num of bits used to represent sound amplitude (bit depth)
o Increased, number of bits used for each sample is increased
o More amplitude can be represented
o Digital waveform is closer to the original waveform
- Sampling
o Taking measurement at regular intervals and storing the values
- Sampling rate
o Number of samples taken per second
o Sound recorded more often
o Smaller quantisation errors
o Digital waveform closer to analogue waveform
Bitmap image
- Image is made of pixels and each pixel has one colour (unique binary code)
stored in sequence
- Pixel: the smallest part of the image//one square of one colour
- Bit depth/ colour depth: number of bits used to represent one colour in a pixel of
an image
o Higher bit depth, greater range of colours
o Higher bit depth, more bits per pixel , more data stored
o Greater file size
, o Image closer to original
- Image resolution : number of pixels wide by the number of pixels high
o Image quality increases when increased
o More pixels can be stored in
o File size increases
- File header: stores the metadata of an image
File header
- Compression type
- Dimensions
- Colour depth
Image resolution
Vector Graphic
Image created from geometric shape required attribute
- Property: attribute of a drawing object // data about a shape
- Drawing lists
o lists of objects that form the image
o list that stores the command to draw each object
o eg: properties of each object: fill colour
- Drawing object: a component created using a formula
Bitmap vs vector graphic
- Can be enlarged without loss of quality & does not get pixelated
- a smaller file size because it just contains the instructions to create the shape
while bitmap image store data about each pixel
- bitmap made of pixels while vector graphic stores a set of instruction bout how
to draw the shape
- Why compressed?
o Less bandwidth to transmit
o Reduce storage required – store more images
o Shorter download time
- Lossy compression
o Reduce bit depth: reduces number of bits per pixel which means each
pixel has fewer bits
, o Reduce image resolution: fewer pixels per unit measurement means less
binary to store
o Why lossy compression?
▪ Change not noticeable
▪ Quality decreases
▪ Larger decrease in file size
▪ Less bandwidth needed
Compressing sound – lossy
- Decrease sample rate – fewer samples stored per second
- Decrease sample resolution – fewer bits per sample
- Take out sound outside of human hearing range is removed – fewer
measurements are stored
Lossless compression
- Text file
o Run length encoding
o Identifies groups of repeated characters
o Stores a character and the number of times it occurs consecutively
o Suitable examples
o Why?
▪ All the data is required
▪ Otherwise, text file will be corrupted
- Bitmap image
o Run-length encoding
▪ Replace sequences of the same colour pixel
▪ With colour code and number of identical pixels
Lossy vs lossless compression
- Less storage space on server
- Faster to upload/ download
- Less bandwidth to transmit
- Less data allowance
CHAPTER 2
Bit streaming
- Continuous ordered flow of bits over a communication path