代码很简单
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
ENTITY LED_SW IS
PORT(
SW :IN STD_LOGIC_VECTOR(7 DOWNTO 0);
LED :OUT STD_LOGIC_VECTOR(7 DOWNTO 0)
);
end entity;
architecture one OF LED_SW IS
BEGIN
LED<=SW;
END one;
代码很简单
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
ENTITY LED_SW IS
PORT(
SW :IN STD_LOGIC_VECTOR(7 DOWNTO 0);
LED :OUT STD_LOGIC_VECTOR(7 DOWNTO 0)
);
end entity;
architecture one OF LED_SW IS
BEGIN
LED<=SW;
END one;
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
ENTITY SEG7 IS
PORT (
SW :IN STD_LOGIC_VECTOR(3 DOWNTO 0);
EN :IN STD_LOGIC;
SEG :OUT STD_LOGIC_VECTOR(7 DOWNTO 0);
DIG :OUT STD_LOGIC
);
END ENTITY;
ARCHITECTURE ONE OF SEG7 IS
BEGIN
PROCESS(SW)
BEGIN
CASE SW IS
WHEN "1111" => SEG <= "11000000";--0
WHEN "1110" => SEG <= "11111001";--1
WHEN "1101" => SEG <= "10100100";--2
WHEN "1100" => SEG <= "10110000";--3
WHEN "1011" => SEG <= "10011001";--4
WHEN "1010" => SEG <= "10010010";--5
WHEN "1001" => SEG <= "10000010";--6
WHEN "1000" => SEG <= "11111000";--7
WHEN "0111" => SEG <= "10000000";--8
WHEN "0110" => SEG <= "10010000";--9
WHEN "0101" => SEG <= "11001000";--A
WHEN "0100" => SEG <= "10000011";--B
WHEN "0011" => SEG <= "11000110";--C
WHEN "0010" => SEG <= "10100001";--D
WHEN "0001" => SEG <= "10000110";--E
WHEN "0000" => SEG <= "10001110";--F
WHEN OTHERS => SEG <= "11111111";--
END CASE;
END PROCESS; --enable
DIG<=EN;
END ONE;
有奖活动 | |
---|---|
【有奖活动】分享技术经验,兑换京东卡 | |
话不多说,快进群! | |
请大声喊出:我要开发板! | |
【有奖活动】EEPW网站征稿正在进行时,欢迎踊跃投稿啦 | |
奖!发布技术笔记,技术评测贴换取您心仪的礼品 | |
打赏了!打赏了!打赏了! |
打赏帖 | |
---|---|
【换取逻辑分析仪】自制底板并驱动ArduinoNanoRP2040ConnectLCD扩展板被打赏47分 | |
【分享评测,赢取加热台】RISC-V GCC 内嵌汇编使用被打赏38分 | |
【换取逻辑分析仪】-基于ADI单片机MAX78000的简易MP3音乐播放器被打赏48分 | |
我想要一部加热台+树莓派PICO驱动AHT10被打赏38分 | |
【换取逻辑分析仪】-硬件SPI驱动OLED屏幕被打赏36分 | |
换逻辑分析仪+上下拉与多路选择器被打赏29分 | |
Let'sdo第3期任务合集被打赏50分 | |
换逻辑分析仪+Verilog三态门被打赏27分 | |
换逻辑分析仪+Verilog多输出门被打赏24分 | |
【分享评测,赢取加热台】使用8051单片机驱动WS2812被打赏40分 |