Вы находитесь на странице: 1из 93

A VERY GOOD MORNING TO ALL OF U

7/13/12 Click to edit Master subtitle style

DIGITAL LOGIC DESIGN

BINARY SYSTEMS
Click to edit Master subtitle style CHAPTER 1

7/13/12

TOPICS

DIGITAL SYSTEMS NUMBER SYSTEMS NUMBER BASE CONVERSIONS OCTAL AND HEXADECIMAL NUMBERS COMPLEMENTS SIGNED BINARY NUMBERS
7/13/12

BINARY CODES

DIGITAL SYTEMS

SYSTEM TYPES OF SYSTEMS CLASSIFICATION OF SYSTEMS APPLICATIONS OF DIGITAL SYSTEMS ADVANTAGES OF DIGITAL SYSTEMS DISADVANTAGES OF DIGITAL SYSTEMS DIGITAL COMPUTER 7/13/12

SYSTEM

7/13/12

Classification of Systems
Analog Systems (Continuous)
Physical quantities or signals may vary continuously over a specified range.

Digital Systems (Discrete step by step)


Physical quantities or signals can assume only discrete values .

Represented by symbols called Hence represented by continuously variable indicator digits

Thermometer 7/13/12

Digital Clock

Applications of Digital Systems

Communicat ion

7/13/12

Applications of Digital Systems

7/13/12

Business Transaction

Applications of Digital Systems

Traffic Control

7/13/12

Applications of Digital Systems

Space Guidance Weather 7/13/12 Monitoring

Applications of Digital Systems

Medicine

7/13/12

Applications of Digital Systems

7/13/12

Interne

Applications of Digital Systems

Commerci al

7/13/12

Applications of Digital Systems

Commerc ial

7/13/12

Applications of Digital Systems

Commerc ial

7/13/12

Applications of Digital Systems


Commercia l

7/13/12

Applications of Digital Systems

Industry
7/13/12

Applications of Digital Systems

Scientific Enterprises

7/13/12

Applications of Digital Systems

Militar y

7/13/12

Advantages of Digital Systems


Easier to Design Information storage is easy Accuracy and Precision through out the system Operations can be programmed

Digital Circuits are less prone to 7/13/12 noise

Disadvantages of Digital Systems


Real world is analog Digitization of information is a time consuming process.

7/13/12

Digital Computer

It can follow a sequence of instructions called a program, that operates on given data. Program and data can be varied according to the users needs.

7/13/12

Digital Computer

One important characteristic of digital computer is the ability to manipulate discrete elements of information. Discrete information must contain finite number of elements. Eg: 10 Decimal digits, 26 alphabets, 52 playing cards, 64 chess squares
7/13/12

Digital Computer

The name Digital Computer emerged from an application. Early computers are used for numeric computations in which discrete elements are digits. Physical quantities used to represent discrete information are signals. Some of the signals are voltage and current signals (Implemented by 7/13/12 transistors)

Digital Computer

But signals used in digital systems have 2 discrete values 0 & 1 ( binary) Binary Digit- Bit 0 or 1 Group of bits Binary Codes Hence using various techniques, groups of bits can represent discrete symbols.

These symbols are again used to develop system in digital format. 7/13/12

Design of Digital Systems

7/13/12

7/13/12

Switching Circuits

Many of sub systems of digital systems take form of a switching circuit. It consists of one or more inputs and outputs having discrete values.
x x
. .

Switching Circuit

Z Z

. .

xm
7/13/12

Z
m

Classification of Switching Circuits


Combinational Circuits Sequential Circuits
Output depends on present Output depends on both on input only past and present inputs Building blocks are logic gates No memory is required as no storage is necessary Building blocks are logic gates and flip flops Memory is required as past inputs are to be stored

Eg: Multiplexers, Decoders, Eg: Ring Counter, Encoders, PLDs, PLAs, PALs, Synchronous Counter, CPLDs, FPGAs etc. Ripple Counter
7/13/12

