7/17/12
VHDL coding tips and tricks: VHDL code for BCD to 7-segment display converter Share
Report Abuse
Next Blog»
VHDL coding tips and tricks Get interesting tips and tricks in VHDL programming Home
VHDL FAQs
Example Codes
Testimonials
About me
Disclaimer
Homework or Project
Contact me for VHDL projects or ass
VHDL Test Benche Generate VHDL model or logic analyzer data. www.syncad.com
Xilinx® Verilog Tr FPGA Textbooks Verilog & VHDL Digital Digital Design Texts using Digilent FPGA kits. Low cost.
www.digilentinc.com
Virtex-6 AMC W/ FMC site site Mid size AMC for μTCA/ATCA cards HPC VITA 57 FMC connector for I/Os
lyrtechrd.com/
Get Expert Verilog Tra Authorized Instructor www.xilinx.com/training
FPGA book Vlsi design vhdl IC design papers and EDA tools EE Times India: News & Technology
www.eetindia.co.in
100 Power Tips for FP your FPGA design skill OutputLogic.com
SATURDAY, SATURDAY, MARCH 6, 201 0
VHDL code for BCD to 7-segment display converter 0 tweets
tweet Here is a program for BCD to 7-segment display decoder. The module takes 4 bit BCD as input and outputs 7 bit decoded output for driving the display unit.A seven segment display can be used to display decimal digits.They have LED or LCD elements which becomes active when the input is zero.The figure shows how different digits are displayed:
Digital Power Man Single-c Single-c hip solution. interface. www.Latticesemi.com/Platf
SEARCH THIS BLOG
TRANSLATE THIS PAGE
GET UPDATES
Enter your
Su Delivered
library IEEE IEEE; ; use IEEE IEEE. .STD_LOGIC_1164 STD_LOGIC_1164. . ALL; IEEE. .STD_LOGIC_ARITH STD_LOGIC_ARITH. . ALL; use IEEE IEEE.STD_LOGIC_UNSIGNED. .STD_LOGIC_UNSIGNED. ALL; use IEEE entity test is port ( clk : in std_logic std_logic; ; bcd : in std_logic_vector std_logic_vector( (3 downto 0); --BCD input segment7 : out std_logic_vector std_logic_vector( (6 downto 0) -- 7 bit decoded output.
LIKED THIS BLOG ?
Join this site w ith Google Friend Friend Connect
Members (254) More »
); end test test; ;
--'a' corresponds to MSB of segment7 and g corresponds to LSB of segment7. architecture Behavioral of test is begin clk,bcd) ) process (clk,bcd BEGIN if (clk clk'event 'event and clk clk= ='1') then case bcd is "0000"=> => segment7 <= <="0000001" "0000001"; ; when "0000" when "0001" "0001"=> => segment7 <= <="1001111" "1001111"; ; when "0010" "0010"=> => segment7 <= <="0010010" "0010010"; ; "0011"=> => segment7 <= <="0000110" "0000110"; ; when "0011" "0100"=> => segment7 <= <="1001100" "1001100"; ; when "0100" when "0101" "0101"=> => segment7 <= <="0100100" "0100100"; ; when "0110" "0110"=> => segment7 <= <="0100000" "0100000"; ; "0111"=> => segment7 <= <="0001111" "0001111"; ; when "0111" "1000"=> => segment7 <= <="0000000" "0000000"; ; when "1000" when "1001" "1001"=> => segment7 <= <="0000100" "0000100"; ;
-- '0' -- '1' -- '2' -- '3' -- '4' -- '5' -- '6' -- '7' -- '8' -- '9' --nothing is displayed when a number more than 9 is given as input. when others=> segment7 <= <="1111111" "1111111"; ; end case;
vhdlguru.blogspot.in/2010/03/vhdl-code-f vhdlguru.blogspot.in/2010/03/vhdl-code-for-bcd-to-7-segm or-bcd-to-7-segment-display.html ent-display.html
Already a member? ember? Sign in
LABELS
vhdl tips (28) exa (14) xilinx errors (9) model (4) core generator ( generator (
1/4
7/17/12
VHDL coding tips and tricks: VHDL code for BCD to 7-segment display converter end if;
Find us on Facebook
end process;
V-codes
end Behavioral;
Like
If you want a decimal number to be display ed using this c ode then convert the corresponding code into BCD and then instantiate thi s module for each digit of the BCD code.
529 people like V-codes .
Here is a sample test bench code for this module: Facebook social plugin
LIBRARY ieee; USE ieee.std_logic_1164. ALL; use IEEE.STD_LOGIC_ARITH. ALL;
BLOG ARCHIVE
ENTITY test_tb IS END test_tb;
► ► 2012 (6)
ARCHITECTURE behavior OF test_tb IS signal clk : std_logic := '0'; signal bcd : std_logic_vector(3 downto 0) := (others => '0'); signal segment7 : std_logic_vector(6 downto 0); constant clk_period : time := 1 ns; BEGIN uut: entity work.test PORT MAP (clk,bcd,segment7); clk_process : process begin
▼ ▼ 2010 (74)
► ► 2011 (16)
► ► December 2010 (1) ► ► November 2010 (1) ► ► October 2010 (4) ► ► September 2010 (7) ► ► August 2010 (3) ► ► July 2010 (2)
clk <= '0'; wait for clk_period/2; clk <= '1'; wait for clk_period/2; end process; stim_proc: process
► ► June 2010 (1) ► ► April 2010 (10) ▼ ▼ March 2010 (44) Reading and Writing fi How to test your desig
begin for i in 0 to 9 loop
Fixed Point Operation
bcd <= conv_std_logic_vector(i,4); wait for 2 ns; end loop; end process;
4 bit Synchronous UP Fixed Point Operation Positive edge triggere 3 : 8 Decoder using b
END;
Fixed Point Operation 4 bit Ripple Carry Add
You might also like:
4 bit comparator with t
Migrating from std_logic_vector to UNSIGNED or SIGNED data types 8 bit Binary to BCD converter - Double Dabble algorithm How to implement State machines in VHDL? VHDL code for a simple ALU Sequence detector using s tate machine in VHDL
Simple 1 : 4 Dem ultipl Simple 4 : 1 multiplex LinkWithin
Migrating from std_log SIG... Concatenation Operat
Posted by vipin at 7:50 PM Reactions:
Random Number Gen Why the library "nume
Labels: useful codes
Matrix multiplication in +2 Recommend this on Google
A VHDL Function for fi Entity Instantiation - A
10 comments: Alfred March 25, 2010 9:20 AM
A VHDL function for di Simple sine wave gen Digital clock in VHDL Some tricky coding m
hello.. can you pls post a test bench for this code.. tnx... Reply
Xilinx ISE Help : Using Schemat... Synthesis Error : More
vipin
March 25, 2010 10:25 AM
@Alfred : I have modified the pos t including the test bench.Hope that helps..
Synthesis Error : Sign Synthesis w arning : N Synthesis w arning : F
Reply
Alfred March 25, 2010 12:57 PM tnx a lot.. Reply
Basic model of FIFO GENERIC's in VHDL c... When and how to use Variables and Shared What is the difference t...
Yanuar May 30, 2010 7:27 PM
Usage of components
thank you, it is so useful for me. Can you show m e, how to control a animation on vga using keyboard in vhdl
Is 'case' statement m
Reply
VHDL coding method Check(CRC...
vhdlguru.blogspot.in/2010/03/vhdl-code-for-bcd-to-7-segment-display.html
How to do a clocked 'f
2/4
7/17/12
VHDL coding tips and tricks: VHDL code for BCD to 7-segment display converter Raphael Andreoni October 26, 2010 1:25 AM
VHDL code for BCD t
Hi, I'm trying to implement the sum of two numbers with 5 bits and s how in two digits SSD, but with no success , do you have any idea how to do this?
Some useful VHDL da Can you change a sig Xilinx error :- Simulato
I had success with decimal counter until 99, but how make this work whit the sum, I don't know.
A synthesizable delay Thanks
Usage of Packages a
Reply
How to write a testben ► ► February 2010 (1)
Jtesla July 21, 2011 2:02 AM Can som e one help m e with the code for Four bit BCD decimal COUNTER using VHDL and the 74LS90. I'm us ing Xilinx 12.1 and I'm really struggling with the logic gate code. my email is
[email protected]
VISITORS
Reply
sumdt October 19, 2011 10:25 PM Please help me! Write a VHDL code to perform the function of multiplier which the inputs are from Dip Switch and outputs display to 7-segment LED with BCD. X : dip 1~4represents value 0~15 Y : dip 5~8represents value 0~15 Thanks you so much Reply
sandeep October 21, 2011 6:43 PM write a VHDL prog to display number on BCD-7 segm ent display , input given from ps /2 keyboard Reply
mar'd December 21, 2011 7:55 PM can you help me to get a VHBL program for 64 bit CSA Reply
blogzworld May 8, 2012 10:50 PM Can you post the synthesis report. Reply
Enter your comment...
Comment as: Google Account Publish
Preview
Newer Post
Home
Older Post
Subscribe to: Post Comments (Atom)
VHDL Test Benches Generate VHDL models from timing diagrams or logic analyzer data. FPGA book 100 Power Tips for FPGA Designers Improve your FPGA design skills
www.syncad.com
OutputLogic.com
Code to Flow Charts tool Convert program code to Visio, BMP Excel, Word, Powerpoint flow charts
www.fatesoft.com
DOWNLOAD THIS ARTICLE AS PDF
vhdlguru.blogspot.in/2010/03/vhdl-code-for-bcd-to-7-segment-display.html
3/4
7/17/12
VHDL coding tips and tricks: VHDL code for BCD to 7-segment display converter
TOTAL PAGEVIEWS
8 7 7 0 9 3 Simple template. Powered by Blogger .
vhdlguru.blogspot.in/2010/03/vhdl-code-for-bcd-to-7-segment-display.html
4/4