數位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)
Cargo Transfer Process Simulation 「貨物轉移過程模擬」
Cargo Transfer Process Simulation「貨物轉移過程模擬」 https://www.youtube.com/watch?v=Ic9PpPG-_NU 以下是操作步驟: 打開 EasyBuilder Pro,選擇「新建專案」(New Project),...
-
數位IC設計入門-Verilog combinational logic 8 to 1 Multiplexer 多工器 Behavioral Modeling (& Test Bench) //數位IC設計入門-Verilog combinationa...
-
Line 發報機 Python TKinter (CONFIG_LINE Message API_2.py) import serial import serial.tools.list_ports import tkinter as tk from tkinter import...
-
python pip 不是内部或外部命令 -- 解決方法 要安裝 Pyqt5 1. 首先,開啟命令提示字元。 2. 輸入 pip3 install pyqt5 好像不能執行 ! ! 錯誤顯示 : ‘ pip3 ’ 不是內部或外部命令、可執行的程式或批...

沒有留言:
張貼留言