2013年11月30日 星期六
FPGA系統設計實務 (2/6)
FPGA系統設計實務 (2/6)
http://www.4shared.com/web/preview/doc/gsQDrlC2?
This lab illustrates the use of divide-by-N counters, decimal counters, and a simple hex counter.
http://www.4shared.com/zip/kqTF1RC_/diglab2.html
Parity Encoder using conditional operator , using if else statement
// File : Parity Encoder using conditional operator.v
module parity_encoder ( din ,dout );
output [2:0] dout ;
wire [2:0] dout ;
input [7:0] din ;
wire [7:0] din ;
assign dout = din[7] ? 0 :
din[6] ? 1 :
din[5] ? 2 :
din[4] ? 3 :
din[3] ? 4 :
din[2] ? 5 :
din[1] ? 6 :
din[0] ? 7 : 1'bzzz ;
endmodule
// File : Parity Encoder using if else statement.v
module parity_encoder ( din ,dout );
output [2:0] dout ;
reg [2:0] dout ;
input [7:0] din ;
wire [7:0] din ;
always @ (din) begin
if (din[7])
dout = 0;
else if (din[6])
dout = 1;
else if (din[5])
dout = 2;
else if (din[4])
dout = 3;
else if (din[3])
dout = 4;
else if (din[2])
dout = 5;
else if (din[1])
dout = 6;
else if (din[0])
dout = 7;
else
dout = 3'bZZZ;
end
endmodule
module parity_encoder ( din ,dout );
output [2:0] dout ;
wire [2:0] dout ;
input [7:0] din ;
wire [7:0] din ;
assign dout = din[7] ? 0 :
din[6] ? 1 :
din[5] ? 2 :
din[4] ? 3 :
din[3] ? 4 :
din[2] ? 5 :
din[1] ? 6 :
din[0] ? 7 : 1'bzzz ;
endmodule
// File : Parity Encoder using if else statement.v
module parity_encoder ( din ,dout );
output [2:0] dout ;
reg [2:0] dout ;
input [7:0] din ;
wire [7:0] din ;
always @ (din) begin
if (din[7])
dout = 0;
else if (din[6])
dout = 1;
else if (din[5])
dout = 2;
else if (din[4])
dout = 3;
else if (din[3])
dout = 4;
else if (din[2])
dout = 5;
else if (din[1])
dout = 6;
else if (din[0])
dout = 7;
else
dout = 3'bZZZ;
end
endmodule
訂閱:
文章 (Atom)
清除項目編譯快取 執行 flutter clean 重新取得套件依賴 執行 flutter pub get 完整重新編譯並執行 flutter run 1. 新增專案套件 (pubspec.yaml) 在 Flutter 專案根目錄下的 pubspec.yaml 中,新增 ...
-
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 ’ 不是內部或外部命令、可執行的程式或批...
-
課程講義 下載 11/20 1) PPT 下載 + 程式下載 http://www.mediafire.com/file/cru4py7e8pptfda/106%E5%8B%A4%E7%9B%8A2-1.rar 11/27 2) PPT 下載...















