Why binary in Digital Systems

In general, switching devices used in digital systems are generally twostate devices.

So, output can assume only two discrete values.


7/13/12

7/13/12

Number Systems

Decimal Number System Binary Number System Octal Number System

(10) (2) (8)

Hexadecimal Number System (16)

7/13/12

Decimal Number System


Representatio (501.68 n )10 =5*10^2 + 0*10^1 + 1*10^0 + 6*10^-1 + 8*10^-2

7/13/12

Decimal Number System


Numbers have positional importance 349.2510 9 x 100 = 9 x 1=9 4 x 101 = 4 x 10 = 40 3 x 102 = 3 x 100 = 300 2 x 10-1 = 2/10 5 x 10-2 = 5/100

In the binary system, positional importance follows powers of 2

Conversion from Binary to Decimal

(11001.11)

= 1*2^4 + 1*2^3 + 0*2^2 + 0* 2^1 + 1*2^0 + 1*2^-1 + 1*2^-2 = 16 + 8 + 0 + 0 + 1 + 0.5 + 0.25

( 25.75 )10

7/13/12

= 3 * 8^2 + 4 * 8^1 + 7 * 8^0 + 2 * 8^-1 + 0 * 8^2 + 5 * 8^-3

Conversion from Octal to Decimal ( 347.20 5)


192 + 32 + 0.01 + 7 + 0.25 +

= 0

( 231.26)10

7/13/12

Conversion from Hexadecimal to Decimal

( 23A4.EC)
16

= 2 * 16^3 + 3 * 16^2 + A * 16^1 + 4 * 16^0 + E * 16^-1 + C * 16^-2 = 8192 + 768 + 160 + 4 + 0.875 + 0.0468

(9214.9218 )10

7/13/12

Conversion from Decimal to Binary


( 61 )
10

7/13/12

Conversion from Decimal to Binary


( 61 )
10

Decimal value Integer Fraction Coefficient


0 0 0 1

7/13/12

Conversion from Decimal to Octal


(247.6875)1
0

= (367.54)

7/13/12

Octal Number System


Octal Numbers 0 1 2 3 4 5 6
7/13/12

Binary Equivalents 000 001 010 011 100 101 110 111

Hexadecimal Number System Binary Equivalents Decimal Values Hexadecimal


Representation 0 1 2 3 4 5 6 7 8 9 A B C D E 0 1 2 3 4 5 6 7 8 9 10 11 12 13 7/13/12 14 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110

Binary Arithmetic

Binary Addition Binary Subtraction Binary Multiplication Binary Division


7/13/12

Binary Addition

1011 + 1100 _____ 10111 _____

0101 +1111 10100

7/13/12

Addition of two binary numbers


0 1 10 0 0 1410 = 011102 +2510 = 110012 1 0 01 1 1
= 32 + 7 = 39

7/13/12

Check your work Carry 111101 101101 +011101 1001010 Sum 45 + 29 = 74

7/13/12

Binary Subtraction

1011 - 0110 ______

Minuend Subtrahend ______

11101 - 10011

0101Difference
7/13/12

01010

Binary Multiplication
1001 *1101 _____ 1001 0000 1001 1001 _________ 1110101
7/13/12 Final Product Partial Products

Multiplicand Multiplier

Binary Division
1101 1001 1110101 1001 --------1011 1001 ----------1001
7/13/12

1001

Complements

Used in digital computers

for simplifying the subtraction operation and for logical manipulation.

7/13/12

Diminished Radix Complement


Also called (R-1)s complement (R-1)s complement of any number system can be defined as ( R-1 )-N R = Base or Radix of a given number system N = given number n = no. of digits present in the given

7/13/12

For Decimal Number System


R = 10

==> (R-1) = 9

( R-1 )s complement = 9s complement = (10-1) N (R-1)s complement of 546700 is 9s complement of 546700 = (10 -1)= 99999-546700
7/13/12

(546700)

= 453299

For Binary Number System


