2014年6月3日 星期二

A Simple Design and-or-invert (AOI) gate in Verilog.

A Simple Design

 and-or-invert (AOI) gate in Verilog.

Verilog: an AOI gate module

// Verilog code for AND-OR-INVERT gate

module AOI (input A, B, C, D, output F);
  assign F = ~((A & B) | (C & D));
endmodule
// end of Verilog code

Comments

// Verilog code for AND-OR-INVERT gate

Module and Port declarations
module AOI (input A, B, C, D, output F);
port may correspond to a pin on an IC, an edge connector on a board, or any logical channel of communication with a block of hardware. The port declarations include the names of the ports ( e.g., AB ), and the direction that information is allowed to flow through the ports (inputoutput or inout).

Endmodule

endmodule
The module definition is terminated by the Verilog keyword endmodule.

Functionality


assign F = ~((A & B) | (C & D));
// end of Verilog code
Verilog 1995
The above example is written using Verilog-2001 syntax. 
Many people continue to use the 1995 syntax, which is still allowed in Verilog-2001. In Verilog-1995 the module header would look like this:
module AOI (A, B, C, D, F);
  input A, B, C, D;
  output F;

沒有留言:

張貼留言

WOKWI 超音波測距模組 HC-SR04 透過MQTT給 EasyBulider Tank 顯示液體高度

 WOKWI 超音波測距模組 HC-SR04 透過MQTT給   EasyBulider Tank  顯示液體高度 這段 Arduino C++ 程式碼適用於 ESP32 開發板,主要功能為:透過 NewPing 超音波感測器 測量液位/距離、將數據顯示於 I2C 1602 L...