Upload
sabina-hancock
View
214
Download
0
Embed Size (px)
Citation preview
Bits, Bytes, KiloBytes, MegaBytes, GigaBytes & TeraBytes.
Bit
0 or 1
Byte
Equivalent to 8 bits
KiloByte
2 10 Bytes (approx. a thousand) K - Thousand 103
MegaByte
2 20 Bytes (approx. a million) M - Million 106
GigaByte
2 30 Bytes (approx. a billion) G - Billion 109
TeraByte
2 40 Bytes (approx. a trillion) T - Trillion 1012
Decimal (compare to binary) 451 = 4*10 2 + 5*10 1 + 1*10 0
4037 = 4*10 3 + 0*10 2 + 3*10 1 + 7*10 0
52305 = 5*10 4 + 2*10 3 + 3*10 2 + 0*10 1 + 5*10 0
Binary 10011 = 1*24+ 0*23+0*22+1*21+1*20
= 16 + 0 + 0 + 2 + 1
= 19 (in base 10) 101101 = 1*25+ 0*24+ 1*23+1*22+0*21+1*20
= 32 + 0 + 8 + 4 + 0 + 1
= 45 (in base 10) 1101 = ?
One character is represented using one byte (8 bits)
ASCII
American Standard Code for Information Interchange
The ASCII character code for the letter A is 65 = 0100 0001
The ASCII character code for the letter B is66 = 0100 0010
etc.
ASCII (continued)
The ASCII character code for a space (pressing the space bar) is 32 = 0010 0000
The ASCII character code for the letter a is 97 = 0110 0001
The ASCII character code for the letter b is 98 = 0110 0010 etc.
Base 16
Base two - digits run from 0 to 1
Base ten - digits run from 0 to 9
Base sixteen - digits run from 0 to 15
The digits are:
0 1 2 3 4 5 6 7 8 9 A B C D E F
Hexadecimal to Decimal8 D = 8*16 1 + D*16 0
= 8*16 1 + 13*16 0 = 141
D 8 = D*16 1 + 8*16 0
= 13*16 1 + 8*16 0 = 216
3 E = 3*16 1 + E*16 0
= 3*16 1 + 14*16 0 = 62
Decimal to Hexadecimal
16 1 16 0
16 1
7 D
125 in base 16 is:
712516
Therefore, there is a remainder of 13 (or D).
16*7 = 112 and 125-112 = 13.
7D
Decimal to Hexadecimal
16 1 16 0
16 1
B F
191 in base 16 is:
1119116
Therefore, there is a remainder of 15 (or F).
16*11 = 176 and 191-176 = 15.
BF