R=2

==> (R-1) = 1

( R-1 )s complement = 9s complement = (2-1) N (R-1)s complement of 1011000 is 1s complement of 1011000 =(2-1)= 1111111-1011000
7/13/12

(1011000)

= ( 0100111 )

Radix Complement

Also called Rs complement R s complement of any number system can be defined as [ ( R-1 )-N ]+ 1 R = Base or Radix of a given number system N = given number
7/13/12

n = no. of digits present in the given

For Decimal Number System

R = 10 Rs complement = 9s complement

= [ (10-1) N ] + 1 Rs complement of 546700 is


complement + 1 9s complement
7/13/12

10s complement of 546700 = 9s

(10 -1)- (546700)

= 999999-546700 = 453299

For Binary Number System

R=2

==> Rs complement = 2s

complement

= (2-1) N
Rs complement of 1011000 is 1s complement + 1 (1011000)

1s complement of 1011000 =(2-1)= 1111111-1011000

7/13/12

= ( 0100111 )

During subtraction of two ndigit unsigned numbers M & N of same base R, there occurs two cases Case (i): M>N Case (ii): M<N This operation can be applied for any number system
7/13/12

Subtraction with Complements (Unsigned Numbers)

For Decimal Number System

M= minuend

= 72532

N = subtrahend = 3250

Perform M-N Case (i) M>N is to be applied M= 72532 M= 72532


10s complement

N = 03250 N = 96750 --_______ +_______

7/13/12

For Decimal Number System


So case (ii) : M<N M = 03250 03250 N = 72532 27468 -______ -69282 30718
7/13/12

M= N= +_____

For Binary Number System

M= minuend Perform M-N

1010100 1000011

N = subtrahend =

Case (i) M>N is to be applied M= 2s complement

M= 1010100 1010100 N = 1000011 N = 0111101


7/13/12

-- _________ +_________

For Binary Number System


So case (ii) : M<N M = 1000011 1000011 N = 1010100 0101100 M= N=

-_______ Final Answer = - ( 2s complement of +________ 1101111) - 0010001 = - ( 0010001) 1101111 7/13/12

Signed- Binary Numbers


+ve sign indicates a positive number -ve sign indicates a negative number Digital Circuits can understand only two numbers 0 & 1 Hence to indicate the sign, an additional bit is placed as the most significant bit. 0 represents a +ve number 1 represents a ve number
7/13/12

Signed- Binary Numbers


Consider an 8 bit number

(01000100)
MSB of this no. is 0 which represents

a +ve sign i.e., a positive number


Its equivalent is (01000100) =

(+68)10

Consider another number

(11000100)
MSB of this no. is 1 which represents
7/13/12

Signed- Binary Numbers


(101100) =

MSB = 1 -ve number (01100) = Magnitude (12)10 = Answer = Sign & Magnitude = (-12)10
7/13/12

Signed- Binary Numbers


(0111) =

MSB = 0 +ve number (111) = ( 7 )10 Magnitude = Answer = Sign & Magnitude = ( +7 )10
7/13/12

Signed- Binary Numbers 1s Complement representation


Also called Signed Complement

representation

i.e., Sign + Complement

( 0101 )

= (+5)10

( 1010 ) = ( -5 )10 in 1s complement form ( 01000 ) = (+8)10


7/13/12 ( 10111 ) = ( -8 )10 in 1s

Also called Signed 2s Complement

Signed- Binary Numbers 2s Complement representation

representation

i.e., Sign + 2s Complement of magnitude

( 0101 )

= (+5)10

( 1011 ) = ( -5 )10 in 2s complement form ( 01000 ) = (+8)10 ( 11000) = ( -8 )10 in 2s


7/13/12

Signed Decimal Numbers (+7) (+6) (+5) (+4) (+3) (+2) (+1) (+0) (-0) (-1) (-2) (-3) (-4) (-5) (-6) (-7) 7/13/12 (-8)

