7段译码电路设计

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

7段译码器设计2012-2-13内容提要用并行语句设计在进程语句中设计用ROM设计动态扫描译码器设计硬件电路用并行语句设计ENTITYDECL7SISPORT(A:INSTD_LOGIC_VECTOR(3DOWNTO0);R:INSTD_LOGIC;LED7S:OUTSTD_LOGIC_VECTOR(6DOWNTO0));ENDDECL7S;ARCHITECTUREONEOFDECL7SISBEGINLED7S=1111111WHENA=0000ELSE1111001WHENA=0001ELSE0100100WHENA=0011ELSE0110000WHENA=0011ELSE0011001WHENA=0100ELSE0010010WHENA=0101ELSE0000010WHENA=0110ELSE1111000WHENA=0111ELSE--……0000000WHENA=1000ELSE0001110;ENDONE;级数多,运行速度慢在进程语句中设计LIBRARYIEEE;USEIEEE.STD_LOGIC_1164.ALL;ENTITYDECL7SISPORT(A:INSTD_LOGIC_VECTOR(3DOWNTO0);R:INSTD_LOGIC;LED7S:OUTSTD_LOGIC_VECTOR(6DOWNTO0));ENDDECL7S;ARCHITECTUREONEOFDECL7SISBEGINPROCESS(A,R)BEGINIFR='1'THENCASEAISWHEN0000=LED7S=1000000;WHEN0001=LED7S=1111001;WHEN0010=LED7S=0100100;WHEN0011=LED7S=0110000;WHEN0100=LED7S=0011001;WHEN0101=LED7S=0010010;WHEN0110=LED7S=0000010;WHEN0111=LED7S=1111000;WHEN1000=LED7S=0000000;WHEN1001=LED7S=0010000;WHEN1010=LED7S=0001000;WHEN1011=LED7S=0000011;WHEN1100=LED7S=1000110;WHEN1101=LED7S=0100001;WHEN1110=LED7S=0000110;WHEN1111=LED7S=0001110;WHENOTHERS=NULL;ENDCASE;ELSELED7S=1111111;ENDIF;ENDPROCESS;ENDONE;只有一级,速度快用ROM设计编辑ROM文件新建原理图生成ROM模块连线不使用逻辑宏单元address[4..0]clockq[7..0]lpm_rom0instVCCaddress[4..0]INPUTVCCclockINPUTq[7..0]OUTPUT动态扫描译码器设计LED数码显示电路从电路看,该数码显示器是共阴极结构bcdin输入的数据bcdsel位选信号leddata7段译码输出ledsel位选输出ledd[7..0]OUTPUTledse[3..0]OUTPUTbcdin[3..0]bcdsel[1..0]leddata[7..0]ledsel[3..0]bcd_ledinst3ledd[7..0]ledse[3..0]实体定义libraryieee;useieee.std_logic_1164.all;useieee.std_logic_arith.all;useieee.std_logic_unsigned.all;entitybcd_ledisport(leddata:outstd_logic_vector(7downto0);ledsel:outstd_logic_vector(3downto0);bcdin:instd_logic_vector(3downto0);bcdsel:instd_logic_vector(1downto0));endbcd_led;7段译码architecturebehaveofbcd_ledissignalbcdtmp:std_logic_vector(3downto0);signalbcdseltmp:std_logic_vector(1downto0);beginprocess(bcdsel)beginbcdtmp=bcdin;bcdseltmp=bcdsel;casebcdtmpiswhen0000=leddata=11111100;when“0001”=leddata=01100000;when0010=leddata=11011010;when0011=leddata=11110010;when0100=leddata=01100110;when0101=leddata=10110110;when0110=leddata=10111110;when0111=leddata=11100000;when1000=leddata=11111110;when1001=leddata=11110110;when1010=leddata=11101110;when1011=leddata=00111110;when1100=leddata=10011100;when1101=leddata=01111010;when1110=leddata=10011110;when1111=leddata=10001110;whenothers=leddata=00000000;endcase;位选信号输出casebcdseltmpiswhen00=ledsel=0001;when01=ledsel=0010;when10=ledsel=0100;when11=ledsel=1000;whenothers=ledsel=0000;endcase;endprocess;endbehave;

1 / 19
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功