ScholarQuill logoScholarQuillUniversity Notes
  • Notes
  • Past Papers
  • Blogs
  • Todo
Login
ScholarQuill logoScholarQuillUniversity Notes
Login
NotesPast PapersBlogsTodo
More
SubjectsDiscussionCGPA CalculatorGPA CalculatorStudent PortalCourse Outline
About
About usPrivacy PolicyReportContact
Notes
Past Papers
Blogs
Todo
Analytics
    Current Subject
    🧩
    Digital Logic Design
    CC-110
    Progress0 / 63 topics
    Topics
    1. Introduction to Digital Systems2. Number Systems3. Introduction to Boolean Algebra4. Basic theorems and properties of Boolean Algebra5. Boolean Functions6. Logic Gates7. NAND and NOR Implementation8. Representation of Function in Sum of Minterms or Product of Maxterms9. Simplification of Boolean function using Karnaugh Map10. Don't care Conditions11. The Tabulation Method12. Introduction to Combinational Logic13. Design of Adders14. Design of Subtractors15. Code Convertors16. Analysis Procedure of Combinational Circuits17. Binary Parallel Adders18. Decimal Adders19. Magnitude Comparator20. Decoders and its applications21. Multiplexers22. Demultiplexers23. Encoders24. ROM25. Programmable Logic Array (PLA)26. Introduction to Sequential Circuits27. Basic Flip Flop28. Clocked RS Flip Flop29. Clocked D Flip Flop30. Clocked JK Flip Flop31. Clocked T Flip Flop32. Analysis of Clocked Sequential Circuits33. State Reduction and Assignment34. Flip Flop Excitation tables35. Design Procedure36. Design of Counters37. Design with State Equations38. Introduction to Registers39. Shift Registers40. Ripple Counters41. Synchronous Counters42. Timing Sequences43. Memory Unit44. Random Access Memory45. Introduction to Programmable Logic Devices (CPLD, FPGA)46. Lab Assignments using tools such as Verilog HDL/VHDL, MultiSim47. Familiarization with Digital Electronic Trainer48. Logic gates operations49. Half Adder Operation50. Full Adder Operation51. Half Subtractor Operation52. Full Subtractor Operation53. 7-Segment Display Operation54. Decoder Operation55. BCD To 7-Segment Display56. Multiplexer Operation57. Using Multiplexer and Demultiplexer/Decoder58. Multiplexing 7-Segment Displays59. Comparator Operations60. D Latch and Flip-Flop Operation61. Latching BCD Data for Displaying On 7-Segment Display62. JK Flip-Flop Operation63. Random Access Memories
    CC-110›Code Convertors
    Digital Logic DesignTopic 15 of 63

    Code Convertors

    9 minread
    1,446words
    Intermediatelevel

    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 load past papers

    Click on Show Past Papers to see past papers.
    On This Page
      Reading Stats
      Est. reading time9 min
      Word count1,446
      Code examples0
      DifficultyIntermediate