基本概念(4/7) ■2选1多路选择器的VHDL描述 mux21a ENTITY mux2la Is PORT a, b: IN BIT S IN BIT 实体 y: OUT BIT) muw21a实体 END ENTITY mux2la aRChitectuRe one of mux2la Is BEGIN y<a WhEN S=0 Else 结构体m以21结构体 END ARCHITECTURE one
基本概念(4/7) 2选1多路选择器的VHDL描述 ENTITY mux21a IS PORT( a, b : IN BIT ; s : IN BIT; y : OUT BIT ) ; END ENTITY mux21a ; ARCHITECTURE one OF mux21a IS BEGIN y <= a WHEN s = '0' ELSE b ; END ARCHITECTURE one ; 实体 结构体
基本概念(5/7) ■实体( entity)说明的相关概念 类属参数说明 OUT 在端口说明前面; INOUT 设计实体 Figeneric(delay: time); LINKAGE BUFFER 端口说明 端口名,方向,数据类型 方向包括:输入(n):输出(out);:双向(inou) 缓冲(bufr);连接( linkage)
基本概念(5/7) 实体(entity)说明的相关概念 类属参数说明 在端口说明前面; 例generic (delay: time); 端口说明 端口名,方向,数据类型 方向包括: 输入(in);输出(out);双向(inout); 缓冲(buffer);连接(linkage). 设 计 实 体 IN INOUT LINKAGE OUT BUFFER
基本概念(6/7) 结构体( architecture)说明的相关概念 结构体是由一个或多个并行语句构成的,他们的书 写顺序并不代表他们的执行顺序 Entity testl Is Entity testl Is Port(a, b: in bit 输出只和输入有关 Port(a, b: in bit c, d: out bit) c, d: out bit) end testl end testl architecture testl body of testl is architecture testi body of testl is begin 并行执行 begin c<= a and b d=aor b d <=a or b c<=a and b end testl body end testl body 与顺序无关
基本概念(6/7) 结构体(architecture)说明的相关概念 结构体是由一个或多个并行语句构成的,他们的书 写顺序并不代表他们的执行顺序。 Entity test1 Is Port ( a, b : in bit; c, d : out bit); end test1; architecture test1_body of test1 is begin c <= a and b; d <= a or b; end test1_body; Entity test1 Is Port ( a, b : in bit; c, d : out bit); end test1; architecture test1_body of test1 is begin d <= a or b; c <= a and b; end test1_body; 并行执行 与顺序无关 输出只和输入有关
THE SAME a and b d <=a or b d <=a or b C<= a and b Name Value 1000ns bac C=A and B D=AOR B
THE SAME c <= a and b; d <= a or b; d <= a or b; c <= a and b; C = A and B D = A OR B
基本概念(7/7) n所有的进程语句( process)都是并行执行的 在一个进程语句中的代码是顺序执行的 ■进程语句的输出与输入以及敏感信号表的 事件发生有关:
基本概念(7/7 ) 所有的进程语句(process)都是并行执行的; 在一个进程语句中的代码是顺序执行的; 进程语句的输出 与输入以及敏感信号表 的 事件发生有关;