eda课程设计-gsm通讯机的vhdl设计及仿真(编辑修改稿)内容摘要:

ype rece_state is(R0,R1,R2)。 begin send:process(CLK_UART) variable samp: integer range 0 to 16:=0。 variable temp: std_logic_vector(7 downto 0)。 variable t: integer range 0 to 8:=0。 variable sp_state:send_state。 begin if (CLK_UART39。 event and CLK_UART=39。 139。 ) then case sp_state is when S1 = txd=39。 139。 samp:=0。 if SEND_MARK=39。 139。 then sp_state:=S2。 else sp_state:=S1。 end if。 when S2 = temp:=DATA_IN。 txd=39。 039。 samp:=samp+1。 if samp=16 then samp:=0。 t:=0。 sp_state:=S3。 else sp_state:=S2。 end if。 when S3 = txd=temp(0)。 samp:=samp+1。 if samp=16 then samp:=0。 temp:=39。 039。 amp。 temp(7 downto 1)。 t:=t+1。 沈 阳 大 学 课程设计说明书 if t=8 then sp_state:=S4。 else sp_state:=S3。 end if。 end if。 when S4 = txd=39。 139。 samp:=samp+1。 if samp=15 then samp:=0。 sp_state:=S1。 end if。 when others= sp_state:=S1。 end case。 end if。 end process send。 receive:process(CLK_UART) variable rp_state:rece_state。 variable reg: std_logic_vector(7 downto 0)。 variable t: integer range 0 to 16。 variable count: integer range 0 to 8。 begin if CLK_UART39。 event and CLK_UART=39。 139。 then case rp_state is when R0= RECE_MARK=39。 039。 reg:=(others=39。 039。 )。 if RXD=39。 039。 then t:=t+1。 if t=8 then rp_state:=R1。 end if。 else t:=0。 end if。 when R1= t:=t+1。 if t=16 then t:=0。 end if。 if t=8 then reg:=RXDamp。 reg(7 downto 1)。 沈 阳 大 学 课程设计说明书 count:=count+1。 if count=8 then count:=0。 t:=0。 rp_state:=R2。 end if。 end if。 when R2= DATA_OUT=reg(7 downto 0)。 RECE_MARK=39。 139。 t:=t+1。 if t=16 then t:=0。 rp_state:=R0。 end if。 when others= rp_state:=R0。 end case。 end if。 end process receive。 end architecture。 将以上程序写入 MAX+pluwe2 中进行编译仿真,可得如下结果。 图 6 uart_withoutParity 元件图 沈 阳 大 学 课程设计说明书 图 7 对 uart_withoutParity 程序仿真图 模块 4VGA接口 VGA 模块由 3 个子模块组成,分别是 CONTENT、 VGA、 VGA_DIV, 其中VGA_DIV 模块将显示器分割成 20*15 个小块 , VGA 模块输出信号至显示器 ,CONTENT 模块包含了所要显示的内容,还包括了键盘按键的判断 、 UART 的缓存数据,还是整个系统主要的状 态控制器。 将这 3个模块用 ponent语句进行例化,生成 VGA_interface 模块,再在顶层的 Block Diagram 文件进行调用,减少了顶层文件连线的复杂性。 VGA的 VHDL 源代码如下: library ieee。 use。 entity VGA is port( CLK_VGA:in std_logic。 HS,VS:out std_logic。 RGB:out std_logic_vector (2 downto 0)。 RGB_DATA:in std_logic_vector (2 downto 0)。 RGB_H:inout std_logic。 RGB_V:inout std_logic)。 end entity。 architecture VGA_DIS of VGA is signal h_t:integer range 0 to 800 :=0。 sig。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。