Number
System And Conversion Boolean Logic
The number system is categorized
into two types:
Positional Number System
In positional number system, each digit of a number has its unique positional weight or place value. Examples of positional number system are decimal, binary, octal, hexadecimal etc.
Non-Positional Number System
In non-positional number system, each digit/symbol of a number has no weight or place value. Example of non-positional number system is Roman Number System.
Decimal Number System
A number system having base 10 is called decimal number system. It consist of 10 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9. It is also known as denary number system. The power of base starts with 0 from least significant digit towards most significant digits. Example: (125)10
Binary Number system
A number system having base 2 is
called binary number system. It consist of 2 bits i.e. 0 and 1. It is also
known as Binary Digit (BIT). It is specially used in internal processing of
computer system. The power of base 2 starts with 0 from least significant bit
towards most significant bits for non-fractional numbers, where as in case of
fractional numbers, the power of base starts with -1. It is used in electronic
circuit to represents the low state and high state.
Example: (110011)2
Octal Number System
A number system having base 8 is
called octal number system. It consist of 8 digits: 0, 1, 2, 3, 4, 5, 6 and 7.
It also used in internal processing of computer system. The power of base 8
starts with 0 from least significant digit towards most significant digits for
non-fractional numbers, whereas in case of fractional numbers, the power of
base starts with -1.
Example: (375)8
Hexadecimal Number System
A number system having base 16 is
called hexadecimal number system. It consist of 16 digits: 0 to 9 and A to F.
It is also used in computer basically in memory management. The power of base
16 starts with 0 from least significant digit towards most significant digits
from non-fractional numbers, where as in case of fractional numbers, the power
of base starts with -1. Example: (A4F)16
Note : Conversion and Numerical Part will be added soon.
Complements
Complements are used in digital
computers for simplifying the subtraction operation and for logical
manipulation. Using complements, all the arithmetic operations can be performed
in the form of addition. There are two types of compliments: (r-1)’s complement
and r’s complement, where r is the base of a number system. So, for binary
number system r=2 hence, it has two complements: 1’s and 2’s complement. For
decimal number system, r=10 hence it also has two complements: 9’s complement
and 10’s complement.
9’s complement
A 9’s complement of a given
decimal number is obtained by subtracting each digit from 9. Ex: 9’s complement
of 9 is 0 (9 – 9 = 0) and 345 is 654 (999 – 345 = 654).
Steps for decimal subtraction using 9’s complement
a) Make
the number of digits equal in both minuend and subtrahend.
b) Calculate
9’s complement of subtrahend.
c) Calculate
the sum of minuend and 9’s complement of subtrahend.
d) Check
the overflow digit (carry).
•
If there is overflow digit, discard it and add
it to the remaining part of the sum and the final sum would be the answer.
•
If there is no overflow digit then the result
must be negative. So, again calculate 9’s complement of the sum and that would
be the final answer.
10’s complement
A 10’s complement of a given
decimal number is obtained by subtracting each digit from 9 and finally adding
one. Ex: 10’s complement of 9 is 1 (9’s complement of 9 is 0 +1 = 1) and 425 is
575 (9’s complement of 425 is 574 + 1 = 575).
Steps for decimal subtraction using 10’s complement
a) Make
the number of digits equal in both minuend and subtrahend.
b) Calculate
10’s complement of subtrahend.
c) Calculate
the sum of minuend and 10’s complement of subtrahend.
d) Check
the overflow digit (carry).
•
If there is overflow digit, discard it and the
remaining part of the sum would be the final answer.
•
If there is no overflow digit then the result
must be negative. So, again calculate 10’s complement of the sum and that would
be the final answer.
Binary Calculation (IMP)
a) Binary
Addition
b) Binary
Subtraction
c) Binary
Multiplication
d) Binary
Division
1’s Complement
A 1’s complement of a given
number is obtained by subtracting each bit of the given number from 1. In
another words, it is obtained simply by inverting 0 to 1 vice versa. Ex: 1’s
complement of 1001 is 0110.
Steps for binary subtraction using 1’s complement
a) Make
the number of bits equal in both minuend and subtrahend.
b) Calculate
1’s complement of subtrahend.
c) Calculate
the sum of minuend and 1’s complement of subtrahend.
d) Check
the overflow bit (carry).
•
If there is overflow bit, discard it and add it
to the remaining part of the sum and the final sum would be the answer.
•
If there is no overflow bit then the result must
be negative. So, again calculate 1’s complement of the sum and that would be
the final answer.
2’s Complement
A 2’s complement of a given
binary number is obtained by adding 1 to the 1’s complement of the given binary
number. Ex: 2’s complement of 1001 is 0110 + 1 = 0111.
Steps for binary subtraction using 2’s complement
a) Make
the number of bits equal in both minuend and subtrahend.
b) Calculate
2’s complement of subtrahend.
c) Calculate
the sum of minuend and 2’s complement of subtrahend.
d) Check
the overflow bit (carry).
•
If there is overflow bit, discard it and the
remaining bits would be the final answer.
• If there is no overflow bit then the result must be negative. So, again calculate 2’s complement of the sum and that would be the final answer.
Boolean Algebra
Boolean algebra is the branch of
mathematics that includes methods for manipulation logical variables and
logical expression.
It is named after George Boole, a
mathematician and philosopher who was among the first who try to formalize what
we call logic and reasoning.
Boolean algebra is used to design
and simplify circuits of electronic devices.
Each input and output are thought
as a member of the set {0, 1}.
The basic elements of circuits
are called gates. Each type of gate implements Boolean operation.
Differences between Boolean algebra and Ordinary algebra: (IMP)
Boolean algebra |
Ordinary algebra |
It is algebra of logic based on binary number system. |
It
is general purpose algebra based on decimal number system. |
It is used in the field of digital electronics. |
It is used in the field of mathematics. |
Its basic operations are AND, OR and NOT operations. |
Its
basic operations include addition, subtraction, multiplication, and division.
|
There is no exponents or coefficients involved in Boolean
algebra i.e. A+A=A and A.A=A. |
It consists of coefficients and exponents
such as A+A=2A and A.A=A2. |
It has only a finite set of elements. That is, it deals with
only two elements; 0 and 1. |
It
deals with real numbers that contain an infinite number of elements (1, 2,
3…). |
It holds both distributive laws: A.(B+C)=(A.B)+(A.C) and A+(B.C)=(A+B).(A+C) |
It
holds only one distributive law: A.(B+C)=(A.B)+(A.C) |
Boolean
Expression
A Boolean expression is a string
of symbols representing logic variables and logical operations which is
evaluated to give a logical value. Example: A+A’B, A.B + A’B’
Logic function
(Boolean function)
Boolean function, commonly known as a logic function is an expression expressed algebraically with binary variables, logical operation symbols, parenthesis and equal sign. For a given value of the binary variables, the logic function can be either 0 or 1.
Basic Logical/ Boolean Operation:
Introduction:
An operator is a special symbol
that indicates the operation to be carried out between two operands. An
operation is an action to be carried out upon operands. There are 3 basic
Boolean Operations: AND, OR and NOT operations.
AND operation
Known as logical multiplication,
it is carried out by dot (.) operator or simply by AND. If the inputs are true,
it generates true output. Otherwise, it generates false output. Its logical
equation is written as C=A.B or C=A AND B. The truth table of AND operation is:
Inputs
|
|
Output
|
A |
B |
C=A.B
|
False
|
False
|
False
|
False
|
True
|
False |
True
|
False
|
False
|
True
|
True
|
True
|
OR operation
Known as logical addition, it is
carried out by plus (+) operator or simply by OR. If at least one input is
true, it generates true output or else, it gives false output. The logical
equation of OR operation is written as C=A+B or C=A OR B. The truth table of OR
operation is given below:
Inputs
|
|
Output
|
A |
B |
C=A+B
|
False
|
False
|
False
|
False
|
True
|
True |
True
|
False
|
True
|
True
|
True
|
True
|
NOT Operation
Also known as the logical
compliment, it is carried out by prime (‘) operator or bar (‾). It generates
the output opposite the input i.e. if the input is true, it generates false
output and vice versa. It's logical equation can be written as C=A’. The truth
table of OR operation is:
Inputs
|
Output |
A |
C=A’
|
True
|
False |
False
|
True
|
Truth table and Boolean expression:
Truth table is the tabular representation of Boolean
function used in logic to compute the functional values of logical expression
on each of their functional arguments. It is also defined as a table which
represent the input/output relationship of the binary variables for each gate.
The examples of truth table of different gates are as follows
Logic gates:
A logic gate is an electronic
circuit that operates on one or more input signals to produce an output signal.
A logic gate is also known building block of a digital circuit. Mostly, the
logic gate consists of two inputs and one output. Gates produce the signals 1
or 0 if input requirements are satisfied. Digital computer uses different types
of logical gates. Each gate has a specific function and graphical symbol. The
function of the gate is expressed by means of an algebraic expression. The
basic gates are described below:
AND Gate:
It is an electronic circuit used
to perform logical manipulation and it is denoted by dot operator (.). it The AND Gate contain two or more than to
input values which produce only one output value. AND gate produces 1 output
when all inputs are 1, otherwise the output will be 0.
The graphical symbol, algebraic
expression, truth table and Veen Diagram of AND gate is shown below:
OR Gate:
It is an electronic circuit used
to perform logical addition and for that it uses plus operator (+). The OR Gate
contains two or more than two input values which produce only one output value.
OR gate produces 1 output, when one of the inputs is 1. If inputs are 0, then
the output will be also 0. It can be The graphical symbol, algebraic
expression, truth table and Venn Diagram of OR gate is as shown below:
NOT Gate:
It is an electronic circuit used
to perform logical complement operation and for that it is uses single quote or
bar operator (‘ or ). The NOT Gate contains only one input value
which produces only one output value. It generates 1 or true output if the
input is false otherwise, it generates 0 or False output. So, it is known as
Inverter.
The graphical symbol, algebraic expression, truth table and Venn Diagram of a NOT gate is given below.
Universal Gates
The logic gate which can be used
to obtain all basic gates (AND, OR, NOT) is called universal gates.
There ae two universal gates:
NAND and NOR.
NAND Gate:
It is an electronic circuit used
to perform complement of logical multiplication or complement of AND operation.
It used dot operator (.) and single quote operator (‘).
The NAND Gate contains two or
more than two input values which produce only one output value. This gate is
the combination of AND and NOT gates. It generates high or 1 output when at least
any one of input is false otherwise it generates low or 0 output.
The graphical symbol, algebraic
expression, truth table and Venn Diagram of NAND gate is shown below:
(draw venn-diagram yourself)
NOR Gate:
It is an electronic circuit used to perform
complement of logical addition or complement of OR operation and it uses plus
operator (+) and single quote (‘) operator. The NOR Gate contains two or more
than two input values which produce only one output value. This gate is a
combination of OR and NOT gate. This gate produces 1 output, when all inputs
are 0 otherwise output will 0. The graphical symbol, algebraic expression,
truth table and Venn diagram of NOR gate are given below:
(draw venn-diagram yourself)
Exclusive OR and Exclusive NOR Gate
Exclusive OR and Exclusive NOR
gates can be designed by connecting basic gates. They fall under combinational
circuit, in which output of one gate becomes input for another gate. It is also
called as processing devices.
Exclusive OR
(X-OR) Gate:
It is an electronic circuit used
to perform logical “either/ or” operation. It accepts two or more inputs and
generate only one output. It generates high or 1 output when the number of high
or 1 input is in odd otherwise it generates low or 0 output.
The graphical symbol, algebraic
expression and truth table of X-OR gate is given below:
Exclusive NOR
(X-NOR) Gate:
It is an electronic circuit used to perform logical complement of Exclusive OR operation. It accepts two or more inputs and generate only one output. It generates high or 1 output when all the inputs are either high or low otherwise it generates low or 0 output.
The graphical symbol, algebraic expression and truth table of X-NOR gate is shown below:
Duality Principle
(IMP)
According to principle of
Duality, dual of Boolean expression can be obtained by replacing AND (.) with
OR (+) and vice versa, 1 with 0 and 0 with 1 keeping variables and components
are unchanged. For example duality of expression (A + 0) is (A . 1), A.B’+C is
A+B’.C
Law Of Boolean
Algebra
A, B, C are the Boolean variables, plus (+), dot (.) and prime (‘) are the Boolean operators and 0 and 1 are identities then the laws of Boolean algebra are stated as: