1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Binary to 7 Segment Decoder

This circuit displays the Hexadecimal equivalent of a 4 bit Binary Number. The number is displayed

  1. jakeselectronics
    There are many Binary to 7 Segment decoders out there, such as the CD4511, DM74LS47, SN7447 and the DM9368. All of which have attractive features, but none have all of them in one package. Another downside is many only display 0 - 9 with few displaying all Hexadecimal digits (0 - F). With many of these chips obsolete and hard to find, my Binary to 7 Segment Decoder is a versatile substiute.

    How It Works

    I am using a PIC16F628A to read the Binary Number and Display the Hexadecimal equivalent on a 7 Segment LED display. The ASM file is heavily commented, so for information on exactly how it works, take a look at the ASM file.

    Here is a summarised explanation:
    1. The software reads the logic levels of the first 4 bits of PORTA (Binary Inputs) and stores the digit in a General Purpose Register (GPR).
    2. The GPR is then XOR'd with 0x00 to mask the upper nibble.
    3. A table is called, and the program counter jumps x amount of instructions, depending on the number stored in the GPR.
    4. The corresponding 7 segment arrangement is moved to the working register (W).
    5. Then this is transfered to PORTB, to which the LED 7 segment display is connected. As well and doing this, the microcontroller tests the inputs for Ripple Blanking, Latch, Test Lamp, and Display Type Select and acts on them accordingly.



    1x PIC16F628A (can use 627A or 648A)
    1x LED 7 Segment (Common Cathode or Common Anode)
    7x 470Ω Resistor
    3x 10KΩ (RA4, RA5 & RB0 pull up ) resistor
    1x .1μF Multilayer Ceramic Capacitor
    1x Breadboard

    Attached Files: