Ch01 Introduction

10/31/2022 FPGAVHDL

# Introduction

image-20221031174138851

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
--use IEEE.NUMERIC_STD.ALL;

-- Uncomment the following library declaration if instantiating
-- any Xilinx leaf cells in this code.
--library UNISIM;
--use UNISIM.VComponents.all;

entity led is
Port(
     switch_1 : in std_logic;
     switch_2 : in std_logic;
     led_1: out std_logic;
     led_2: out std_logic
);
--  Port ( );
end led;

architecture Behavioral of led is

begin
led_1 <= switch_1;
led_2 <= switch_2;

end Behavioral;

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

architecture中的语句都是并行(同时)执行,不是顺序执行

image-20221102204415325image-20221102204443680image-20221102204516779

  • 横坐标和纵坐标同时assign,看最后的结果是什么

# signalimage-20221102210022769image-20221102210214915

image-20221031231405497

image-20221101165635350

# When

image-20221101170141844

# With select

image-20221101171013553

Last Updated: 11/19/2024, 1:54:38 PM