數位IC設計入門-Verilog combinational logic
Full subtractor 全減器 Behavioral Modeling (& Test Bench)
//數位IC設計入門-Verilog combinational logic
//Full subtractor 全減器 Behavioral Modeling (& Test Bench)
// a = 被減數 b=減數 前一級借位 difference=差 , borrow=借位
module FS (a, b, c, difference, borrow);
input a, b, c;
output difference, borrow;
reg difference, borrow;
always@(a or b or c)
begin
{borrow, difference} = a - b - c;
end
endmodule
// 時間單位 100ns, 時間精確度100 ps
`timescale 100ns/100ps
module Test_bench;
// a = 被減數 b=減數 前一級借位 difference=差 , borrow=借位
//module FS (a, b, c, difference, borrow);
//input a, b ,c ;
//output difference, borrow;
// Inputs
reg a=0 ,b=0 ,c=0 ;
// Outputs
wire difference, borrow;
// Instantiate the Unit Under Test (UUT)
//module HS (a, b, difference, borrow);
FS UUT(a, b,c, difference, borrow);
initial begin
$monitor(a, b,c, difference, borrow);
// Initialize Inputs
#25 a=0 ; b=0 ; c=1 ;
#25 a=0 ; b=1 ; c=0 ;
#25 a=0 ; b=1 ; c=1 ;
#25 a=1 ; b=0 ; c=0 ;
#25 a=1 ; b=0 ; c=1 ;
#25 a=1 ; b=1 ; c=0 ;
#25 a=1 ; b=1 ; c=1 ;
end
initial
begin
#200; // 模擬終止時間 200 ns
$stop;
end
endmodule
訂閱:
張貼留言 (Atom)
MIFARE Classic Command Flow Diagram
MIFARE Classic Command Flow Diagram 這個程式將圖片中的 MIFARE Classic Command Flow Diagram 完整繪製在畫布上(包含中英文對照、虛線錯誤返回路徑、實線流程箭頭以及右側的「典型交易時間」資訊),並提供「上一...
-
Line 發報機 Python TKinter (CONFIG_LINE Message API_2.py) import serial import serial.tools.list_ports import tkinter as tk from tkinter import...
-
課程講義 下載 11/20 1) PPT 下載 + 程式下載 http://www.mediafire.com/file/cru4py7e8pptfda/106%E5%8B%A4%E7%9B%8A2-1.rar 11/27 2) PPT 下載...
-
ESP32 DHT22 + Telegram Telegram Bot 指令列表 /start - 開始對話 /help - 指令說明 /status - 查詢目前溫濕度 /mute - 暫停變化通知 /resume - 恢復變化通知 /stopreport - 停止定時回報 /...

沒有留言:
張貼留言