Thursday, 29 October 2015

Laws of Boolean Algebra

The Laws of Boolean

As well as the logic symbols “0” and “1” being used to represent a digital input or output, we can also use them as constants for a permanently “Open” or “Closed” circuit or contact respectively. A set of rules or Laws of Boolean Algebra expressions have been invented to help reduce the number of logic gates needed to perform a particular logic operation resulting in a list of functions or theorems known commonly as the Laws of Boolean Algebra.
Boolean Algebra is the mathematics we use to analyse digital gates and circuits. We can use these “Laws of Boolean” to both reduce and simplify a complex Boolean expression in an attempt to reduce the number of logic gates required. Boolean Algebra is therefore a system of mathematics based on logic that has its own set of rules or laws which are used to define and reduce Boolean expressions.
The variables used in Boolean Algebra only have one of two possible values, a logic “0” and a logic “1” but an expression can have an infinite number of variables all labelled individually to represent inputs to the expression, For example, variables A, B, C etc, giving us a logical expression of A + B = C, but each variable can ONLY be a 0 or a 1.
Examples of these individual laws of Boolean, rules and theorems for Boolean Algebra are given in the following table.

Truth Tables for the Laws of Boolean

Boolean
Expression
Description Equivalent
Switching Circuit
Boolean Algebra
Law or Rule
A + 1 = 1 A in parallel with
closed = "CLOSED"
universal parallel circuit Annulment
A + 0 = A A in parallel with
open = "A"
universal parallel Identity
A . 1 = A A in series with
closed = "A"
universal series circuit Identity
A . 0 = 0 A in series with
open = "OPEN"
universal series Annulment
A + A = A A in parallel with
A = "A"
idempotent parallel circuit Idempotent
A . A = A A in series with
A = "A"
idempotent series circuit Idempotent
NOT A = A NOT NOT A
(double negative) = "A"
  Double Negation
A + A = 1 A in parallel with
NOT A = "CLOSED"
complement parallel circuit Complement
A . A = 0 A in series with
NOT A = "OPEN"
complement series circuit Complement
A+B = B+A A in parallel with B =
B in parallel with A
absorption parallel circuit Commutative
A.B = B.A A in series with B =
B in series with A
absorption series circuit Commutative
A+B = A.B invert and replace OR with AND   de Morgan’s Theorem
A.B = A+B invert and replace AND with OR   de Morgan’s Theorem
The basic Laws of Boolean Algebra that relate to the Commutative Law allowing a change in position for addition and multiplication, the Associative Law allowing the removal of brackets for addition and multiplication, as well as the Distributive Law allowing the factoring of an expression, are the same as in ordinary algebra.
Each of the Boolean Laws above are given with just a single or two variables, but the number of variables defined by a single law is not limited to this as there can be an infinite number of variables as inputs too the expression. These Boolean laws detailed above can be used to prove any given Boolean expression as well as for simplifying complicated digital circuits.
A brief description of the various Laws of Boolean are given below with A representing a variable input.

Description of the Laws of Boolean Algebra

  • Annulment Law – A term AND´ed with a “0” equals 0 or OR´ed with a “1” will equal 1.
  •  
    • A . 0 = 0    A variable AND’ed with 0 is always equal to 0.
    • A + 1 = 1    A variable OR’ed with 1 is always equal to 1.
  •  
  • Identity Law – A term OR´ed with a “0” or AND´ed with a “1” will always equal that term.
  •  
    • A + 0 = A   A variable OR’ed with 0 is always equal to the variable.
    • A . 1 = A    A variable AND’ed with 1 is always equal to the variable.
  •  
  • Idempotent Law – An input that is AND´ed or OR´ed with itself is equal to that input.
  •  
    • A + A = A    A variable OR’ed with itself is always equal to the variable.
    • A . A = A    A variable AND’ed with itself is always equal to the variable.
  •  
  • Complement Law – A term AND´ed with its complement equals “0” and a term OR´ed with its complement equals “1”.
  •  
    • A . A = 0    A variable AND’ed with its complement is always equal to 0.
    • A + A = 1    A variable OR’ed with its complement is always equal to 1.
  •  
  • Commutative Law – The order of application of two separate terms is not important.
  •  
    • A . B = B . A    The order in which two variables are AND’ed makes no difference.
    • A + B = B + A    The order in which two variables are OR’ed makes no difference.
  •  
  • Double Negation Law – A term that is inverted twice is equal to the original term.
  •  
    • A = A     A double complement of a variable is always equal to the variable.
  •  
  • de Morgan´s Theorem – There are two “de Morgan´s” rules or theorems,
  •  
  • (1) Two separate terms NOR´ed together is the same as the two terms inverted (Complement) and AND´ed for example, A+B = A. B.
  •  
  • (2) Two separate terms NAND´ed together is the same as the two terms inverted (Complement) and OR´ed for example, A.B = A +B.
 
