The Binary System Flashcards
Binary Arithmetic
- Bits - a binary digit
- Byte - 8 bits
- Kilobyte - 1024 bytes (2^10 bytes)
- Megabyte - 1024 x 1024 bytes
- Gigabyte - 1024 x 1024 x 1024 bytes
- Terabyte - 1024 x 1024 x 1024 x 1024 bytes
Reasons for using binary
- Easy to represent ‘ON’ and ‘OFF’ as 0 Volts and a higher voltage (often above 1V — nominally 5V)
- Fewer rules needed with binary (0, 1) arithmetic than with decimal (0..9) arithmetic
- Any loss of voltage due to resistance etc. does not change value
- Easy to represent 0, 1 with other devices e.g. pits and lands on a CD-ROM or directions of magnetic field on a hard disc
How do you convert between binary & decimal?
Add the place values e.g. 10111001 = 1 + 8 + 16 + 32 + 128 = 185 in decimal
How do you convert between decimal & binary?
Divide repeatedly by 2
In stored numbers what is 2’s complement?
To find the 2’s complement of a number change all 0’s to 1’s and 1’s to 0’s. Then add 1.
Only one zero and all the ordinary rules of arithmetic work.
The most significant bit will be a 1 if the number is negative.
Discuss Floating Point Numbers?
Floating Point Numbers are stored using mantissa and exponent.
E.g. 1011.11 is equal to .101111 x 2 100 (since 100 in binary is 4 in decimal and the point has been moved 4 places)
This is stored as 101111 in the mantissa, 100 as the
exponent.
Because of the number of bits being used to store the number is limited. The mantissa cannot be exactly accurate.
Increasing the number of bits used to store the mantissa can increase precision (accuracy); increasing the number of bits used to store the exponent increases the range of numbers that can be stored.
Ways of storing Text
- Character - a symbol or letter on the keyboard. A list of all the characters a computer can process is called the character set.
- ASCII - American Standard Code for lnformation Interchange is an agreed 7-bit code, which gives 128 characters. Text data is stored using an 8-bit code; the 8th bit either being used for parity checking or to extend the number of characters.
- UNICODE - a 16 bit agreed code covering characters from more languages. The lowest numbers are the same codes as ASCII.
Ways of storing Graphics
- Graphics are made up of dots and on screen displayed using pixels (picture elements). For black and white, each pixel can be set ON with the value 1 or OFF with the value 0. For colour, more bits are needed for each pixel. E.g. a colour bit depth of 8 bits allows 2^8 (256) different colours.
- Bitmapped images store the screen display as a set of values of each pixel colour for the whole document. This can use a large amount of memory.
- File size = height x breadth x colour depth.
- Compression is used to reduce the file size of bitmapped images. Photographs are typical bit mapped images.
Vector graphics just store the attributes of each object e.g. for a circle, object number, type of object, X and Y coordinates of centre, radius, line thickness,
line colour, fill colour, line pattern, fill pattern. Vector graphics use less memory and are resolution independent, as the resolution of the screen does
not affect the stored details.