完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
|
|
相关推荐
6个回答
|
|
你是个什么译码器,把代码贴上来我看一下午
|
|
|
|
不明白什么意思。
|
|
|
|
LIBRARY IEEE ;USE IEEE.STD_LOGIC_1164.ALL ;ENTITY DECL7S ISPORT ( A : IN STD_LOGIC_VECTOR(3 DOWNTO 0);LED7S : OUT STD_LOGIC_VECTOR(6 DOWNTO 0) ) ;END ;ARCHITECTURE one OF DECL7S ISBEGINPROCESS( A )BEGINCASE A ISWHEN "0000" => LED7S <= "0111111" ;WHEN "0001" => LED7S <= "0000110" ;WHEN "0010" => LED7S <= "1011011" ;WHEN "0011" => LED7S <= "1001111" ;WHEN "0100" => LED7S <= "1100110" ;WHEN "0101" => LED7S <= "1101101" ;WHEN "0110" => LED7S <= "1111101" ;WHEN "0111" => LED7S <= "0000111" ;WHEN "1000" => LED7S <= "1111111" ;WHEN "1001" => LED7S <= "1101111" ;WHEN "1010" => LED7S <= "1110111" ;WHEN "1011" => LED7S <= "1111100" ;WHEN "1100" => LED7S <= "0111001" ;WHEN "1101" => LED7S <= "1011110" ;WHEN "1110" => LED7S <= "1111001" ;WHEN "1111" => LED7S <= "1110001" ;WHEN OTHERS => NULL ;END CASE ;END PROCESS ;END ; |
|
|
|
module bin2_7seg (data_in ,EN ,data_out );
input [3:0] data_in ; input EN ; output [6:0] data_out ; reg [6:0] data_out ; always @(data_in or EN ) begin data_out = 7'b1111111; if (EN == 1) case (data_in ) 4'b0000: data_out = 7'b1000000; // 0 4'b0001: data_out = 7'b1111001; // 1 4'b0010: data_out = 7'b0100100; // 2 4'b0011: data_out = 7'b0110000; // 3 4'b0100: data_out = 7'b0011001; // 4 4'b0101: data_out = 7'b0010010; // 5 4'b0110: data_out = 7'b0000011; // 6 4'b0111: data_out = 7'b1111000; // 7 4'b1000: data_out = 7'b0000000; // 8 4'b1001: data_out = 7'b0011000; // 9 4'b1010: data_out = 7'b0001000; // A 4'b1011: data_out = 7'b0000011; // b 4'b1100: data_out = 7'b0100111; // c 4'b1101: data_out = 7'b0100001; // d 4'b1110: data_out = 7'b0000110; // E 4'b1111: data_out = 7'b0001110; // F default: data_out = 7'b1111111; endcase end endmodule |
|
|
|
LIBRARY IEEE ;
USE IEEE.STD_LOGIC_1164.ALL ; ENTITY DECL7S IS PORT ( A : IN STD_LOGIC_VECTOR(3 DOWNTO 0); LED7S : OUT STD_LOGIC_VECTOR(6 DOWNTO 0) ) ; END ; ARCHITECTURE one OF DECL7S IS BEGIN PROCESS( A ) BEGIN CASE A IS WHEN "0000" => LED7S <= "0111111" ; WHEN "0001" => LED7S <= "0000110" ; WHEN "0010" => LED7S <= "1011011" ; WHEN "0011" => LED7S <= "1001111" ; WHEN "0100" => LED7S <= "1100110" ; WHEN "0101" => LED7S <= "1101101" ; WHEN "0110" => LED7S <= "1111101" ; WHEN "0111" => LED7S <= "0000111" ; WHEN "1000" => LED7S <= "1111111" ; WHEN "1001" => LED7S <= "1101111" ; WHEN "1010" => LED7S <= "1110111" ; WHEN "1011" => LED7S <= "1111100" ; WHEN "1100" => LED7S <= "0111001" ; WHEN "1101" => LED7S <= "1011110" ; WHEN "1110" => LED7S <= "1111001" ; WHEN "1111" => LED7S <= "1110001" ; WHEN OTHERS => NULL ; END CASE ; END PROCESS ; END ; 为什么这个程序和楼上那个程序显示译码完全不同 |
|
|
|
这是由你的硬件电路决定的,这个要看你的数码管是共阴还是共阳。区别在于共阴时为1的时候亮,为零不亮。共阳恰好相反。所以你的两组数据不同,但是都能显示。 |
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
1693 浏览 1 评论
1447 浏览 0 评论
矩阵4x4个按键,如何把识别结果按编号01-16(十进制)显示在两个七段数码管上?
1661 浏览 0 评论
943 浏览 0 评论
2451 浏览 0 评论
1507 浏览 38 评论
5706 浏览 113 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-30 07:27 , Processed in 0.663214 second(s), Total 85, Slave 66 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号