Tuesday, March 28, 2017

VHDL PROGRAM FOR BINARY TO BCD CONVERTER



BINARY TO BCD
Library IEEE;
    use IEEE.std_logic_1164.all;
    entity binary is
        port(b0,b1,b2,b3,b4:in bit;
            a,b,c,d,e:out bit);
        end binary;
        architecture binary_D of binary is
            begin
                a <= b0;
                b <= b1 xor b4;
                c <= ((not b1) and b2) or (b1 and (not b2) and b4) or (b2 and (not b4));
                d <= ((not b1) and (not b3) and b4) or ((not b2) and (not b3) and b4) or (b3 and (not b4));
                e <= (b1 and b2 and b4) or (b3 and b4);
            end binary_D;

No comments:

Post a Comment