EX5-12 有四隻狗, 其中第3隻狗 碰到任何一隻一定吵架 , 3隻狗 碰在一起一定會吵架
// Ch5.10 F(a,b,c,d) circuit
module EX10_7( a ,b, c, d, F);
input a ,b, c ,d; // 1位元輸入
output reg F ; // Output 1位元輸出
always@ ( a ,b, c, d) begin
case ({a,b,c,d})
4'b0000: F=1'b0;
4'b0001: F=1'b0;
4'b0010: F=1'b0;
4'b0011: F=1'b1;
4'b0100: F=1'b0;
4'b0101: F=1'b0;
4'b0110: F=1'b1;
4'b0111: F=1'b1;
4'b1000: F=1'b0;
4'b1001: F=1'b0;
4'b1010: F=1'b1;
4'b1011: F=1'b1;
4'b1100: F=1'b0;
4'b1101: F=1'b1;
4'b1110: F=1'b1;
4'b1111: F=1'b1;
endcase
end
endmodule
// 時間單位 100ns, 時間精確度100 ps
`timescale 100ns/100ps
module Test_bench;
// Inputs
reg a ,b, c ,d;
// Outputs
wire F ;
// Instantiate the Unit Under Test (UUT)
// ex5.10 F(a,b,c,d) circuit
EX10_7 UUT (
.a(a),
.b(b),
.c(c),
.d(d),
.F(F)
);
initial begin
$monitor( a ,b, c, d, F);
//Apply inputs
a=1'b0; b=1'b0; c=1'b0; d=1'b0;
#100;
{a,b,c,d}=4'b0001;
#100;
{a,b,c,d}=4'b0010;
#100;
{a,b,c,d}=4'b0011;
#100;
{a,b,c,d}=4'b0100;
#100;
{a,b,c,d}=4'b0101;
#100;
{a,b,c,d}=4'b0110;
#100;
{a,b,c,d}=4'b0111;
#100;
{a,b,c,d}=4'b1000;
#100;
{a,b,c,d}=4'b1001;
#100;
{a,b,c,d}=4'b1010;
#100;
{a,b,c,d}=4'b1011;
#100;
{a,b,c,d}=4'b1100;
#100;
{a,b,c,d}=4'b1101;
#100;
{a,b,c,d}=4'b1110;
#100;
{a,b,c,d}=4'b1111;
#100;
end
initial begin
#1600 $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 - 停止定時回報 /...

沒有留言:
張貼留言