Other algebraic Laws of Boolean not detailed above include:
  • Distributive Law – This law permits the multiplying or factoring out of an expression.
  •  
    • A(B + C) = A.B + A.C    (OR Distributive Law)
    • A + (B.C) = (A + B).(A + C)    (AND Distributive Law)
  •  
  • Absorptive Law – This law enables a reduction in a complicated expression to a simpler one by absorbing like terms.
  •  
    • A + (A.B) = A    (OR Absorption Law)
    • A(A + B) = A    (AND Absorption Law)
  •  
  • Associative Law – This law allows the removal of brackets from an expression and regrouping of the variables.
  •  
    • A + (B + C) = (A + B) + C = A + B + C    (OR Associate Law)
    • A(B.C) = (A.B)C = A . B . C    (AND Associate Law)

Boolean Algebra Functions

Using the information above, simple 2-input AND, OR and NOT Gates can be represented by 16 possible functions as shown in the following table.
Function Description Expression
1. NULL 0
2. IDENTITY 1
3. Input A A
4. Input B B
5. NOT A A
6. NOT B B
7. A AND B (AND) A . B
8. A AND NOT B A . B
9. NOT A AND B A . B
10. NOT A AND NOT B (NAND) A . B
11. A OR B (OR) A + B
12. A OR NOT B A + B
13. NOT A OR B A + B
14. NOT OR (NOR) A + B
15. Exclusive-OR A.B + A.B
16. Exclusive-NOR A.B + A.B

Laws of Boolean Algebra Example No1

Using the above laws, simplify the following expression:  (A + B)(A + C)
Q = (A + B).(A + C)  
  A.A + A.C + A.B + B.C – Distributive law
  A + A.C + A.B + B.C – Idempotent AND law (A.A = A)
  A(1 + C) + A.B + B.C – Distributive law
  A.1 + A.B + B.C – Identity OR law (1 + C = 1)
  A(1 + B) + B.C – Distributive law
  A.1 + B.C – Identity OR law (1 + B = 1)
Q = A + (B.C) – Identity AND law (A.1 = A)
 
Then the expression:  (A + B)(A + C) can be simplified to A + (B.C) as in the Distributive law.

Logic Gate Truth Tables

Logic Gate Truth Tables

As well as a standard Boolean Expression, the input and output information of any Logic Gate or circuit can be plotted into a standard table to give a visual representation of the switching function of the system. The table used to represent the boolean expression of a logic gate function is commonly called a Truth Table. A logic gate truth table shows each possible input combination to the gate or circuit with the resultant output depending upon the combination of these input(s).
For example, consider a single 2-input logic circuit with input variables labelled as A and B. There are “four” possible input combinations or 22 of “OFF” and “ON” for the two inputs. However, when dealing with Boolean expressions and especially logic gate truth tables, we do not general use “ON” or “OFF” but instead give them bit values which represent a logic level “1” or a logic level “0” respectively.
Then the four possible combinations of A and B for a 2-input logic gate is given as:
  • Input Combination 1. – “OFF” – “OFF” or ( 0, 0 )
  • Input Combination 2. – “OFF” – “ON” or ( 0, 1 )
  • Input Combination 3. – “ON” – “OFF” or ( 1, 0 )
  • Input Combination 4. – “ON” – “ON” or ( 1, 1 )
Therefore, a 3-input logic circuit would have 8 possible input combinations or 23 and a 4-input logic circuit would have 16 or 24, and so on as the number of inputs increases. Then a logic circuit with “n” number of inputs would have 2n possible input combinations of both “OFF” and “ON”.
So in order to keep things simple to understand, in this tutorial we will only deal with standard 2-input type logic gates, but the principals are still the same for gates with more than two inputs.
Then the Truth tables for a 2-input AND Gate, a 2-input OR Gate and a single input NOT Gate are given as:

2-input AND Gate

For a 2-input AND gate, the output Q is true if BOTH input AAND” input B are both true, giving the Boolean Expression of: ( Q = A and B ).
Symbol Truth Table
boolean algebra AND gate truth table A B Q
0 0 0
0 1 0
1 0 0
1 1 1
Boolean Expression Q = A.B Read as A AND B gives Q
Note that the Boolean Expression for a two input AND gate can be written as: A.B or just simply AB without the decimal point.

