theory lecture 13

Upload: farah-huma

Post on 02-Apr-2018

222 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/27/2019 Theory Lecture 13

    1/17

    MCT-212: DIGITAL LOGIC

    DESIGN

  • 7/27/2019 Theory Lecture 13

    2/17

    CODE CONVERTERS0000 = 0011 [o_0]?

  • 7/27/2019 Theory Lecture 13

    3/17

    CODE CONVERTERS

    In the digital domain, data or information is representedby a combination of0s and 1s.

    A code is basically the pattern of these 0s and 1s used

    to represent the data.

    Code converters are a class of

    combinational digital circuits

    that are used to convert one type

    of code in to another.

  • 7/27/2019 Theory Lecture 13

    4/17

    CODE CONVERTERS

    Some of the most prominently used codes in digitalsystems are Natural Binary Sequence, Binary Coded

    Decimal, Excess-3 Code, Gray Code, ASCII Code etc.

    Like any combinational digital circuit, a code converter

    can be implemented by using a circuitry ofAND, OR andNOT gates.

    We will be studying the following conversions:

    Binary-to-Excess3 Conversion

    Binary-Gray code conversion

  • 7/27/2019 Theory Lecture 13

    5/17

    BINARY-to-EXCESS-3 CONVERSION

    In excess-3 code, a small value of bias (3) is added tothe binary numbers.

    The representation shifts each number by a value of

    three.

    when the sum of two XS-3 digits is greater than 9, the

    carry bit of a four bit adder will be set high.

  • 7/27/2019 Theory Lecture 13

    6/17

    BINARY-to-EXCESS-3 CONVERSION The truth table shows the conversion parameters.

    A,B,C,D represent a binary/BCD number, while the

    output w,x,y,z represent the excess-3 code.

    A B C D w x y z

    0 0 0 0 0 0 1 1

    0 0 0 1 0 1 0 00 0 1 0 0 1 0 1

    0 0 1 1 0 1 1 0

    0 1 0 0 0 1 1 1

    0 1 0 1 1 0 0 00 1 1 0 1 0 0 1

    0 1 1 1 1 0 1 0

    1 0 0 0 1 0 1 1

    1 0 0 1 1 1 0 0

  • 7/27/2019 Theory Lecture 13

    7/17

    BINARY-to-EXCESS-3 CONVERSION

    A B C D w

    0 0 0 0 00 0 0 1 0

    0 0 1 0 0

    0 0 1 1 0

    0 1 0 00

    0 1 0 1 1

    0 1 1 0 1

    0 1 1 1 1

    1 0 0 0 1

    1 0 0 1 1

    ABCD

    00

    01

    11

    10

    00 01 11 10

    0 0 0

    0 1 1

    X X X X

    1 1 X X

    0

    1

    = + +

  • 7/27/2019 Theory Lecture 13

    8/17

    BINARY-to-EXCESS-3 CONVERSION

    A B C D x

    0 0 0 0 00 0 0 1 1

    0 0 1 0 1

    0 0 1 1 1

    0 1 0 0 1

    0 1 0 1 0

    0 1 1 0 0

    0 1 1 1 0

    1 0 0 0 0

    1 0 0 1 1

    ABCD

    00

    01

    11

    10

    00 01 11 10

    0 1 1

    1 0 0

    X X X X

    0 1 X X

    1

    0

    = ++

  • 7/27/2019 Theory Lecture 13

    9/17

    BINARY-to-EXCESS-3 CONVERSION

    A B C D y

    0 0 0 0 10 0 0 1 0

    0 0 1 0 0

    0 0 1 1 1

    0 1 0 0 1

    0 1 0 1 0

    0 1 1 0 0

    0 1 1 1 1

    1 0 0 0 1

    1 0 0 1 0

    1 0 1

    1 0 1

    X X X X

    1 0 X X

    ABCD

    00

    01

    11

    10

    00 01 11 10

    0

    0

    =+

  • 7/27/2019 Theory Lecture 13

    10/17

    BINARY-to-EXCESS-3 CONVERSION

    A B C D z

    0 0 0 0 10 0 0 1 0

    0 0 1 0 1

    0 0 1 1 0

    0 1 0 0 1

    0 1 0 1 0

    0 1 1 0 1

    0 1 1 1 0

    1 0 0 0 1

    1 0 0 1 0

    1 0 0

    1 0 0

    X X X X

    1 0 X X

    ABCD

    00

    01

    11

    10

    00 01 11 10

    1

    1

    =

  • 7/27/2019 Theory Lecture 13

    11/17

    BINARY-to-EXCESS-3 CONVERSION

    = =+

    = + +

    + + =

    +( + )( + )=

    = + +

    + ( + )=

  • 7/27/2019 Theory Lecture 13

    12/17

    BINARY-to-EXCESS-3 CONVERSION

  • 7/27/2019 Theory Lecture 13

    13/17

    BINARY- GRAY CODE

    CONVERTERS

    Convert binary code into

    gray code, or gray code

    into binary code.

    What are some uses of

    gray code??

    Binary Gray Code0 0 0 0 0 0 0 0

    0 0 0 1 0 0 0 1

    0 0 1 0 0 0 1 10 0 1 1 0 0 1 0

    0 1 0 0 0 1 1 0

    0 1 0 1 0 1 1 1

    0 1 1 0 0 1 0 1

    0 1 1 1 0 1 0 0

    1 0 0 0 1 1 0 0

    1 0 0 1 1 1 0 1

    1 0 1 0 1 1 1 1

    1 0 1 1 1 1 1 0

    1 1 0 0 1 0 1 0

    1 1 0 1 1 0 1 1

    1 1 1 0 1 0 0 1

    1 1 1 1 1 0 0 0

  • 7/27/2019 Theory Lecture 13

    14/17

    BINARY- GRAY CODE

    CONVERTERS

    Binary Gray Code0 0 0 0 0 0 0 0

    0 0 0 1 0 0 0 1

    0 0 1 0 0 0 1 10 0 1 1 0 0 1 0

    0 1 0 0 0 1 1 0

    0 1 0 1 0 1 1 1

    0 1 1 0 0 1 0 1

    0 1 1 1 0 1 0 0

    1 0 0 0 1 1 0 0

    1 0 0 1 1 1 0 1

    1 0 1 0 1 1 1 1

    1 0 1 1 1 1 1 0

    1 1 0 0 1 0 1 0

    1 1 0 1 1 0 1 1

    1 1 1 0 1 0 0 1

    1 1 1 1 1 0 0 0

    Binary to- Gray:

  • 7/27/2019 Theory Lecture 13

    15/17

    BINARY- GRAY CODE

    CONVERTERS

    Binary Gray Code0 0 0 0 0 0 0 0

    0 0 0 1 0 0 0 1

    0 0 1 0 0 0 1 10 0 1 1 0 0 1 0

    0 1 0 0 0 1 1 0

    0 1 0 1 0 1 1 1

    0 1 1 0 0 1 0 1

    0 1 1 1 0 1 0 0

    1 0 0 0 1 1 0 0

    1 0 0 1 1 1 0 1

    1 0 1 0 1 1 1 1

    1 0 1 1 1 1 1 0

    1 1 0 0 1 0 1 0

    1 1 0 1 1 0 1 1

    1 1 1 0 1 0 0 1

    1 1 1 1 1 0 0 0

    Gray to- Binary:

  • 7/27/2019 Theory Lecture 13

    16/17

    ANY QUESTIONS?

    Anyone willing to present?

    Time allowed : 5 mins

    Topic : Any Bonus Points : +3

  • 7/27/2019 Theory Lecture 13

    17/17

    REFERENCES

    Chapter no 4: Combinational Logic Digi tal Lo gic Designby Morris Mano

    Chapter no 6: Functions of Combination Logic

    Digi tal Fundamentalsby Floyd