MODULE III ADC

Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

NUMBER SYSTEMS

Technique to represent numbers in computer system architecture.


There are different types of number systems
1. Binary number system
2. Decimal Number system
3. Hexadecimal number system
1. Binary Number system

• It has only two digits that are 0 and 1


• Base:2
• It has 2 digits 0,1
2. Decimal Number system

• It has 10 digits ie 0-9 ie0,1,2,3,4,5,6,7,8,9


• Base:10
3. Hexadecimal number system

• It has 16 numbers
• 0,1,2,3,4,5,6,7,8,9,A(10),B(11),C(12),D(13),E(14),F(15)
• Base:16
RELATION BETWEEN DIFFERENT NUMBER SYSTEMS

CONVERSIONS OF NUMBER SYSTEMS


Each of the following number systems can be converted to other
1.Binary to other number system
2.Decimal to other
3.Hexadecimal to other…….

I BINARY TO DECIMAL
Multiplying each bit by its positional weight/base and adding them together gives decimal
number

II BINARY TO HEXADECIMAL NUMBER SYSTEM

• Group the bits of binary numbers in groups of 4 starting from the binary point. Add
zeros to the extreme ends if needed.
• Now write the hexadecimal digits corresponding to each group of four bits
Example (10110101011.011)2

• Make pairs of 4 bits on both sides of the binary point.


• 1011 1010 1011 .0110
• Then write the corresponding hexadecimal number
• (BAB.6)16
I.DECIMAL TO BINARY
Example: (152.25)10

Ans(10011000.01)2

OR

For converting decimal to binary

For the number to the left of the decimal point divide the successive quotients by base 2 of binary
system.

For the number to the right of the decimal point: Multiply the successive products by the base 2
II.DECIMAL TO HEXADECIMAL CONVERSION

ANS (98.4)16

I HEXADECIMAL TO DECIMAL

By multiplying with corresponding positional weights and adding them together.

II HEXADECIMAL TO BINARY

Write 4 bit binary code for each hexadecimal digit.

Example: (152A.25)16

Ans (0001 0101 0010 1010.0010 0101)2

BINARY ARITHMETIC

1. ADDITION

2. SUBTRACTION

3.MULTIPLIATION

4. DIVISION
SUBTRACTION
REPRESENTATION OF NEGATIVE NUMBERS
Negative numbers can be represented either in 1’s complement form or in 2’s complement
form
1’s COMPLEMENT FORM
To get 1’s complement of a binary number change all 0’s to 1 and all 1’s to 0’s
Eg: 1100100: 1’s complement→0011011
STEPS FOR SUBTRACTION USING 1’S COMPLEMENT

• The number to be subtracted is called SUBTRAHEND


• The number from which subtraction is to be done is called MINUEND
• In the first step find the 1’s complement of the subtrahend.
• Next add the complement of the subtrahend to the minuend.
• If got a carry, add the carry to its LSB. Else take 1’s complement of the result which
will be negative.
Example:10101-00111

• Minuend:10101
• Subtrahend:00111
• 1’s complement of subtrahend 00111:11000.
• Add to the minuend:10101+11000=1 01101-----here carry-=1 so add to LSB to get
final answer.
• Ie 01101+1=01110
Example:10101-10111

• Minuend:10101
• Subtrahend:10111
• 1’s complement of subtrahend 10111:01000.
• Add to the minuend:10101+01000= 11101-----here no carry so calculate the 1’s
complement of the result which is the negative number
• Ie 11101----1’s complement:00010; Final answer=00010.

2’S COMPLEMENT FORM


Take 1’s complement of the number and add 1 to the LSB
Eg: 1100100: 2’s complement→1’s complement +1-→0011011+1=0011100
STEPS FOR 2’S COMPLEMENT SUBTRACTION

• The number to be subtracted is called SUBTRAHEND


• The number from which subtraction is to be done is called MINUEND.
• Find the 2’s complement of the subtrahend.
• Add the complement of subtrahend to the minuend.
• If we get a carry, discard it and the result is positive.. Else take 2’s complement of the
result which will be negative.
Example: 10101-00111

• Minuend:10101
• Subtrahend:00111
• 1’s complement of subtrahend 00111:11000.
• Find 2’s complement:11000+1=11001
• Add to the minuend:10101+11001=1 01110-----here carry-=1 so discard the carry to
get the final positive answer.
• Ie Final answer=01110
Example: 10101-10111

• Minuend:10101
• Subtrahend:10111
• 1’s complement of subtrahend 10111:01000.
• Find 2’s complement:11000+1=01001
• Add to the minuend:10101+01001=11110-----here no carry bit so take 2’s
complement of answer to get the answer which is negative
• Ie Final answer:2’s complement of 11110=00010—which is negative.

