Difference between revisions of "CSC103: DT's Notes 1"
Line 603: | Line 603: | ||
|} | |} | ||
− | Do you recognize anything? Anything looking familiar? If not, let's use a ''code'', and change all the 1s for Ts and all the 0s for Fs: | + | Do you recognize anything? Anything looking familiar? If not, let's use a ''code'', and change all the 1s for Ts and all the 0s for Fs, and split the table in two: |
{| border="1" cellpadding="10" cellspacing="0" | {| border="1" cellpadding="10" cellspacing="0" | ||
Line 609: | Line 609: | ||
! b | ! b | ||
! C | ! C | ||
− | |||
|- | |- | ||
− | |||
| F | | F | ||
| F | | F | ||
Line 619: | Line 617: | ||
| T | | T | ||
| F | | F | ||
+ | |- | ||
| T | | T | ||
+ | | F | ||
+ | | F | ||
|- | |- | ||
| T | | T | ||
+ | | T | ||
+ | | T | ||
+ | |} | ||
+ | |||
+ | and | ||
+ | |||
+ | {| border="1" cellpadding="10" cellspacing="0" | ||
+ | ! a | ||
+ | ! b | ||
+ | ! S | ||
+ | |- | ||
| F | | F | ||
| F | | F | ||
+ | | F | ||
+ | |- | ||
+ | | F | ||
+ | | T | ||
| T | | T | ||
|- | |- | ||
| T | | T | ||
+ | | F | ||
+ | | T | ||
+ | |- | ||
| T | | T | ||
| T | | T | ||
| F | | F | ||
|} | |} | ||
+ | |||
+ | Now, if we observer the first table, we should recognize the table for the '''and''' operator! So it is true: arithmetic on bits can actually be done as a logic operation. But is it true of the '''C''' bit? We do not recognize the truth table of a known operator. But remember the ice cream example; we probably come up with a logic expression that matches this table. An easy way to come up with this expression is to express it in English first and then translate it into a logic expression: | ||
+ | |||
+ | ::'''S''' is true in two cases: when '''a''' is true and '''b''' is false, or when '''a''' is false and '''b''' is true. | ||
+ | |||
+ | or | ||
+ | |||
+ | ::'''S''' = ( '''a''' ''and'' ''not'' '''b''' ) ''or'' ( ''not'' '''a''' ''and'' '''b''' ) | ||
+ | |||
+ | As an exercise you can generate the truth table for all the terms in this expression and see if their combinational expression here is the same as '''S'''. | ||
+ | |||
+ | So, here we are with our premises about our current computers and why they work. We have answered important questions and made significant discoveries, which we summarize below | ||
+ | |||
+ | ====Discoveries==== | ||
+ | * Computers use electricity as a source of power, and use flows of electrons (electric currents) to convey information. | ||
+ | * Switches are used to control the flow of electrons, creating a system of two values based on whether the flow is ON or OFF. | ||
+ | * While the binary system uses only two digits it is just as powerful as the system of decimal numbers, allowing one to count, add, and do arithmetic operations with binary numbers. | ||
+ | * The boolean algebra is a system which also sports two values, true and false, and logical operators and well defined properties. | ||
+ | * logic operator are easy to generate with electronic switches | ||
+ | * arithmetic operations in binary can be expressed using the operators of the boolean algebra. | ||
=References= | =References= | ||
<references /> | <references /> |
Revision as of 20:41, 31 January 2012
--© D. Thiebaut 08:10, 30 January 2012 (EST)