0% found this document useful (0 votes)
196 views1 page

BCD To 7 Segment VHDL Code

The document describes a VHDL module that decodes a 4-bit BCD input into a 7-segment display output. It takes a 4-bit BCD number as input and uses logic operations to output which segments of a 7-segment display should be turned on to display that number. Each output bit controls a different segment, with the MSB controlling segment a and the LSB controlling segment g.

Uploaded by

Komal Srivastava
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
196 views1 page

BCD To 7 Segment VHDL Code

The document describes a VHDL module that decodes a 4-bit BCD input into a 7-segment display output. It takes a 4-bit BCD number as input and uses logic operations to output which segments of a 7-segment display should be turned on to display that number. Each output bit controls a different segment, with the MSB controlling segment a and the LSB controlling segment g.

Uploaded by

Komal Srivastava
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.

ALL; entity test is port ( clk : in std_logic; b : in std_logic_vector(3 downto 0); --BCD input segment7 : out std_logic_vector(6 downto 0) -- 7 bit decoded output. ); end test; --'a' corresponds to MSB of segment7 and g corresponds to LSB of segment7. architecture Behavioral of test is begin segment7(6) <= b(3) or b(1) or (b(2) and b(0)) or (not b(2) and not b(0));--a segment7(5) <= (not b(1) and not b(0)) or (b(2) and not b(1)) or (b(2) and not b (0)) or b(3);--b segment7(4) <= (b(1) and not b(0)) or (not b(2) and b(0));--c segment7(3) <= (not b(2) and not b(0)) or (b(1) and not b(0)) or(not b(2) and b( 1)) or(b(2) and not b(1) and b(0));--d segment7(2) <= not b(1) or not b(0) or (b(2) and b(1));--e segment7(1) <= not b(2) or (b(1) and b(0)) or (not b(1) and not b(0));--f segment7(0) <= (b(2) and not b(1)) or (b(2) and not b(0)) or (not b(2) and b(1)) or b(3);--g end Behavioral;

You might also like