Professional Documents
Culture Documents
CSCE 101
How is Information Stored
• Information is stored in the computer as binary numbers
(0’s and 1’s). Even images are stored in this way, where a
combination of 0’s and 1’s represent each color in the
picture
• Each binary number is a switch where 0 is off and 1 is on
26 = 64 25 = 32 24 = 16 23 = 8 22 = 4 21 = 2 20 = 1
Binary (Base 2)
What is the number 1101 in the two based system?
First we put the number in the chart, aligning it to the right
26 25 24 23 22 21 20
64 32 16 8 4 2 1
1 1 0 1
26 25 24 23 22 21 20
64 32 16 8 4 2 1
1 1 0 1 1 0
Answer
110110 = 32 + 16 + 4 + 2 = 54
Practice
Convert the binary number to decimal
000111
26 25 24 23 22 21 20
64 32 16 8 4 2 1
0 0 0 0 1 1 1
Answer
000111 = 4 + 2 + 1 = 7
Practice
Convert the binary number to decimal
0100011
26 25 24 23 22 21 20
64 32 16 8 4 2 1
0 1 0 0 0 1 1
Answer
0100011 = 32 + 2 + 1= 35
Writing numbers in binary
• You follow the same process as when you write a
number in decimal format.
• First find the highest power of two that goes into the
number
• Subtract that amount from the number,
• Put a 1 in that spot
• and repeat
Example (37)
• Write 37 in binary
• First we see that the largest power of 2 that goes into
the number is 25 or 32 so we put a 1 in that spot
26 25 24 23 22 21 20
64 32 16 8 4 2 1
1
• 37 – 32 =5
• Now we need to add 5 to this number
Example (37)
• Now we need to add 5 to our number
• We see that the largest power of 2 that goes into the
number is 22 or 4 so we put a 1 in that spot
26 25 24 23 22 21 20
64 32 16 8 4 2 1
1 1
• 5 – 4 =1
• Now we need to add 1 to this number
Example (37)
• Now we need to add 1 to our number
• We see that the largest power of 2 that goes into the
number is 20 or 1 so we put a 1 in that spot
26 25 24 23 22 21 20
64 32 16 8 4 2 1
0 1 0 0 1 0 1
26 25 24 23 22 21 20
64 32 16 8 4 2 1
0 1 0 0 1 0 1
• We can add as many 0’s to the left of the numbers as we like and it
stays the same.
• So this number is the same as 000100101
Practice
26 25 24 23 22 21 20
64 32 16 8 4 2 1
1 2 3
A B C
0 0 0 B B 8
ASCII
• Stands for American Standard Code for Information
Interchange
• The way we represent English characters as numbers
(binary)
• Each letter is assigned a number form 0 to 1
A = 01000001
B = 01000010
C = 01000011
…
Text Compression
• Can take body of text and make it smaller
• Makes it more feasible for you to send these files
• Will find simplify repeated patterns so they take up less
space.