Verilog HDL Program for Johnson Counter (10bits)
//declare the Verilog module - The inputs and output port names.
module johnson_cnt_10(clock,reset,q);
input clock;
input reset;
output [9:0] q;
reg[9:0] a;
always @(posedge clock)
if (reset)
a = 10'b0000000001;
else
begin
a <= a<<1; // Notice the blocking assignment
a[0]<=a[9];
end
assign q = a;
endmodule
// 時間單位 1ns, 時間精確度10ps
`timescale 1ns / 1ps
module Test_bench;
// Inputs
reg clock;
reg reset;
// Outputs
wire[9:0] q;
// Instantiate the Unit Under Test (UUT)
johnson_cnt_10 UUT (
.clock(clock),
.reset(reset),
.q(q)
);
always #10 clock = ~clock;
initial begin
// Initialize Inputs
clock = 0;
reset = 0;
#5 reset = 1;
#20 reset = 0;
#300 $finish;
end
initial begin
$monitor($time, " clock=%1b,reset=%1b,q=%4b",clock,reset,q);
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 - 停止定時回報 /...




沒有留言:
張貼留言