Number System
Number System
Unit 2
Number system
• Number System is a method of representing Numbers on the Number
Line with the help of a set of Symbols and rules. These symbols range
from 0-9 and are termed as digits. Number System is used to perform
mathematical computations ranging from great scientific calculations to
calculations like counting the number of Toys for a Kid or Number
chocolates remaining in the box. Number Systems comprise of multiple
types based on the base value for its digits.
Types of Number Systems
• Based on the base value and the number of allowed digits, number
systems are of many types. The four common types of Number
System are:
• Decimal Number System
• Binary Number System
• Octal Number System
• Hexadecimal Number System
Binary Number System
• Octal Number System is the base 8 system. Like the binary number
system, this system is also used in the internal processing of
computer system. It is the system that consists of eight digits i.e. {0, 1,
2, 3, 4, 5, 6, 7} which is used for the representation of long binary
numbers short-handedly.
Hexadecimal NumberSystem:
• The rules for conversion from decimal to binary are as given below:
1.Divide the given number by 8 and note the remainder.
2.Repeatedly divide the quotient by 8 and note the remainder until quotient
reduced to 0.
3.Collect the remainders, last obtained first and first obtained last to get the
octal equivalent.
• Example: convert (177)10 into octal
Binary Addition and Subtraction
• The addition and subtraction of the binary number system are similar to that of
the decimal number system.
• The binary number system consists only two digits (0 and 1) which make their
operation easier.
• There are four basic operations for binary addition and subtraction they are:
1’s and 2’s complement of a Binary Number
• In a computer system, subtraction is not performed by directly as arithmetic
operation. It is performed by the technique called complement. It is the process
of repeated addition.
• 1’s complement of a binary number is another binary number obtained by
toggling all bits in it, i.e., transforming the 0 to 1 and the 1 to 0.
• Examples:
• 1's complement of "0111" is "1000"
• 1's complement of "1100" is "0011"
• 2’s complement of a binary number is 1 added to the 1’s complement of the
binary number.
• Examples:
• 2's complement of "0111" is "1001"
• 2's complement of "1100" is "0100"
Subtraction by 1’s Complement
• The steps to be followed in subtraction by 1’s complement are:
• Make both numbers having the same number of bits.
• Determine the 1’s complement of the subtrahend.
• Add this with the minuend.
• If the result of addition has a carry over then it is dropped and an 1 is
added in the last bit.
• If there is no carry over, then 1’s complement of the result of addition
is obtained to get the final result and it is negative.
Subtraction by 2’s Complement
• The steps to be followed in subtraction by 2’s complement are:
• Make both numbers having the same number of bits.
• Determine the 2’s complement of the subtrahend.
• Add this with the minuend.
• If the result of addition has a carry over then it is dropped and result is
positive.
• If there is no carry over, then 2’s complement of the result of addition
is obtained to get the final result and it is negative.
Boolean Algebra
• Boolean algebra is the algebra of logic that deals with the study of binary
variables and logical operations.
• It makes possible to transform logical statements into mathematical symbols
and to calculate the output(true or false) of related statements by using
rules.
• Boolean Variable
• A Boolean variable is the variables which have only two states i.e. true/ false or right/
wrong or on/off or 0/1.
• A variables which consist of only two values i.e. 1 and 0 are Boolean variables or logic
variables. These variables are denoted by English capital letters like A, B, X, Y, etc.
Truth table
• The truth table is a table of all possible
combinations of the variables showing the
relation between the values that variables
may take and the result of the operation.
• A truth table shows the relation between all
input and output in tabular form.
• Boolean expression
• A Boolean expression is an expression that results in a Boolean value, that is,
in a value of either true or false.
• Example: A+B, A.B, 𝐴ҧ
• 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
Boolean function can be either 0 or 1.
• Example: Consider the Boolean function in algebraic expression:
• F = X.Y.Z’+X.Y
Here, X, Y, Z are Boolean variables. The equation on the right-hand side above
is known as an expression. There are three variables i.e. X, Y and Z.
Logic Gates
• Logic gates are the basic building blocks of any digital system.
• It is an electronic circuit having one or more than one input and only one
output.
• The relationship between the input and the output is based on a certain
logic.
• In digital system, there are three basic gates, which are:
• AND gate
• OR gate
• NOT gate
• Apart from basic gate, there are other gates derived from basic gates, which
are:
• NAND gate
• NOR gate
• Exclusive OR(XOR) gate
• Exclusive NOR(XNOR) gate
AND gate
• The AND gate is an electronic circuit that gives a high output (1) only if all its
inputs are high.
• Logic function
Y= A.B
where,
A dot (.) is used to show the AND operation i.e. A.B or simply can be written as
AB. A and B are inputs and Y is output.
where,
A and B are inputs and Y is output.
Laws of Boolean Algebra
• 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.
• The common law for Boolean algebra are:
• Identities law
• Complement law
• Commutative law
• Associative law
• Distributive law
• 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
• Complement Law – A term AND´ed with its complement equals “0” and a
term OR´ed with its complement equals “1”
• A . 𝐴ҧ = 0 A variable AND’ed with its complement is always equal to 0
• A + 𝐴ҧ = 1 A variable OR’ed with its complement is always equal to 1
• Commutative Law
Commutative law states that changing the sequence of the variables does not
have any effect on the output of a logic circuit.
• Associate Law
• Associative law states that Boolean operation performed on variables will
return the same value while changing of the grouping of variables in an
equation
• A .(B . C) = (A . B) . C
• A+(B+C) = (A+B)+C
• Distributive law
• ANDing two variables and ORing the result with another variable is equal to
AND of ORing of the variable with the two individual variables.
• A + B.C = (A + B)(A + C)
• ORing two variables and ANDing the result with another variable is equal to
OR of ANDing of the variable with the two individual variables.
• A (B+C) = (A. B) + (A .C)
De Morgan’s Theorem
• Statement 1:
• The compliment of the product of 2 variables is equal to the sum of the
compliments of individual variables.
• 𝐴. 𝐵 = 𝐴ҧ + 𝐵ത
• Statement 2:
• The compliment of the sum of two variables is equal to the product of the
compliment of each variable
• 𝐴 + 𝐵 = 𝐴ҧ . 𝐵ത
Verifying DeMorgan’s Theorem using Truth
Table