2008年10月27日 星期一
Verilog 期中考
Verilog 期中考筆試
◎ 11月3日(星期一)
◎ 第九節(pm5:20~6:10)
◎ 地點:H344
(缺考一律0分計算)
◎ 監考人員:老師+2位助教
◎ 考試注意事項:
1.同學四周一公尺內出現與考試相關資料,視同夾帶
2.目光停留在別人的考卷上超過3秒 視同偷窺
3.不可使用計算機 參考書籍
2008年10月6日 星期一
homework
Design a verilog model of a half adder and write a testbench to verify the designed verilog model.
p9. 半加法器設計電路
module Add_half(sum,c_out,a,b);
input a,b;
output sum,c_out;
wire c_out_bar;
xor (sum,a,b);
nand (c_out_bar,a,b);
not(c_out,c_out_bar);
endmodule
module test;
reg a,b;
wire sum,c_out;
Add_half U0 (sum,c_out,a,b);
initial
begin a = 0;b=0;
#10 a =0; b = 1;
#10 a =1; b = 0;
#10 a =1; b = 1;
#10 $finish;
end
endmodule
p9. 半加法器設計電路
module Add_half(sum,c_out,a,b);
input a,b;
output sum,c_out;
wire c_out_bar;
xor (sum,a,b);
nand (c_out_bar,a,b);
not(c_out,c_out_bar);
endmodule
module test;
reg a,b;
wire sum,c_out;
Add_half U0 (sum,c_out,a,b);
initial
begin a = 0;b=0;
#10 a =0; b = 1;
#10 a =1; b = 0;
#10 a =1; b = 1;
#10 $finish;
end
endmodule
Design Flow
Design Flow
module top ;
wire a , b ;
reg c ;
system_clock #100 clock 1 (a) ;
system_clock #50 clock 2 (b) ;
always #1 c = a & b; //延遲1個時間單位
endmodule
module system_clock (clk) ;
parameter PERIOD=100 ;
output clk ;
reg clk ;
initial
clk=0 ;
always
begin
#(PERIOD/2) clk = ~clk ;
#(PERIOD/2) clk = ~clk ;
end
always @ (posedge clk)
if ($ time > 1000)
#(PERIOD-1) $stop ;
endmodule

module top ;
wire a , b ;
reg c ;
system_clock #100 clock 1 (a) ;
system_clock #50 clock 2 (b) ;
always #1 c = a & b; //延遲1個時間單位
endmodule
module system_clock (clk) ;
parameter PERIOD=100 ;
output clk ;
reg clk ;
initial
clk=0 ;
always
begin
#(PERIOD/2) clk = ~clk ;
#(PERIOD/2) clk = ~clk ;
end
always @ (posedge clk)
if ($ time > 1000)
#(PERIOD-1) $stop ;
endmodule
Verilog 硬體描述語言
◎課堂計分方式:
期中考:30%
期末考:30%
平時:40% (出席、上機考、期末報告)
◎課堂內容:
1. 請同學到 http://www.blogger.com 申請一個部落格
2. 請同學到 http://dyu9502.blogspot.com 留下個人(姓)名、學號和申請個人部落格網址
◎參考教科書籍:
Michal D. Ciletti , "Modeling , Synthesis , and Rapid Prototyping with the Verilog HDL"
ISBN-0-13-977398-3
訂閱:
意見 (Atom)
