Binary& Data Representation Note
Binary& Data Representation Note
Binary
Binary system
▪ Base 2 numeral system using only two digits 1 and 0 or on and
off ▪ Different place values, increase by power of 2
▪ A value 2 times higher than the one to the right
Denary system
▪ Base 10 numeral system using ten digits 0 to 9
▪ Different place values, increase by power of 10
▪ A value 10 times higher than the one to the right
1 0 1 0 1 0 1 0
1 0 1 1 0 1 1 1
Result 0 1 0 1 0 0 0 0
Result 0 0 0 0 0 1 0 1
36 0 0 1 0 0 1 0 0
72 0 1 0 0 1 0 0 0
Right Arithmetic shifts: Division
Calculate 72 / 22
72 0 1 0 0 1 0 0 0
18 0 0 0 1 0 0 1 0
2
Calculate 10001100 / 8
-116 1 0 0 0 1 1 0 0
15 1 1 1 1 0 0 0 1
Hexadecimal
Hexadecimal is useful because large numbers can be represented using fewer digits. For
example, colour values and MAC addresses are often represented in hexadecimal.
Hexadecimal is easier to understand than binary.
How can the following binary numbers be expressed in hexadecimal?
01101110 = 0110 1110 = (1X4) + (1X2) (1X8) + (1X4) + (1X2)= 6 E
Data Representation
Representation of Text
American Standard Code for Information Interchange (ASCII code)
▪ Originally, 7-bit ASCII Code (128 characters)
▪ ASCII was extended 8-bit code which allows 256 codes (No
standardization) Unicode
▪ Unicode has become the universal standard
▪ Unicode can represent the characters in all know languages
▪ Unicode characters 0 to 127 are the same as ASCII
3
Image File Size
Create expressions and calculate the file sizes of the following image. Express the sizes
in bits and bytes.
▪ A 256-colour image with a size of 640 x 480 pixels.
Resolution = 640 X 480 bits
Bit depth = 8 bits
File size = Resolution X bit depth = (640 × 480 X 8) bits =( (640 × 480 X 8)/8 ) bytes
Representation of Sound
Digital recording
▪ Digital recording takes a series of sound ‘snapshots’
▪ When these are played back rapidly, sound produced seems to be
continuous ▪ These ‘snapshots’ of the sound are called samples
▪ The process of taking them is called sampling
▪ The sampling of the continuous sound wave is carried out by an analogue-to-digital
recorder (ADR)
▪ ADR converts the sound into a stream of 1s and 0s
▪ A digital-to-analogue converter (DAC) is required to convert the binary data back
into an analogue wave
▪ The complete wave cannot be recorded
Fidelity
▪ Fidelity is the relationship between the original sound and the
recording. ▪ The fidelity of the recording is influenced by two factors
1. Sample rate
▪ Sample rate is the number of samples taken per second
2. Bit depth
▪ Using bit depths is 8 bits allows 256 (28) gradations to be measured ▪
Using more bits allows for much smaller gradation in the volume differences
4
Digital Audio File Sizes
What is the file size of a stereo recording of three minutes’ duration with a sample rate
of 44100 and a bit depth of 24 bits? Give your answer in bits and bytes. Sample rate =
44100
Bit depth = 24 bits
Duration of recording = 3 minutes = (3X60) s
Channels = 2
File size = Sample rate X bit depth X Duration in second X number of channels
= ( 44100 X 24 X 3 X 60 X 2 )bits
5