2008年10月20日 星期一

練習三

module nanf201 (0,A1,B1);
 input A1,B1;
 output 0;
  nand (0,A1,B1);
  specify
   specparam
    Tpd_0_1=1.13:3.09:7.75;
    Tpd_1_0=0.93:2.5:7.34;
    (A1=>0)=(Tpd_0_1,Tpd_1_0);
    (B1=>0)=(Tpd_0_1,Tpd_0_1);
   endspecify
endmodule

2008年10月13日 星期一

作業二之二

module Add_full(sum,c_out,a,b,c_in);
 input a,b,c_in;
 output sum_c_out;
 wire w1,w2,w3;
 Add_half M1(w1,w2,a,b);
 Add_half M2(sum,w3,w1,c_in);
 or(c_out,w2,w3);
endmodale

作業二

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

2008年10月6日 星期一

練習一

module top ;
 wire a,b ;
 reg c ;
 system_clock #100 clock1 (a) ;
 system_clock #50 clock2 (b) ;
 always
  #1 c=a&b ;
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

教科用書

Michael D. Ciletti ,"Modeling,Synthesis,and Rapid Prototyping with the Verilog HDL", Prentice-Hall,Inc.1999, ISBN 0-13-977398-3 國內代理:高立圖書