Difference between revisions of "CSC103: DT's Notes 1"
Line 293: | Line 293: | ||
0 | 0 | ||
− | 1 | + | 1 |
+ | |||
Here we start with the leftmost column, start at 1 in the table and go down by 0. The result is 1. We don't move in the table: | Here we start with the leftmost column, start at 1 in the table and go down by 0. The result is 1. We don't move in the table: | ||
Line 300: | Line 301: | ||
+ 0010110 | + 0010110 | ||
------------ | ------------ | ||
− | + | 1 | |
Done with the rightmost column. We move to the next column and add 1 to 1 (don't think too fast and assume it's 2! 2 does not exist in our table of digits!) | Done with the rightmost column. We move to the next column and add 1 to 1 (don't think too fast and assume it's 2! 2 does not exist in our table of digits!) | ||
Line 309: | Line 310: | ||
<font color="red">1</font> <font color="magenta">0</font> +1 | <font color="red">1</font> <font color="magenta">0</font> +1 | ||
− | We had to roll-over in the table. Therefore we take a 1 and add it to the column on the left. | + | We had to roll-over in the table. Therefore we take a ''carry'' of 1 and add it to the column on the left. |
<font color="red">1</font> | <font color="red">1</font> | ||
Line 315: | Line 316: | ||
+ 0010110 | + 0010110 | ||
------------ | ------------ | ||
− | <font color="magenta">0</font>0 | + | <font color="magenta">0</font>1 |
+ | |||
+ | Continuing this we finally get | ||
+ | |||
+ | |||
+ | 1 | ||
+ | 1010011 | ||
+ | + 0010110 | ||
+ | ------------ | ||
+ | 1101001 | ||
+ | |||
+ | |||
+ | Let's verify that this is the correct answer. 1010011, in decimal is 64 + 16 + 2 + 1 = 83. 10110 is 16 + 4 + 2 = 22. 83 + 22 is 105. There 1101001 must represent 105. Double check: 1101001 is 64 + 32 + 8+ 1 which, indeed is 105. | ||
+ | |||
+ | So, in summary, it doesn't matter if we are limited to having only two digits, we can still count, represent numbers, and do arithmetic. | ||
+ | |||
+ | ====Summary of Where we Are==== | ||
+ | |||
+ | Let's summarize what we now and what we're after. We know that electricity is cheap, easy to control, a great source of power, and that we can easily build switches that can control voltages over wire. We know that we can create a code associating 1 to electricity being ON and 0 to electricity being OFF in a wire. So electricity can be used to represent the numbers 0 and 1. | ||
+ | |||
+ | Furthermore, we know that a system where we only have two digits is called the binary system, and that this system is mathematically complete, allowing us to do everything we can do in decimal (we have concentrated in the previous discussion to just counting and adding, but we can do everything else the same). | ||
+ | |||
+ | So the question now for engineers around the mid 20th century is how to build electronic circuits that would perform arithmetic. | ||
+ | |||
+ | The answer to this problem is provided by two giants of computer science, '''George Boole''', and '''Claude Shannon''' who worked at very different times, but provided two complementary parts of the solution. Boole defined the ''Boolean algebra'', a logic system that borrowed from philosophy and from mathematics, where assertions (mathematicians say ''variables'') can only be ''true''' or '''false''', and where assertions can be combined by any combination of three conjunctions (which mathematicians call ''operators''): '''and''', '''or''' and '''not'''. | ||
− | |||
====Boole and the Boolean Algebra==== | ====Boole and the Boolean Algebra==== |
Revision as of 18:00, 31 January 2012
--© D. Thiebaut 08:10, 30 January 2012 (EST)