Your browser doesn't support the features required by impress.js, so you are presented with a simplified version of this presentation.
For the best experience please use the latest Chrome, Safari or Firefox browser.
CIS 115
Lecture 8: Encoding Data
George Boole
Image Source: Wikipedia
Gottfried Willhelm von Leibniz
Image Source: Wikipedia
Charles Babbage
Image Source: Wikipedia
Claude Shannon
Image Source: Wikipedia
George Stibitz
Image Source: Wikipedia
Complex Numerical Calculator
Image Source: Computer History Museum
Binary - Natural Numbers
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 |
0*128 | 0*64 | 1*32 | 0*16 | 1*8 | 0*4 | 1*2 | 0*1 |
32 + 8 + 2 = 42
Binary Data Types
Negative Numbers
0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 42 |
Negative Numbers
0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 42 |
1 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | -42 |
One's Compliment Addition
0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 42 |
+
1 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | -42 |
=
One's Compliment Addition
0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 42 |
+
1 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | -42 |
=
1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | -0 |
Hmm, that's not quite right...
Negative Numbers
0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 42 |
invert
1 | 1 | 0 | 1 | 0 | 1 | 0 | 1 |
Negative Numbers
0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 42 |
invert
1 | 1 | 0 | 1 | 0 | 1 | 0 | 1 |
plus 1
1 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | -42 |
Two's Compliment Addition
0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 42 |
+
1 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | -42 |
=
Two's Compliment Addition
0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 42 |
+
1 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | -42 |
=
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
That works!
Other Values
Binary | Unsigned | Signed |
00000000 | 0 | 0 |
00000001 | 1 | 1 |
00000010 | 2 | 2 |
01111110 | 126 | 126 |
01111111 | 127 | 127 |
10000000 | 128 | -128 |
10000001 | 129 | -127 |
10000010 | 130 | -126 |
11111110 | 254 | -2 |
11111111 | 255 | -1 |
Integer Overflow
Image Source: Randall Munroe (XKCD)
Range of Values
Rational Numbers
The decimal point can "float" around
Floating Point
- | Exponent | Mantissa | |||||||||||||
0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 |
Floating Point Example
- | Exponent | Mantissa | |||||||||||||
0 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 |
Mantissa: (1).01010 = 1.3125
Exponent: 10100 - 01111 = 20 - 15 = 5
Floating Point Example
- | Exponent | Mantissa | |||||||||||||
0 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 |
Mantissa: (1).01010 = 1.3125
Exponent: 10100 - 01111 = 20 - 15 = 5
Value: 1.3125 * 25 = 42
1.01010 * 25 = 101010 = 42
Range of Values
Not exact, but not bad either
Real World
Text - ASCII
Image Source: ASCIItable.com
Text - ASCII
011001100110111101110010011101000111
100100100000011101000111011101101111
Text - ASCII
011001100110111101110010011101000111
100100100000011101000111011101101111
Text - ASCII
011001100110111101110010011101000111
100100100000011101000111011101101111
Images
Image Source: Wikipedia
RGB Colors
Image Source: Wikipedia
Compression
How much wood could
a woodchuck chuck if a
woodchuck could chuck wood?
Compression
How much wood could
a woodchuck chuck if a
woodchuck could chuck wood?
wood = 1 could = 2 chuck = 3
Compression
How much wood could
a woodchuck chuck if a
woodchuck could chuck wood?
wood = 1 could = 2 chuck = 3
How much 1 2 a 13 3 if a 13 2 3 1?
Image Compression
Image Source: D. Kriesel
Assignments
Blog 4: Computer Systems in Daily Life
We interact with a variety of computer systems on a daily basis, but most of the time we don’t take the time to think about where they came from and how they work. Choose a computer system you see in your everyday life and write about it and its history. Tell us how it works and how it affects us in our daily life. A simple example would be the keycard entry systems at the K-State dorms and the engineering labs. Some questions to ask yourself while you are doing your research:
Binary Worksheet