首页 | 新闻 | 新品 | 文库 | 方案 | 视频 | 下载 | 商城 | 开发板 | 数据中心 | 座谈新版 | 培训 | 工具 | 博客 | 论坛 | 百科 | GEC | 活动 | 主题月 | 电子展
返回列表 回复 发帖

串口通信Verilog源程序(上)

串口通信Verilog源程序(上)

//-----------------------------------------------------

// Design Name : Uart

// File Name   : Uart.V

// Function    : Simple UART

// Coder       : Deepak Kumar Tala

//-----------------------------------------------------

Module Uart (

Reset          ,

Txclk          ,

Ld_tx_data     ,

Tx_data        ,

Tx_enable      ,

Tx_out         ,

Tx_empty       ,

Rxclk          ,

Uld_rx_data    ,

Rx_data        ,

Rx_enable      ,

Rx_in          ,

Rx_empty

);

// Port Declarations

Input        Reset          ;

Input        Txclk          ;

Input        Ld_tx_data     ;

Input [7:0] Tx_data        ;

Input        Tx_enable      ;

Output       Tx_out         ;

Output       Tx_empty       ;

Input        Rxclk          ;

Input        Uld_rx_data    ;

Output [7:0] Rx_data        ;

Input        Rx_enable      ;

Input        Rx_in          ;

Output       Rx_empty       ;

// Internal Variables

Reg [7:0]    Tx_reg         ;

Reg          Tx_empty       ;

Reg          Tx_over_run    ;

Reg [3:0]    Tx_cnt         ;

Reg          Tx_out         ;

Reg [7:0]    Rx_reg         ;

Reg [7:0]    Rx_data        ;

Reg [3:0]    Rx_sample_cnt ;

Reg [3:0]    Rx_cnt         ;

Reg          Rx_fRAMe_err   ;

Reg          Rx_over_run    ;

Reg          Rx_empty       ;

Reg          Rx_d1          ;

Reg          Rx_d2          ;

Reg          Rx_busy        ;
返回列表