2-input OR (Inclusive OR) Gate

For a 2-input OR gate, the output Q is true if EITHER input AOR” input B is true, giving the Boolean Expression of: ( Q = A or B ).
Symbol Truth Table
boolean algebra OR gate truth table A B Q
0 0 0
0 1 1
1 0 1
1 1 1
Boolean Expression Q = A+B Read as A OR B gives Q

NOT Gate

For a single input NOT gate, the output Q is ONLY true when the input is “NOT” true, the output is the inverse or complement of the input giving the Boolean Expression of: ( Q = NOT A ).
Symbol Truth Table
boolean algebra NOT gate truth table A Q
0 1
1 0
Boolean Expression Q = NOT A or A Read as inversion of A gives Q
The NAND and the NOR Gates are a combination of the AND and OR Gates with that of a NOT Gate or inverter.

2-input NAND (Not AND) Gate

For a 2-input NAND gate, the output Q is true if BOTH input A and input B are NOT true, giving the Boolean Expression of: ( Q = not(A and B) ).
Symbol Truth Table
NAND gate truth table A B Q
0 0 1
0 1 1
1 0 1
1 1 0
Boolean Expression Q = A .B Read as A AND B gives NOT-Q

2-input NOR (Not OR) Gate

For a 2-input NOR gate, the output Q is true if BOTH input A and input B are NOT true, giving the Boolean Expression of: ( Q = not(A or B) ).
Symbol Truth Table
NOR gate truth table A B Q
0 0 1
0 1 0
1 0 0
1 1 0
Boolean Expression Q = A+B Read as A OR B gives NOT-Q
As well as the standard logic gates there are also two special types of logic gate function called an Exclusive-OR Gate and an Exclusive-NOR Gate. The actions of both of these types of gates can be made using the above standard gates however, as they are widely used functions, they are now available in standard IC form and have been included here as reference.

2-input EX-OR (Exclusive OR) Gate

For a 2-input Ex-OR gate, the output Q is true if EITHER input A or if input B is true, but NOT both giving the Boolean Expression of: ( Q = (A and NOT B) or (NOT A and B) ).
Symbol Truth Table
Ex-OR gate truth table A B Q
0 0 0
0 1 1
1 0 1
1 1 0
Boolean Expression Q = A     B  

2-input EX-NOR (Exclusive NOR) Gate

For a 2-input Ex-NOR gate, the output Q is true if BOTH input A and input B are the same, either true or false, giving the Boolean Expression of: ( Q = (A and B) or (NOT A and NOT B) ).
Symbol Truth Table
Ex-NOR gate truth table A B Q
0 0 1
0 1 0
1 0 0
1 1 1
Boolean Expression Q =     B  

Summary of 2-input Logic Gates

The following Truth Table compares the logical functions of the 2-input logic gates above.
Inputs Truth Table Outputs For Each Gate
A B AND NAND OR NOR EX-OR EX-NOR
0 0 0 1 0 1 0 1
0 1 0 1 1 0 1 0
1 0 0 1 1 0 1 0
1 1 1 0 1 0 0 1
The following table gives a list of the common logic functions and their equivalent Boolean notation.
Logic Function Boolean Notation
AND A.B
OR A+B
NOT A
NAND A .B
NOR A+B
EX-OR (A.B) + (A.B) or A     B
EX-NOR (A.B) +  or     B
2-input logic gate truth tables are given here as examples of the operation of each logic function, but there are many more logic gates with 3, 4 even 8 individual inputs. The multiple input gates are no different to the simple 2-input gates above, So a 4-input AND gate would still require ALL 4-inputs to be present to produce the required output at Q and its larger truth table would reflect that.

NO Impossibility

No impossibility with God.

Tuesday, 27 October 2015

2015 National ICT Olympiad Competion

RULES
The areas of concentration of the competition are as follows :
- Computer Hardware

- Computer software/ application knowledge

- Basic computer programming

- Website development and design
1st Stage
1.) Qualification will be based on ranking i.e best 100 students from the 1st stage will proceed to the second stage.

2.) Students should endeavour to register with valid information (e.g name, phone number, email address).

3.) Registered students will write their online aptitude test using the log in details and exam page link that will be sent to their phones and email address.

4.) Parents and guardians are advised to let the students sit for the tests by themselves.

5.) Participating students can sit for their online aptitude test using their PC and other internet enabled device

6.) In the case that there are no clear best 100 students from the first sitting, another test will be scheduled that only the students with the best results will participate

