# Module ###### tags: `Digital IC Design` [回到主頁面](https://hackmd.io/@derek8955/BkK2Nb5Jo/https%3A%2F%2Fhackmd.io%2FdpcBlBL8TlShpQ-wSi9Quw) ```verilog= // verilog 的架構 module 模組名稱( 輸出入埠名稱 ); // 01 輸出入埠 敘述 // 02 資料型態 敘述 // 03 內部電路 敘述 endmodule // 一個簡單的 2對1多工器 module buffer( out, a, b, sel ); // 01 輸出入埠敘述 input a, b, sel; output out; // 02 資料型態 敘述 wire out; // 03 內部電路 敘述 assign out = ( sel )? a : b ; endmodule // 這邊看不懂沒關係,先大概知道整體架構 ``` |![](https://i.imgur.com/Lazb6lp.jpg)| |:---:| |Hierarchical design(including many of submodule) & module definition | - 好的電路會呈現階層式的架構,將每個 sub module( CPU、Memory...等 )拼拼湊湊整合成一個 top module。 - Module 與 Module 之間的溝通,再透過每個 module 自身的 ports( input or output )互相連接,已達到資料傳遞的目的