Entity testl is Entity testl is Port( clk, d1, d2 in bit; ql, q2: out bit); Port( clk, dl, d2: in bit end testl q1, 92: out bit); architecture testl body of end test1 testl is 输出与有条件i architecture testI body of testI egIn Process(clk, dI 约束的输入有关 begin begin Process(clk, d2) begin if (clk'event and clk=1) then if (clk'event and clk='1) then ql <=dl end if: q2<=d2 该代码在进程endi 这两个进程 end process 语句中顺序执行 end process; 语句并行执行 Process(clk, d2) be Process(clk, a1) egIn if (clk'event and clk="1)then begin q2<=d2; if(clk'event and clk1)then end if q1<=d1 end if: end process end testi bod end process; end testI body
Entity te s t 1 is Port ( clk, d1, d 2 : in b it; q 1, q2 : out bit); end tes t1; archi tecture test1_body of tes t1 i s begin Process (clk, d1) begin if (cl k’even t a n d clk = ‘ 1’) then q1 <= d1; end i f; end proces s; Process (clk, d2) begin if (cl k’even t a n d clk= ‘1’) then q2 <= d2; end i f; end proces s; end tes t1_bod y; Entity test 1 is Port ( c l k, d1, d2 : in bi t; q1, q2 : o ut bit ); end tes t1; architecture test1_body of t est 1 is begin Process (clk, d2) begin if (cl k’even t a n d clk = ‘ 1’) then q2 <= d2; end i f; end proces s; Process (clk, d1) begin if (cl k’even t a n d clk= ‘1’) then q1 <= d1; end i f; end proces s; end test1_bod y; 这两个进程 语句并行执行 该代码在进程 语句中顺序执行 输出与有条件 约束的输入有关
Name value D clk q2 Process(clk, d1) Process(clk, d2 begin Degn if(clk'event and clk='1)then if(clk'event and clk='1)then ql<=d1; end if: end if: end process end pi roces 两个进程语句并行执行
Process (clk, d1) begin if (clk’event and clk = ‘1’) then q1 <= d1; end if; end process; Process (clk, d2) begin if (clk’event and clk = ‘1’) then q2 <= d2; end if; end process; 两个进程语句并行执行
HDL的数据对象、类型及运算符 ⅥHDL语言的数据对象 常量;变量;信号及文件: VHDL语言的数据类型 标量类型;复合类型及子类型; ■ⅥHDL语言的数据类型转换函数; VHDL语言的运算符 逻辑、算术、关系及并置运算符; VHDL语言的词法单元 注释、数字、字符及字符串、位串;
VHDL的数据对象、类型及运算符 VHDL语言的数据对象 常量;变量;信号及文件; VHDL语言的数据类型 标量类型;复合类型及子类型; VHDL语言的数据类型转换函数; VHDL语言的运算符 逻辑、算术、关系及并置运算符; VHDL语言的词法单元 注释、数字、字符及字符串、位串;
MHDL语言的数据对象(一) 常量 指在设计实体中不会发生变化的值; 可以是任何数据类型; n可以在很多部分进行说明 n说明的格式 Constant常量名:数据类型[:=表达式] 例 Constant width_temp: integer: =8 Constant vcc real :=33 Constant delay time: =10ns
VHDL语言的数据对象(一) 常量 指在设计实体中不会发生变化的值; 可以是任何数据类型; 可以在很多部分进行说明。 说明的格式 Constant 常量名: 数据类型 [:=表达式]; 例 Constant width_temp : integer :=8; Constant VCC : real := 3.3; Constant delay: time :=10ns;
HDL语言的数据对象(二) 口变量 主要用于对暂时数据进行局部储存; ■是一个局部变量,只能在进程语句、过程语 句、和函数语句的说明区域中加以说明; n变量的赋值是直接的、立即生效的; ■要将一个变量的值用于作用范围之外时,需 要将该变量的值赋给一个相同类型的信号; ■说明的格式 Variable变量名:数据类型[:≡表达式] Fi]: Variable temp: std_logic: =07
VHDL语言的数据对象(二) 变量 主要用于对暂时数据进行局部储存; 是一个局部变量,只能在进程语句、过程语 句、和函数语句的说明区域中加以说明; 变量的赋值是直接的、立即生效的; 要将一个变量的值用于作用范围之外时,需 要将该变量的值赋给一个相同类型的信号; 说明的格式 Variable 变量名: 数据类型 [:=表达式]; 例: Variable temp : std_logic := ‘0’;