Upload
madhu-ekanayake
View
232
Download
0
Embed Size (px)
Citation preview
8/18/2019 02. Binary Number System
1/14
8/18/2019 02. Binary Number System
2/14
8/18/2019 02. Binary Number System
3/14
Software must convert instructions given
by the user into a form so that thehardware can understand.
The communication between hardwareand software is reduced to a simple
“YES” or “NO” / “ON” or “OFF”.
8/18/2019 02. Binary Number System
4/14
In the early days they attempted to store
a charge in a vacuum tube, which issimilar to a light bulb.
Each digit in our number system (0-9)was stored with increasing degrees ofcharge.
But this method was inefficient andsometimes inaccurate.
8/18/2019 02. Binary Number System
5/14
145610
1x6
10x5100x4
1000x1
1000 400 50 6++ +
145610
8/18/2019 02. Binary Number System
6/14
1 = 100
10 = 101
100 = 102
1000 = 103
10,000 = 104
….
…………..
…………………
8/18/2019 02. Binary Number System
7/14
Exercise
1. 125
2. 45
3. 6698
4. 4511
5. 25878
8/18/2019 02. Binary Number System
8/14
The binary number system works in the exactsame way as the decimal system, exceptthat it contains only 2 digits, 1 and 0.
In order to count further, we need to add asecond column worth twice the value of thecolumn before….
8/18/2019 02. Binary Number System
9/14
1 – 20 - 1x1 - 0001
2 – 21 - 1x0 + 2x1 - 0010
4 – 22 - 1x0 + 2x0 + 4x1 - 0100
8 – 23 - 1x0 + 2x0 + 4x0 + 8x1 - 1000
16 – 24 - 1x0 + 2x0 + 4x0 + 8x0 + 16x1 - 1 0000
32 – 25 - 1x0 + 2x0 + 4x0 + 8x0 + 16x0 + 32x1 - 10 0000
8/18/2019 02. Binary Number System
10/14
Decimal to Binary
1. 22. 8
3. 15
4. 49
5. 102
6. 256
Binary to Decimal1. 00101
2. 000111
3. 110001
4. 1101001
5. 0001001
6. 1101011
8/18/2019 02. Binary Number System
11/14
A 1 or 0 is called a bit or Binary Digit.
Grouping is often done in group of 8 bits.This is called a byte.
When text is stored, every letter orcharacter is first converted to a code using only zeros and ones.
The most common coding method fortext is ASCII (American Standard forInformation Interchange)
8/18/2019 02. Binary Number System
12/14
With 8 bits in a byte, we can represent
256 values ranging from 0 –
255.
Numeric - 10
Alphabetic - Upper – 26- Lower - 26
Punctuation - 15
Arithmetic - 7 Other - 12
96
8/18/2019 02. Binary Number System
13/14
Kilo - 210 - 1024 --> 103
Mega - 220 - 1, 048, 576 --> 106
Giga - 230 - 1, 073, 741, 824 --> 109
Tera –
2
40
Peta - 250
8/18/2019 02. Binary Number System
14/14
How many Megabytes?
1. 205 Kb
2. 30152 bytes
3. 4 GB
4. 6430 Kb
How many Gigabytes?1. 2434 MB
2. 248 TB
File has 1024 bytes. How many Kb are there?
File has 8192 bytes. How many Kb are there?
File has 205 Kb. How many MB are there?
File has 642 MB. How many GB are there?