7.) A school may enter as many participants as they please but schools are endeavoured to register their best students for better representation

8.) There is no charge, entry and participation is free

9.) Participants must be students of a secondary school in Lagos state

10.) Results from the online test will be published on the competition website on the next working day after the test is taken. Students will also receive mails and short messages on their phone stating their results.

11.) Answers are designed to be objective (often multiple choices or a number) rather than subjective (for Example, an essay). Questions will contain computer knowledge and logic

Requirements: Participants will be required to take an online aptitude test of 60 questions in 45 minutes. Each participant must have access to a computer or internet enabled device. The competition is opened to students from jss1 to ss3 N.B: all the activities of the Olympiad except the 1st stage will be televised on national television
2nd stage
1.) The best 100 students from the 1st stage are the only students eligible for this stage

2.) The student will proceed on a weeklong training at NIIT to prepare them for the 2nd stage test.

3.) Students are encouraged to be well behaved, attentive and punctual during the training.

4.) Training will involve both theory and practical.

5.) The best 5 students from this stage will proceed to the next stage.

6.) The examination at this stage will be done in the presence of invigilators from the ministry of education, participating schools and the Nigeria computer society.
State Finals
The rules for this stage will be posted before the finals.

Tuesday, 20 October 2015

THE TEN COMMANDMENT OF COMPUTER ETHICS



THE TEN COMMANDMENTS OF COMPUTER ETHICS
The Ten Commandments of Computer Ethics were created in 1992 by the Computer Ethics Institute (CEI) as a means to create “a set of standards to guide and instruct people in the ethical use of computers”.
The ten commandments of computer ethics copied the style of the Ten Commandments from the Bible and used the archaic “thou shalt” and “thou shalt not” found in the King James Version.
The Ten Commandments:
1.    Thou shalt not use a computer in ways that may harm people.
             Explanation:   This commandment says that it is unethical to use a computer to harm another user like: corrupting other user’s file or data, stealing someone’s personal information, writing program, which on execution could lead to stealing, copying or gaining unauthorized access to other user’s data.
2.    Thou shalt not interfere with other people’s computer work.
            Explanation:   Computer software can be used in ways that disturb other users or disrupt their work. Viruses, for example, are program meant to harm useful computer program or interfere with the normal functioning of a computer. Therefore, it is unethical to design or use such program.
3.    Thou shalt not snoop around in other people’s computer files.
            Explanation:   Obtaining data from another person’s private files is nothing less than breaking into someone’s room. Therefore, snooping around in another person’s files or reading someone else's personal messages is the invasion of his or her privacy.
4.    Thou shalt not use a computer to steal.
               Explanation:   With the use of technology, stealing of information is much easier. Stealing sensitive information or leaking confidential information is as bad as robbery.
5.    Thou shalt not use a computer to bear false witness.
                     Explanation:   False news or rumours can be spread speedily through social networking sites (like Facebook, yahoo, twitter, etc.) or emails. Being involved in the circulation of incorrect information is unethical.
6.    Thou shalt not copy or use proprietary software for which you have not paid.
            Explanation:   Refrain from copying software or buying pirated copies. Pay for software unless it is free. Like any other artistic or literary work, software is copyrighted. Therefore, obtaining illegal copies of copyrighted software is unethical.
7.  Thou shalt not use other people’s computer resources without authorization or proper compensation.
             Explanation:   Multi-user systems have user specific passwords. Breaking into some other user’s password, thus intruding his or her private space is unethical.
8.    Thou shalt not appropriate other people’s intellectual output.
             Explanation:   It is wrong to claim ownership on a work which is the output of someone else’s intellect. Programs developed by a software developer are his or her property. If he or she is working with an organization, they are the organization’s property. Copying them and propagating them in one’s own name is unethical.
9.    Thou shalt think about the social consequences of the program you are writing or the system you are designing.
             Explanation:    Looking at the social consequences that a program can have, describes a broader perspective of looking at technology. A computer software on release, reaches millions of people. Software like video games and animations or educational software can have a social impact on their users. Therefore, when working on animation films or designing video games, it is the programmer’s responsibility to understand his or her target audience or users and the effect it may have on them.
10.  Thou shalt always use a computer in ways that ensure consideration and respect for your fellow humans.
          Explanation:     The communication etiquette we follow in the real world applies to communication over computers as well. While over the internet, one should treat others with respect. Therefore, the use of abusive languages, make false statements or pass irresponsible remarks about others should not be stopped.

Who is this Jesus?