BCD(BINARY CODED DECIMAL)

• It is a type of code used to represent a given decimal number in an equivalent binary


form.
• In BCD equivalent, a decimal number is written by replacing each decimal digit in
integer/fractional parts with its 4 bit binary equivalent/nibble
• It allows easy conversion to decimal digits for printing/display and faster
calculations.
• Most common BCD code is 8421 code. It is a weighted binary code. Each binary digit
of 4 bit group representing a decimal digit is assigned a weight and the sum of
weights of those binary digits whose value is 1 gives the decimal equivalent.
• Other BCD codes are 4221 and 5421 codes.
DECIMAL NO BCD(8421 CODE)
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001

Example for 8421 BCD Code:9.2

9:1001

2-0010

So 9.2-→ BCD Code:1001.0010

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. Based on this, logic gates are named as AND gate, OR gate,
NOT gate etc.

BASIC GATES:AND,OR,NOT

UNIVERSAL GATES: NAND, NOR

ADVANCED GATES: EXOR,EXNOR

• AND GATE TRUTH TABLE


2.OR GATE

It is an AND gate followed by a not gate.

It is an OR Gate followed by a NOT Gate.


BOOLEAN ALGEBRA

• It is also called Switching algebra.


• It is a set of rules, laws and theorems by which all logical operations can be
mathematically expressed.
• It is the algebra of binary variables 0 and 1
• + represents ‘OR’ operation.
• (.) represents ‘AND’ operation.
• ̅ 𝑟𝑒𝑝𝑟𝑒𝑠𝑒𝑛𝑡𝑠 𝑐𝑜𝑚𝑝𝑙𝑒𝑚𝑒𝑛𝑡/𝑁𝑂𝑇

LAWS OF BOOLEAN ALGEBRA

Sl THEOREM PURPOSE
No
1. A+0=A OR OPERATION
2 A+1=1
3 A+A=A
4. A+𝐴̅ =1

5. A.0=0 AND OPERATION


6. A .1=A
7. A .A =A
8. A .𝐴̅ =0

9 𝐴̿ = 𝐴 COMPLEMENT(INVOLUTION)

10 ̅̅̅̅̅̅̅̅
𝐴 + 𝐵 = 𝐴̅. 𝐵̅ DEMORGAN’S THEOREM
11 ̅̅̅̅
𝐴𝐵 = 𝐴̅ + 𝐵̅

12. A+B=B+A COMMUTATIVE LAWS


13 A.B=B.A

ASSOCIATIVE LAWS
14. (A+B)+C=A+(B+C)
15 (A.B).C=A.(B.C)

16. A.(B+C)=A.B+A.C DISTRIBUTIVE LAWS


17 (A+B).C=A.C+B.C

EXAMPLES
1.A+AB
A+AB=A(1+B) ------( By theorem 2 1+B=1)
=A
2.A.(A+B)
=A.A+A.B -------By theorem 7 A.A=A
=A+AB------------By theorem 2 ;1+B=1
=A(1+B)=A
3.(A+B)(A+C)
=A.A+A.C+A.B+B.C
=A+AC+A.B+A.C=A(1+C)+A.B+B.C
=A+AB+BC=A(1+B)+B.C
=A+BC
DEMORGAN’S THEOREM
Theorem 1: The complement of the product of two or more variables is equal to sum of
their complements.
̅̅̅̅
𝐴𝐵 = 𝐴̅ + 𝐵̅
Theorem 2:The complement of the sum of two or more variables is equal to product of their
complements.
̅̅̅̅̅̅̅̅
𝐴 + 𝐵 = 𝐴̅. 𝐵̅
SOP AND POS EXPRESSIONS

• Product term: A term in Boolean expression where one or more complemented/


uncomplemented variables are ANDed.
• Sum term: A term in Boolean expression where one or more complemented/
uncomplemented variables are ORed.
• SUM OF PRODUCT(SOP): A type of Boolean expression where several product terms
are ORed together.
Eg:Z=AB+ABC+BC

• CANONICAL/STANDARED SOP: A type of Boolean expression where several product


terms are ORed together and each term contains all variables in the complemented
or uncomplemented form.
• PRODUCT OF SUM (POS): A type of Boolean expression where several SUM terms
are ANDed together. Eg(A+B).(C+D),(A+C)
• CANONICAL/STANDARED POS: A type of Boolean expression where several SUM
terms are ANDed together and each term contains all variables in the
complemented or uncomplemented form.

You might also like