13.07.2015 Views

Lec 2. (Computer Science) Bit, Byte Bit means 0 or 1 i.e. on or off, it's ...

Lec 2. (Computer Science) Bit, Byte Bit means 0 or 1 i.e. on or off, it's ...

Lec 2. (Computer Science) Bit, Byte Bit means 0 or 1 i.e. on or off, it's ...

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<str<strong>on</strong>g>Lec</str<strong>on</strong>g> <str<strong>on</strong>g>2.</str<strong>on</strong>g>(<str<strong>on</strong>g>Computer</str<strong>on</strong>g> <str<strong>on</strong>g>Science</str<strong>on</strong>g>)<str<strong>on</strong>g>Bit</str<strong>on</strong>g>, <str<strong>on</strong>g>Byte</str<strong>on</strong>g><str<strong>on</strong>g>Bit</str<strong>on</strong>g> <str<strong>on</strong>g>means</str<strong>on</strong>g> 0 <str<strong>on</strong>g>or</str<strong>on</strong>g> 1 i.e. <strong>on</strong> <str<strong>on</strong>g>or</str<strong>on</strong>g> <strong>off</strong>, it’s the basic unit in processing the data becauseall the data are c<strong>on</strong>verted to bits in digital computers.<str<strong>on</strong>g>Byte</str<strong>on</strong>g> is the mem<str<strong>on</strong>g>or</str<strong>on</strong>g>y size in which <strong>on</strong>e symbol <str<strong>on</strong>g>or</str<strong>on</strong>g> number from 0 to 255 isst<str<strong>on</strong>g>or</str<strong>on</strong>g>ed, it c<strong>on</strong>sists of 8 bits.Kilobyte (KB) equals 1024 byte (2 10 ) f<str<strong>on</strong>g>or</str<strong>on</strong>g> example a mem<str<strong>on</strong>g>or</str<strong>on</strong>g>y with 64KBdoesn’t mean 64000byte it <str<strong>on</strong>g>means</str<strong>on</strong>g> 1024*64= 65536byte.Mega <str<strong>on</strong>g>Byte</str<strong>on</strong>g> (MB) equal 2 20 byte, Giga <str<strong>on</strong>g>Byte</str<strong>on</strong>g> (GB) equal 2 30 byte and Tera<str<strong>on</strong>g>Byte</str<strong>on</strong>g> (TB) equal 2 40 byte (kilo <str<strong>on</strong>g>means</str<strong>on</strong>g> thousand, mega <str<strong>on</strong>g>means</str<strong>on</strong>g> milli<strong>on</strong>, giga<str<strong>on</strong>g>means</str<strong>on</strong>g> billi<strong>on</strong> and tera <str<strong>on</strong>g>means</str<strong>on</strong>g> trilli<strong>on</strong>).Numbering systemThere are four numbering systems1. decimal (base=10)<str<strong>on</strong>g>2.</str<strong>on</strong>g> binary (base=2)3. octal (base=8)4. hexadecimal (base=16)Basics of numbering system1. Each numbering systems is named acc<str<strong>on</strong>g>or</str<strong>on</strong>g>ding to its base number (base= B)which is used in its calculati<strong>on</strong>s.<str<strong>on</strong>g>2.</str<strong>on</strong>g> The numbers of symbols in each system are {0, 1, 2, ……, B-1}.3. F<str<strong>on</strong>g>or</str<strong>on</strong>g> system with n ranks the biggest number is B n -1.4.Symbol in the further most right rank in any system is called Leastsignificant Digit-LSD, symbol in the further most left rank is called MostSignificant Digit-MSD.5. F<str<strong>on</strong>g>or</str<strong>on</strong>g> system with base B ,n= number of ranks f<str<strong>on</strong>g>or</str<strong>on</strong>g> integerAnd m= number of ranks f<str<strong>on</strong>g>or</str<strong>on</strong>g> fracti<strong>on</strong> part thenDecimal value = a n-1 a n-2 …… a 1 a 0 . a --1 a --2 …. a -mThis value is calculated usinga n-1 b n-1 +a n-2 b n-2 ... +a 1 b 1 + a 0 b 0 + a -1 b -1 + a -2 b -2 +…+ a -m b -m Eqn. (1)6.All systems use <strong>on</strong>e method to c<strong>on</strong>vert to decimal and vice versa the <strong>on</strong>lydeference is in base value.Decimal system:it is the same as the <strong>on</strong>e we use in our lives, Eachdecimal rank weight 10 times its right neighb<str<strong>on</strong>g>or</str<strong>on</strong>g> in this way the weights ofthe ranks from left to right is 1,10, 100, 1000 and so <strong>on</strong>.1


Base =10 The symbols used are{0,1, 2,3,4,5,6,7,8,9}E.x. value of 29029.98 is:2*10 4 +9*10 3 +0*10 2 +2*10 1 +9*10 0 +9*10 -1 +8*10 -2 Binary system<str<strong>on</strong>g>Computer</str<strong>on</strong>g> uses binary system its base is 2 and it c<strong>on</strong>tain <strong>on</strong>ly 0 <str<strong>on</strong>g>or</str<strong>on</strong>g> 1(<strong>on</strong> <str<strong>on</strong>g>or</str<strong>on</strong>g> <strong>off</strong>)In binary system each rank weight twice its right neighb<str<strong>on</strong>g>or</str<strong>on</strong>g> in this way rankweights from left to right is 1, 2, 4, 8, 16 and so <strong>on</strong>. Base =2 The symbols used are {0,1}C<strong>on</strong>verting from any system to decimal:-We can use equati<strong>on</strong> (1) to c<strong>on</strong>vert the number in any system to decimale.x. C<strong>on</strong>vert (110101.1101) 2 to decimalSol.Using equati<strong>on</strong> 1a n-1 b n-1 +a n-2 b n-2 ... +a 1 b 1 + a 0 b 0 + a -1 b -1 + a -2 b -2 +…+ a -m b -m Eqn. (1)110101.1101 = a 5 a 4 a 3 a 2 a 1 a 0 . a -1 a -2 a -3 a -4 , n=6 , m=4a 5 b 5 +a 4 b 4 + a 3 b 3 +a 2 b 2 +a 1 b 1 + a 0 b 0 + a -1 b -1 + a -2 b -2 + a -3 b -3 +a -4 b -4f<str<strong>on</strong>g>or</str<strong>on</strong>g> binary system base =2 then b=21*2 5 +1*2 4 + 0*2 3 +1*2 2 +0*2 1 + 1* 2 0 + 1*2 -1 + 1* 2 -2 + 0*2 -3 +1*2 -4=32+16+0+4+0+1+0.5+0.25+0+0.0625=53.8125E.x. c<strong>on</strong>vert (11001.101) 2 to decimalSoluti<strong>on</strong>:1*2 4 +1*2 3 +0*2 2 +0*2 1 +1*2 0 +1*2 -1 +0*2 -2 +1*2 -3 =16+8+0+0+1+1/2+0+1/8=(25.625) 10e.x.The value of (10101.01) 2 in decimal system is1*2 4 +0*2 3 +1*2 2 +0*2 1 +1*2 0 +0*2 -1 +1*2 -2 =21.252

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!