Signed Magnitude 0111 0110 0101 0100 0011 0010 0001 0000 1000 1001 1010 1011 1100 1101 1110 1111 --

Signed 1s complement 0111 0110 0101 0100 0011 0010 0001 0000 1111 1110 1101 1100 1011 1010 1001 1000 --

Signed 2s complement 0111 0110 0101 0100 0011 0010 0001 0000 -1111 1110 1101 1100 1011 1010 1001 1000

Addition of 2 signed numbers


+6 +13 00000110 00001101 - 6 11111010 +13 00001101 ------ ------------------+19 00000111 - 6 11111010 -13 11110011 ------ ------------------+19 11101101

-----------------------+6 00000110 +19 00010011 -13 11110011 ------ ------------------+19 11111001


7/13/12

Subtraction of 2 signed numbers


(+ A) (+B) = (+ A) + (-B) (+ A) (-B) = (+ A) + (+B)

7/13/12

Overflow, Signed Integers

As has been shown, when numbers are treated as signed integers, a carry of 1 from the addition of the most significant bits DOES NOT indicate an overflow, 3 00011 + (-3) +11101 = 0 = 00000, with a carry of 1 For signed integers, overflow occurs when:

The addition of two positive numbers results in a negative 7/13/12 number, or

Overflow Examples

In a 6-bit register + 17 = 010001 + 16 = +010000 =100001 100001 = - (011110 + 1) = - 011111 = -31 In an 8-bit register - 100 = - (0110 0100) = 1001 1011 +1 = 1001 1100 - 50 = - (0011 0010) = 1100 1101 +1 = 7/13/12

Range of a number Overflow during addition

A fixed-length register can only hold a Range of numbers For a 4-bit device, the range of positive integers is 0 - 15 For an 8-bit device the range of positive integers is 0 - 255 When adding positive integers, Overflow occurs when the sum falls outside the range of the register

Overflow Summary

For positive integers, overflow occurs when the carry from addition of the leftmost bits is a 1 For signed integers, overflow occurs when either The addition of two negative numbers gives a positive number, or 7/13/12

Binary Codes

7/13/12

Weighted Codes

BCD (8421) (2421) (5421) (63-1-1) (7421) N= w a + w a + w a


7/13/12

BINARY CODES

Most compatible system for a computer or a digital system is binary system Most of the users are accustomed to decimal number system To reduce this gap, decimal numbers are converted to binary, arithmetic calculations are 7/13/12 performed in binary, and then

BINARY CODES

Code is a symbolic representation of an information transform During this process, we need to store decimal numbers in computer for performing conversion But computers accept only digits 0s & 1s So, we must represent these decimal 7/13/12 digits by means of a code consisting

BCD Code

In simplest form of binary code, each decimal digit is represented by its binary equivalent. 854.792

1000 0010
7/13/12

0101

0100

0111

1001

Representation of BCD Code


( 3 4 5 )10 = ( 0011 0100 0101)BCD
= ( 101011001 )

( 1 5 7 )10 = ( 0001 0101 0111 ) BCD representation 12 bits denotes a decimal number Binary value 8 bits denotes binary value itself
7/13/12

BCD Addition
1 8 4 0001 +576 ---------760 1000 0100 01 1 1 01 10 1010 0110 0000

0101

---------------------0 111 10000 0 11 0 0 111 0110 ----------------------7/13/12

Non-Weighted Codes

Excess 3 code Gray code 2 out of 5 code Biquinary code

7/13/12

Excess-3 code

7/13/12

Gray Codes

The property of this code is that the successive decimal digits differ in exactly one bit.

7/13/12

Conversion from Binary to Gray

7/13/12

Conversion of Gray to Binary

7/13/12

Alpha numeric codes


ASCII code EBCDIC code

7/13/12

7/13/12

7/13/12

Binary Storage & Registers

7/13/12

Register Transfer

7/13/12

Logical Operation in Registers

7/13/12

Binary Logic

7/13/12

Вам также может понравиться