0% found this document useful (0 votes)
30 views

Binary& Data Representation Note

Uploaded by

teacheryinyinedu
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views

Binary& Data Representation Note

Uploaded by

teacheryinyinedu
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Unit 3

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

Converting Binary and Denary Numbers


What are the denary equivalents of the following binary numbers?
▪ 00111001 = (1 X 32) + (1 X 16) + (1 X 8) + (1 X 1) = 57

What are the equivalents of the following denary numbers?


▪ 69 = 01000101

Adding Binary Numbers


00001101 + 10101010
0 0 0 0 1 1 0 1

1 0 1 0 1 0 1 0

1 0 1 1 0 1 1 1

Signed binary numbers


Showing your working, carry out the binary addition of 90 + (-33).
1
Binary Shift
Multiplication and Division
▪ Logical shift (Unsigned number)
▪ Left Shift => Multiplication
▪ Right Shift => Division
▪Arithmetic Shift (Signed number)
▪ Left Shift => Multiplication
▪ Right Shift => Division

Left Logical Shifts: Multiplication


For Binary Left shift example:
▪ 00010100 (20) * 22 (two shifts to the left)
128 64 32 16 8 4 2 1
0 0 0 1 0 1 0 0

Result 0 1 0 1 0 0 0 0

Right Logical Shifts: Division


▪ 00010100 / 22
128 64 32 16 8 4 2 1
0 0 0 1 0 1 0 0

Result 0 0 0 0 0 1 0 1

Left Arithmetic shifts: Multiplication


36 * 2 = 72
128 64 32 16 8 4 2 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

How can the following hexadecimal numbers be expressed in binary?


A6 = A 6= 10 6 = 1010 0110

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

Representation of Bitmap Images


Pixel: The basic unit of a bitmap image is the pixel
Resolution: the number of pixels per inch when the image is displayed Colour
depth/ bit depth : Colour depth refers to the number of bits per pixel on a
computer monitor to represent a specific color
▪ If bit depth is 1 bit, the number of colours is 21 or 2 colours
▪ If bit depth is 3 bit, the number of colours is 23 or 8 colours
▪ If 8 bit is used, the number of colours is 28 or 256 colours
▪ Current standard represents the colour (true colour) of each pixel in 24 bits

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

But, digital recording does have other benefits such as:


▪ Equipment to record and process digital sound is relatively cheap and has allowed
people to record music at home
▪ It is easily edited using computer equipment
▪ It is easily copied
▪ Unlike vinyl and tape, digital files do not physically deteriorate with
use ▪ Although they may corrupted if the storage medium is damaged
▪ Digital files are more portable than record and tapes
▪ Can be copied to any digital medium: hard drive, emailed, downloaded

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

You might also like