Httpscourseweb - Sliit.lkpluginfile - Php376739mod Resourcecontent11 LogicControl PDF
Httpscourseweb - Sliit.lkpluginfile - Php376739mod Resourcecontent11 LogicControl PDF
Faculty of Computing
Logic Control
Ms.Nilushi Dias
Year 01 Semester 01
Year 01 Semester 01 1 / 56
Outline
1 Number Systems
2 Boolean Algebra
3 Computer Arithmetic
4 Logic Gates
Year 01 Semester 01 2 / 56
Number Systems
Year 01 Semester 01 3 / 56
Number Systems
Year 01 Semester 01 4 / 56
Positional Number System
Year 01 Semester 01 5 / 56
Positional Number System (cont’d)
Year 01 Semester 01 6 / 56
Positional Number System (cont’d)
Example (724110):-
Year 01 Semester 01 7 / 56
Binary Number System
Year 01 Semester 01 8 / 56
Number Base Conversion
Decimal $ Binary
Decimal $ Octal
Decimal $ Hexadecimal
Binary $ Octal
Year 01 Semester 01 9 / 56
Repeated Division Method
Year 01 Semester 01 10 / 56
Repeated Division Method (Example)
Year 01 Semester 01 11 / 56
Repeated Subtraction Method
Year 01 Semester 01 12 / 56
Repeated Subtraction Method
4 For the rest of the place values, try to subtract each one from the
previous result.
If you can, place a “1” under that place value.
If you can’t, place a “0” under that place value.
5 Repeat Step 4 until all of the place values have been processed.
Year 01 Semester 01 13 / 56
Other Base Conversions
Binary/Octal/Hexadecimal to Decimal
1 Take the left most none zero bit,
2 Multiply by the base and add it to the bit on its right.
3 Now take this result, multiply by the base it and add it to the next bit
on the right,
4 Continue in this way until the right-most bit has been added in.
Year 01 Semester 01 14 / 56
Other Base Conversions
Binary to Octal/Hexadecimal
1 Form the bits into groups of three/four starting at the right and move
leftwards.
2 Replace each group of three bits with the corresponding
octal/hexadecimal digit.
Octal/Hexadecimal to Binary
The opposite of the above process is used
Year 01 Semester 01 15 / 56
Conversion of Fractions
Year 01 Semester 01 16 / 56
Conversion of Fractions (Example)
Year 01 Semester 01 17 / 56
Conversion of Fractions (cont’d.)
Year 01 Semester 01 18 / 56
Summary
Year 01 Semester 01 19 / 56
Boolean Algebra
Year 01 Semester 01 20 / 56
Boolean Algebra
Year 01 Semester 01 21 / 56
Boolean Operators
Year 01 Semester 01 22 / 56
Boolean Operators
Complement
Defined as the opposite of the value that a boolean variable takes.
Denoted with a bar (E.g.: A).
0 = 1 and 1 = 0.
Boolean Sum
Defined as the output to be 1 if at least one variable is 1.
Denoted with the symbol + or by OR.
0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1 and 1 + 1 = 1.
Year 01 Semester 01 23 / 56
Boolean Operators (cont’d.)
Boolean Product
Defined as the output to be 0 if at least one variable is 0.
Denoted with the symbol ( ) or by AND.
0 0 = 0, 0 1 = 0, 1 0 = 0 and 1 1 = 1.
When there is no danger of confusion, the symbol can be omitted.
Year 01 Semester 01 24 / 56
Boolean Identities
Year 01 Semester 01 25 / 56
Boolean Identities (cont’d.)
5 Commutative Laws
A+B =B +A
A · B =B · A
6 Associative Laws
A + (B + C ) = (A + B) + C .
A · (B · C ) = (A · B) · C
7 Commutative Laws
A · (B + C ) = (A · B) + (A · C )
A + B · C = (A + B) · (A + C )
Year 01 Semester 01 26 / 56
Boolean Identities (cont’d.)
8 De Morgan’s Laws
(A · B) = A + B
(A + B) = A · B
9 Absorption Laws
A · (A + B) = A
A+A·B =A
10 Inverse Laws / Unit Zero Properties
A+A=1
A·A=0
Year 01 Semester 01 27 / 56
Examples
Year 01 Semester 01 28 / 56
Truth Tables
Year 01 Semester 01 29 / 56
Example
Year 01 Semester 01 30 / 56
Sum of Products (SoP)
In some cases, the truth table might be known and we might want to
know the expression that gives the truth table.
This can be done by representing as a Sum of Products (SoP) of the
variables and their complements.
Steps:-
1 Select the rows in the truth table that gives 1 as the outcome.
2 Write how we can obtain 1 for the first selected row by using the
product of the variables.
3 Repeat step two for all selected rows and use the sum to combine all
results
Year 01 Semester 01 31 / 56
Example
Find the boolean expression for F from the given truth table
Year 01 Semester 01 32 / 56
Product of Sums (PoS)
Year 01 Semester 01 33 / 56
Duality Principle
Year 01 Semester 01 34 / 56
Summary
Year 01 Semester 01 35 / 56
Computer Arithmetic
Year 01 Semester 01 36 / 56
Introduction
Recap:
Binary numbers are a number system with base 2.
Information represented inside a computer takes binary values.
Previous lecture dealt with the conversions between di↵erent number
systems.
This lecture deals with basic mathematical operations (such as
addition, subtraction, multiplication and division) for binary numbers.
Year 01 Semester 01 37 / 56
Binary Addition
Year 01 Semester 01 38 / 56
Binary Addition
Year 01 Semester 01 39 / 56
Binary Subtraction
Year 01 Semester 01 40 / 56
Examples
Year 01 Semester 01 41 / 56
Multiplication and Division
Year 01 Semester 01 42 / 56
Examples
Year 01 Semester 01 43 / 56
Complementary Arithmetic
Year 01 Semester 01 44 / 56
Examples
Get the 1’s and 2’s compliments of the following binary numbers.
1100011
0001111
1010100
1111011
Year 01 Semester 01 45 / 56
Logic Gates
Year 01 Semester 01 46 / 56
Logic Gates
Year 01 Semester 01 47 / 56
Logic Gates
Year 01 Semester 01 48 / 56
Basic Logic Gates (NOT Gate
Truth Table:
Year 01 Semester 01 49 / 56
Basic Logic Gates (OR Gate)
Truth Table:
Year 01 Semester 01 50 / 56
Basic Logic Gates (AND Gate)
Truth Table:
Year 01 Semester 01 51 / 56
Derived Logic Gates (NAND Gate)
Symbol:
Truth Table:
Year 01 Semester 01 52 / 56
Derived Logic Gates (NOR Gate)
Symbol:
Truth Table:
Year 01 Semester 01 53 / 56
Derived Logic Gates (XOR Gate)
Truth Table:
Year 01 Semester 01 54 / 56
Summary
Year 01 Semester 01 55 / 56
Thank You!
Year 01 Semester 01 56 / 56