0% found this document useful (0 votes)
6 views

Number System

Uploaded by

Rozan Dulal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Number System

Uploaded by

Rozan Dulal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 33

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

• Number System with base value 2 is termed as Binary number


system. It uses 2 digits i.e. 0 and 1 for the creation of numbers. The
numbers formed using these two digits are termed as Binary
Numbers. Binary number system is very useful in electronic devices
and computer systems because it can be easily performed using just
two states ON and OFF i.e. 0 and 1.
• Decimal Numbers 0-9 are represented in binary as: 0, 1, 10, 11, 100,
101, 110, 111, 1000, and 1001
Decimal Number System
• Number system with base value 10 is termed as Decimal number system. It uses
10 digits i.e. 0-9 for the creation of numbers. Here, each digit in the number is at
a specific place with place value a product of different powers of 10. Here, the
place value is termed from right to left as first place value called units, second to
the left as Tens, so on Hundreds, Thousands, etc. Here, units has the place value
as 100, tens has the place value as 101, hundreds as 102, thousands as 103, and
so on.
• For example: 10285 has place values as

• (1 × 104) + (0 × 103) + (2 × 102) + (8 × 101) + (5 × 100)


• 1 × 10000 + 0 × 1000 + 2 × 100 + 8 × 10 + 5 × 1
• 10000 + 0 + 200 + 80 + 5
• 10285
Octal 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:

• Hexadecimal Number System is the number system that represents


long binary numbers in shortcut method. It is a base 16 system as it
consists of 16 digits i.e. {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F }
where the alphabets represent the decimal numbers 10 to 15. This
system is also used in the computer system, mainly in the memory
management. E.g. 56A H, AB H
Conversion of binary to decimal (base 2 to
base 10):
• The rules for conversion from binary to decimal are given below:
1.Multiply each bit by corresponding power of 2 (base).
2.Sum each product term to get a decimal equivalent number.
• Note: A power of 2 is 0 for a left bit of binary point and increase the
power by one for each bit towards left of binary point.
Example
• Example 1: convert (110011)2 to decimal.
• Solution:
• (110011)2 = 1×25 + 1×24 + 0×23 + 0×22 + 1×21 + 1×20
• = 32 + 16 + 0 + 0 + 2 +1
• = (51)10
• Example 2: convert (1011.101)2 into decimal.
• (1011.101)2 = 1×23 + 0×22 + 1×21 + 1×20 + 1×2-1 + 0×2-2 + 1×2-3
• = 8 + 0 + 2 + 1 +0.5+ 0 +0.125
• = 11 + 0.5 + 0.125
• = (11.625)10
Conversion of binary to octal (base 2 to base 8):

• The rules for conversion from binary to decimal are given


below:
1.Divide the given binary number into a group of three bits from
binary point to left (or from right to left if no fractional part) and
from binary point to the right. Append 0’s at leading or trailing or
trailing position if necessary to make each group of 3 bits.
2.Substitute each group of three bits by octal equivalent from a
table.
3.Collect octal digits to get an octal equivalent number.
Example: convert (10110101)2 into octal.
Conversion of binary to hexadecimal (base 2 to base 16):
• The rules for conversion from binary to hexadecimal
are as given below:
• Divide the given binary number into a group of four bits
from binary point to left (or from right to left if no fractional
part) and from binary point to the right. Append 0’s at
leading or trailing position if necessary to make each group
of 4 bits.
• Substitute each group of four bits by hexadecimal
equivalent symbol (letter or digit) from the table.
• Collect Hexadecimal symbols to get Hexadecimal equivalent
number
• Example: convert (10101011101)2 into hexadecimal
Conversion of decimal to binary (base 10 to base 2):
• The rules for conversion from decimal to binary are as given
below:
1.Divide the given number by 2 and note the remainder.
2.Repeatedly divide the quotient by two and note the remainder until
quotient reduced to 0.
3.Collect the remainders, last obtained first and first obtained last to
binary equivalent.
• Example: convert (51)10 into binary
Conversion of decimal to octal (base 10 to base 8):

• 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.

Fig. Logic Symbol and truth table


OR gate
• The OR gate is an electronic circuit that gives a high output (1) if one or more of
its inputs are high. A plus (+) is used to show the OR operation.
• Logic function
Y= A+B
where,
A Plus(+) is used to show the OR operation. A and B are inputs and Y is output.

Fig. Logic Symbol and truth table


NOT gate
• The NOT gate is an electronic circuit that only one input and one output, which produces an
inverted version of the input at its output. It is also known as an inverter. This is also shown as A'
or 𝐴ҧ
• Logic function
Y= A' or 𝐴ҧ
where,
A is inputs and F is output.

Fig. Logic Symbol and truth table


NAND gate
• This is a NOT-AND gate which is equal to an AND
gate followed by a NOT gate. The outputs of all
NAND gates are high if any of the inputs are low.
• The symbol is an AND gate with a small circle on
the output. The small circle represents inversion.
• Logic function
Y= 𝐴. 𝐵
where,
Fig. Logic Symbol and truth table
A and B are inputs and Y is output.
NOR gate
• This is a NOT-OR gate which is equal to an OR gate
followed by a NOT gate. The outputs of all NOR gates
are low if any of the inputs are high.
• The symbol is an OR gate with a small circle on the
output. The small circle represents inversion.
• Logic function
Y= 𝐴 + 𝐵
where,
A and B are inputs and Y is output.
Exclusive OR(XOR) gate
• XOR gate is a digital logic gate that gives a
true (1 or HIGH) output when the number of
HIGH inputs is odd.
• Logic function
Y= A𝐵ത + 𝐵𝐴ҧ
where,
A and B are inputs and Y is output.
Exclusive NOR(XNOR) gate
• This is a NOT-XOR gate which is equal to an XOR gate
followed by a NOT gate. The outputs of all XNOR
gates is true if an even number of inputs are true
• Logic function

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

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy