ScholarQuill logoScholarQuillUniversity Notes
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
Study Tools
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
Contact
ScholarQuill logo
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
ScholarQuill logoScholarQuillUniversity Notes
Study PortalCC-110Code Converters
Ctrl + K
Login
Explore
Search
Semester
Papers
CGPA
    CC-110

    Digital Logic Design

    Progress0 / 63 done
    Topics63
    1Introduction to Digital Systems2Number Systems3Introduction to Boolean Algebra4Basic theorems and properties of Boolean Algebra5Boolean Functions6Logic Gates7NAND and NOR Implementation8Representation of Function in Sum of Minterms or Product of Maxterms9Simplification of Boolean function using Karnaugh Map10Don't care Conditions11The Tabulation Method12Introduction to Combinational Logic13Design of Adders14Design of Subtractors15Code Convertors16Analysis Procedure of Combinational Circuits17Binary Parallel Adders18Decimal Adders19Magnitude Comparator20Decoders and its applications21Multiplexers22Demultiplexers23Encoders24ROM25Programmable Logic Array (PLA)26Introduction to Sequential Circuits27Basic Flip Flop28Clocked RS Flip Flop29Clocked D Flip Flop30Clocked JK Flip Flop31Clocked T Flip Flop32Analysis of Clocked Sequential Circuits33State Reduction and Assignment34Flip Flop Excitation tables35Design Procedure36Design of Counters37Design with State Equations38Introduction to Registers39Shift Registers40Ripple Counters41Synchronous Counters42Timing Sequences43Memory Unit44Random Access Memory45Introduction to Programmable Logic Devices (CPLD, FPGA)46Lab Assignments using tools such as Verilog HDL/VHDL, MultiSim47Familiarization with Digital Electronic Trainer48Logic gates operations49Half Adder Operation50Full Adder Operation51Half Subtractor Operation52Full Subtractor Operation537-Segment Display Operation54Decoder Operation55BCD To 7-Segment Display56Multiplexer Operation57Using Multiplexer and Demultiplexer/Decoder58Multiplexing 7-Segment Displays59Comparator Operations60D Latch and Flip-Flop Operation61Latching BCD Data for Displaying On 7-Segment Display62JK Flip-Flop Operation63Random Access Memories
    9 min read
    Topic 15 of 63
    Topic Study Note Illustration
    15

    Code Convertors

    In digital logic design, code converters are circuits that transform data from one binary code format to another. These converters are crucial for systems that need to...

    Code Converters in Digital Logic

    In digital logic design, code converters are circuits that transform data from one binary code format to another. These converters are crucial for systems that need to operate with different encoding schemes, such as Binary Coded Decimal (BCD), Excess-3, Gray code, or even binary to BCD conversion. Code converters are widely used in digital systems such as microprocessors, ALUs (Arithmetic Logic Units), and communication systems.

    Types of Code Converters:

    1. Binary to BCD (Binary Coded Decimal) Converter
    2. BCD to Binary Converter
    3. Binary to Gray Code Converter
    4. Gray Code to Binary Converter
    5. Excess-3 to Binary Converter
    6. Binary to Excess-3 Converter

    Let’s explore the design and functionality of some of the most commonly used code converters.


    1. Binary to BCD Converter

    A Binary to BCD converter converts a binary number (base-2) into its equivalent BCD (Binary Coded Decimal) representation. In BCD, each decimal digit is represented by a 4-bit binary number.

    BCD Representation:

    In BCD, each decimal digit (0-9) is represented as a 4-bit binary number:

    • Decimal 0 → Binary 0000
    • Decimal 1 → Binary 0001
    • Decimal 2 → Binary 0010
    • ...
    • Decimal 9 → Binary 1001

    Design of Binary to BCD Converter:

    • The conversion process involves dividing the binary number into its decimal digits and then converting each decimal digit into its 4-bit BCD representation.
    • Double Dabble Algorithm: One common method for converting binary to BCD is the "Double Dabble" algorithm. This algorithm works by adding 3 to the BCD digits whenever the BCD digits exceed 4 (for each nibble) during the shift operation.

    Example:

    For converting the binary number 1010 (decimal 10) to BCD:

    • 1010 (binary 10) would be converted to 0001 0000 (BCD for 1 and 0).

    Block Diagram:

    The binary input is fed into a shift register, and after each shift operation, a comparison is made to see if any BCD digit exceeds 4. If so, 3 is added to adjust the BCD digit. This process repeats until the entire binary number is converted.


    2. BCD to Binary Converter

    A BCD to Binary converter converts a BCD (Binary Coded Decimal) number into its corresponding binary form. Since each BCD digit is represented by 4 bits, the converter must combine the BCD digits into a single binary number.

    BCD Representation:

    • Each 4-bit BCD digit represents one decimal number (0-9).
    • To convert multiple BCD digits to binary, each 4-bit digit is multiplied by its respective place value (e.g., ones, tens, hundreds) and then summed up.

    Design of BCD to Binary Converter:

    • BCD digits are processed using a binary adder.
    • Each BCD digit is multiplied by a power of 10 (based on its position) and then summed to produce the final binary result.

    Example:

    For converting BCD 0001 0010 (BCD for 12) to binary:

    • The output is 1100 (binary representation of 12).

    Block Diagram:

    BCD digits are input into a series of adders that accumulate the binary equivalent of each digit's weighted value.


    3. Binary to Gray Code Converter

    A Binary to Gray code converter converts a binary number into its corresponding Gray code representation. Gray code is a binary numeral system where two successive values differ in only one bit, which makes it particularly useful in minimizing errors in digital systems.

    Gray Code Representation:

    In Gray code, the binary number is converted by keeping the most significant bit the same and then XOR'ing each subsequent bit with the previous one.

    For example:

    • Binary 0000 → Gray code 0000
    • Binary 0001 → Gray code 0001
    • Binary 0010 → Gray code 0011
    • Binary 0011 → Gray code 0010

    Design of Binary to Gray Code Converter:

    • Gray Code Formula: The Gray code GnG_nGn​ for a binary number BnB_nBn​ is given by: Gn=Bn⊕Bn+1G_n = B_n \oplus B_{n+1}Gn​=Bn​⊕Bn+1​ where ⊕\oplus⊕ is the XOR operation.

    Example:

    For converting the binary number 1010 to Gray code:

    • The most significant bit remains the same, so the first Gray bit is 1.
    • XOR each subsequent bit: 1⊕0=11 \oplus 0 = 11⊕0=1, 0⊕1=10 \oplus 1 = 10⊕1=1, 1⊕0=11 \oplus 0 = 11⊕0=1.
    • So, the Gray code for binary 1010 is 1111.

    Block Diagram:

    The input binary number is fed to a series of XOR gates to generate the corresponding Gray code.


    4. Gray Code to Binary Converter

    A Gray code to Binary converter converts a Gray code number into its corresponding binary representation. This conversion is the inverse of Binary to Gray Code conversion.

    Gray Code Representation:

    Gray code is useful in reducing the errors in digital systems, but to perform arithmetic or logical operations, binary form is usually required. Thus, converting Gray code back to binary is essential.

    Design of Gray Code to Binary Converter:

    To convert Gray code back to binary, the process involves starting with the most significant bit and applying the following formula:

    Bn=Gn⊕Bn−1B_n = G_n \oplus B_{n-1}Bn​=Gn​⊕Bn−1​

    Where:

    • BnB_nBn​ is the nth binary bit.
    • GnG_nGn​ is the nth Gray code bit.
    • Bn−1B_{n-1}Bn−1​ is the previous binary bit.

    Example:

    For Gray code 1111:

    • The first binary bit is the same as the first Gray bit, so B3=G3B_3 = G_3B3​=G3​ = 1.
    • For the next binary bit: B2=G2⊕B3=1⊕1=0B_2 = G_2 \oplus B_3 = 1 \oplus 1 = 0B2​=G2​⊕B3​=1⊕1=0.
    • Continue this for all bits: B1=G1⊕B2=1⊕0=1B_1 = G_1 \oplus B_2 = 1 \oplus 0 = 1B1​=G1​⊕B2​=1⊕0=1, and B0=G0⊕B1=1⊕1=0B_0 = G_0 \oplus B_1 = 1 \oplus 1 = 0B0​=G0​⊕B1​=1⊕1=0.
    • So, the binary equivalent of Gray code 1111 is 1010.

    Block Diagram:

    The input Gray code is fed into a series of XOR gates that process each bit with the previous binary bit to reconstruct the binary number.


    5. Excess-3 to Binary Converter

    Excess-3 code is a BCD code where each decimal digit is represented by the binary value of the digit plus 3. For example, the decimal digit 0 is represented as 0011, and 1 is 0100, and so on.

    Design of Excess-3 to Binary Converter:

    • To convert from Excess-3 to binary, subtract 3 (i.e., 0011 in binary) from each 4-bit Excess-3 code.
    • This can be done using a subtractor circuit or by adding the appropriate binary value to the Excess-3 code.

    Example:

    For Excess-3 code 0100 (which represents decimal 1):

    • Subtract 0011 from it: 0100−0011=00010100 - 0011 = 00010100−0011=0001, which is the binary equivalent of decimal 1.

    6. Binary to Excess-3 Converter

    The Binary to Excess-3 converter is used to convert a binary number into its Excess-3 code representation.

    Design of Binary to Excess-3 Converter:

    • To convert a binary number to Excess-3, add 3 (which is 0011 in binary) to the binary number.

    Example:

    For binary 0001 (which is decimal 1):

    • Add 0011 (3 in binary): 0001+0011=01000001 + 0011 = 01000001+0011=0100, which is the Excess-3 code for decimal 1.

    Conclusion:

    Code converters are essential in digital systems where different binary codes are required for various operations or communication. Understanding the design of code converters like Binary to BCD, BCD to Binary, Binary to Gray Code, Gray Code to Binary, Excess-3 to Binary, and Binary to Excess-3 is crucial for designing efficient and reliable digital systems. These converters help ensure compatibility between different parts of a digital system, especially when dealing with varied coding schemes.

    ← Previous topic 14
    Design of Subtractors
    Next topic 16 →
    Analysis Procedure of Combinational Circuits

    Past Papers

    Open this section to view and download past papers

    Click on Show Past Papers to load available exam papers.

    Reading Progress
    0%
    9mremaining
    1.4kwords
    Intermediatelevel
    On This Page

    No headings found

    Study Toolkit

    Subject Portal

    Digital Logic Design