2015年12月23日 星期三

12/23(三) 期末上機考-NOR

module top;

wire A, B, C, D,NA,NB,NC,ND, NF, F, F1, F2, F3, F4;
system_clock #800 clock1(A);
system_clock #400 clock2(B);
system_clock #200 clock3(C);
system_clock #100 clock4(D);

nor S1(NA, A, A);
nor S2(NB, B, B);
nor S3(NC, C, C);
nor S4(ND, D, D);

nor C1(F1,A,B,C);
nor C2(F2,A,NB,ND);
nor C3(F3,NA,NB,NC,D);
nor C4(F4,NA,B,NC);

nor o1(NF,F4,F2,F3,F1);
nor o2(F ,NF,NF);
endmodule

module system_clock(clk);
parameter PERIOD=100;
output clk;
reg clk;

initial clk=0;

always
 begin
#(PERIOD/2) clk=~clk;
 end

always@(posedge clk)
 if($time>1000)$stop;

endmodule

2015年12月2日 星期三

12/2 課堂實作-期末上機考模擬(第一個)

module top;

wire A, B, C, D, NA, NB, NC, ND, F1, F2, F3, F4, F;
system_clock #800 clock1(A);
system_clock #600 clock2(B);
system_clock #400 clock2(C);
system_clock #200 clock2(D);
not a1(OUT, NA, A);
not a2(OUT, NB, B);
not a3(OUT, NC, C);
not a4(OUT, ND, D);

and a5(F4,  A,  NC, ND);
and a6(F2, NA,  NB,  D);
and a7(F3,  B,  NC, ND);
and a8(F1,  C,  D     );

or  a9(F,F1,F2,F3,F4);

endmodule

module system_clock(clk);
parameter PERIOD=100;
output clk;
reg clk;

initial clk=0;

always
 begin
#(PERIOD/2) clk=~clk;
 end

always@(posedge clk)
 if($time>10000)$stop;

endmodule

2015年11月25日 星期三

三位元加法器 結構模式

module top;
wire Cin,A1,B1,A2,B2,A3,B3,Cout1,Cout2,Cout3,Sum1,Sum2,Sum3;
system_clock #6400 clock1(Cin);
system_clock #3200 clock1(A3);
system_clock #1600 clock1(B3);
system_clock #800  clock1(A2);
system_clock #400  clock1(B2);
system_clock #200  clock2(A1);
system_clock #100  clock3(B1);
adder1 M1(Cin,A1,B1,A2,B2,A3,B3,Cout1,Cout2,Cout3,Sum1,Sum2,Sum3);
endmodule

module adder1(Cin,A1,B1,A2,B2,A3,B3,Cout1,Cout2,Cout3,Sum1,Sum2,Sum3);
output Cout1,Sum1,Cout2,Cout3,Sum2,Sum3;
input A1,B1,A2,B2,A3,B3,Cin;
and I1  (A1andB1, A1, B1);
xor I2  (A1xorB1, A1, B1);
and I3  (And1, A1xorB1, Cin);
 or I4  (Cout1, A1andB1, And1);
xor I5  (Sum1, A1xorB1, Cin);

and I6   (A2andB2, A2, B2);
xor I7   (A2xorB2, A2, B2);
and I8   (And2, A2xorB2, Cout1);
 or I9    (Cout2, A2andB2, And2);
xor I10 (Sum2, A2xorB2, Cout1);


and I11 (A3andB3, A3, B3);
xor I12 (A3xorB3, A3, B2);
and I13 (And3, A3xorB3, Cout2);
 or I14 (Cout3, A3andB3, And3);
xor I15 (Sum3, A3xorB3, Cout2);
endmodule

module system_clock(clk);
parameter PERIOD=100;
output clk;
reg clk;
initial clk=0;
always
begin
#(PERIOD/2) clk=~clk;
end
always@(posedge clk)
if($time>100000)$stop;
endmodule

三位元全加法器 行為模式

module fulladder (sum, c_out, a, b, c_in);
wire s1, c1, c2;
output sum;
output c_out;
input a, b, c_in;

assign{c_out,sum}=a+b+c_in;
endmodule

module adder3(sum, c_out, a, b, c_in);
wire [2:0] c;
output [2:0] sum;
output c_out;
input [2:0] a;
input [2:0] b;
input c_in;
fulladder fa1(sum[0], c[1], a[0], b[0], c_in) ;
fulladder fa2(sum[1], c[2], a[1], b[1], c[1]) ;
fulladder fa3(sum[2], c_out, a[2], b[2], c[2]) ;


endmodule

module main;
reg [2:0] a;
reg [2:0] b;
wire [2:0] sum;
wire c_out;

adder3 DUT (sum, c_out, a, b, 1'b0);

initial
begin
  a = 4'b0101;
  b = 4'b0000;
end

always #50 begin
  b=b+1;
  $monitor("%dns monitor: a=%d b=%d sum=%d", $stime, a, b, sum);
end

initial #2000 $finish;

endmodule

2015年11月18日 星期三

一位元全加法器-2

module top;

wire A, B, Cin, c1, c2, c3, sum, Cout;
system_clock #400 clock1(Cin);
system_clock #200 clock2(A);
system_clock #100 clock3(B);

xor(c1, A, B);
and(c2, A, B);
xor(sum, c1, Cin);
and(c3, c1, Cin);
xor(Cout, c3, Cin);

endmodule

module system_clock(clk);
parameter PERIOD=100;
output clk;
reg clk;

initial clk=0;

always
 begin
#(PERIOD/2) clk=~clk;
 end

always@(posedge clk)
 if($time>1000)$stop;

endmodule

一位元全加法器

module test_adder1;

 reg a,b;
 reg carry_in ;
 wire sum;
 wire carry_out;

 adder1_behavorial A1(carry_out, sum, a, b, carry_in);

 initial
  begin

    carry_in = 0; a = 0; b = 0;
    # 100 if ( carry_out != 0 | sum !== 0)
                $display(" 0+0+0=00 sum is WRONG!");
              else
                $display(" 0+0+0=00 sum is RIGHT!");
    carry_in = 0; a = 0; b = 1;
    # 100 if ( carry_in!= 0 | sum !== 1)
               $display(" 0+0+1=01 sum is WRONG!");
              else
               $display(" 0+0+1=01 sum is RIGHT!");
    carry_in = 0; a = 1; b = 0;
    # 100 if ( carry_in!= 0 | sum !== 1)
               $display(" 0+1+0=01 sum is WRONG!");
              else
               $display(" 0+1+0=01 sum is RIGHT!");
    carry_in = 0; a = 1; b = 1;
    # 100 if ( carry_in != 1 | sum !== 0)
                $display(" 0+1+1=10 sum is WRONG!");
              else
                $display(" 0+1+1=10 sum is RIGHT!");
    carry_in = 1; a = 0; b = 0;
    # 100 if ( carry_in!= 0 | sum !== 1)
               $display(" 1+0+0=01 sum is WRONG!");
              else
               $display(" 1+0+0=01 sum is RIGHT!");
     carry_in = 1; a = 0; b = 1;
    # 100 if ( carry_in != 1 | sum !== 0)
                $display(" 1+0+1=10 sum is WRONG!");
              else
                $display(" 1+0+1=10 sum is RIGHT!");
    carry_in = 1; a = 1; b = 0;
    # 100 if ( carry_in != 1 | sum !== 0)
               $display(" 1+1+0=10 sum is WRONG!");
              else
               $display(" 1+1+0=10 sum is RIGHT!");
    carry_in = 1; a = 1; b = 1;
    # 100 if ( carry_in != 1 | sum !== 1)
               $display(" 1+1+1=11 sum is WRONG!");
              else
               $display(" 1+1+1=11 sum is RIGHT!");
    $finish;
  end
endmodule



module adder1_behavorial (carry_out, sum, a, b, carry_in);
 input a, b, carry_in;
 output carry_out, sum;
  assign sum = (~a&b&~carry_in)|(~carry_in&a&~b)|(a&b&carry_in)|(a&b&carry_in);
  assign carry_out = a&carry_in|a&b|b&carry_in;
endmodule

2015年10月28日 星期三

                                                                       10/28課堂實作 


10/21 課堂實作,做不完>< 

2015年10月14日 星期三





                                                         10/14 課堂上---實做!!! 繼續努力、加油!!!

2015年9月30日 星期三

Verilog


9/30實作-今天努力的成果,雖然還是有點聽不太懂啦... 不過繼續加油囉!!!

2015年9月23日 星期三

CIC

國家晶片系統設計中心為協助學術界快速了解本中心所開發之各項設計流程、環境與平台技術,因此將各類之設計環境與平台,逐步建立技術文件,文件內容除說明本中心所提供之相關流程及平台外,同時將彙整相關技術論文與報告,以便師生快速了解與取得所需參考資料,歡迎各位教授及學生多加利用。 目前本中心已針對現有CMOS MEMS、RFIP及Cell-Based Design Flow等設計環境及平台,整理出四篇技術文件,可供學術界參考與引用,未來將再針對其他流程或平台,陸續整理相關之技術文件。茲因資料收集及網頁建置尚未完成,目前僅開放下列三篇技術文件可透過網頁下載,這四篇技術文件篇名如下所示。 國家晶片系統設計中心為收集與評估學術界運用本中心技術服務之效益,因此敬請各位教授及同學如使用本中心各項設計流程、研發平台及量測服務,所產出之相關論文應依其所使用之環境或平台,將下列相關之技術文件,加入論文之參考文獻(References)中。這些引用中心技術文件之論文,也將同時加入各位教授在本中心的Paper Credit紀錄中。未來這些技術文件被引用的次數,將成為本中心重要的績效指標之一,敬請各位予以支持,謝謝。 編號 論文名稱 出版日期 版本 論文作者 檔案下載 CIC-CID-RD-08-01 The CIC CMOS MEMS Design Platform for Heterogeneous Integration 2008/04 V.1.0 晶片組 PDF CIC-CID-RD-08-02 The Re-designable RFIP Methodology Using Full Custom Flow 2008/04 V.1.0 晶片組 PDF CIC-DSD-RD-08-01 CIC Referenced Flow for Cell-based IC Design 2008/05 V.1.0 設服組 PDF CIC-DSD-RD-08-02 CIC Referenced Flow for Mixed-signal IC Design 2010/11 V.1.0 設服組 PDF 國家晶片系統設計中心技術文件引用範例如下: References [1] The CIC CMOS MEMS Design Platform for Heterogeneous Integration, Technical Report, CIC-CID-RD-08-01, V1.0, National Chip Implementation Center, Hsinchu, Taiwan, April, 2008. [2] The Re-designable RFIP Methodology Using Full Custom Flow, Technical Report, CIC-CID-RD-08-02, V1.0, National Chip Implementation Center, Hsinchu, Taiwan, April, 2008. [3] CIC Referenced Flow for Cell-based IC Design, Technical Report, CIC-DSD-RD-08-01, V1.0, National Chip Implementation Center, Hsinchu, Taiwan, May, 2008. [4] CIC Referenced Flow for Mixed-signal IC Design, Technical Report, CIC-DSD-RD-08-02, National Chip Implementation Center, Hsinchu, Taiwan, 2008.

AMD

AMD於森尼韋爾的公司總部超微半導體公司(英語:Advanced Micro Devices, Inc.,縮寫:AMD)是一家專注於微處理器與圖形處理器設計和生產的跨國公司,總部位於美國加州舊金山灣區矽谷內的森尼韋爾市[1]。 AMD為電腦、通信及消費電子市場供應各種積體電路產品,其中包括中央處理器、圖形處理器、快閃記憶體、晶片組以及其他半導體技術。公司的主要設計及研究所位於美國和加拿大,主要生產設施位於德國,還在新加坡、馬來西亞和中國等地設有測試中心。AMD於2006年7月24日併購ATi後,成為一家同時擁有中央處理器和圖形處理器等生產技術的半導體公司,也是唯一可與英特爾和輝達匹敵的廠商,在2010年第二季全球個人電腦中央處理器的市場佔有率中,英特爾以80.7%排名第一、AMD以19.0%位居第二,而威盛電子則佔0.3%[2]。 收購ATI前的AMD,其主要產品是中央處理器,在其K7處理器中期之後,CPU特點是以較低的核心時脈頻率產生相對上較高的運算效率,也開始使用PR值來標定產品效能。但低階Duron仍以時脈標定,而且其主頻通常會比同效能的英特爾中央處理器低1GHz左右。自從Athlon XP上市以來,AMD與Intel的技術差距逐漸縮小。 2003年時AMD搶先於Intel之前發表具有64位元的Athlon 64,使得AMD的技術已經與Intel相當,或甚至在某些方面已經領先於Intel。2005年4月22日,AMD領先於Intel率先發行擁有兩個核心的Opteron處理器(當然還是遠遠落後於國際商業機器股份有限公司(IBM)於2001年發行的POWER4雙核處理器),隨後又推出面向主流消費市場的Athlon 64 X2。而由於兩家廠商目前都已以多核心系統作為新產品的開發主軸,使得AMD的Athlon 64 FX-57 2.8GHz成為世界上效能最高的零售單核心中央處理器。2010年底,AMD推出繪圖晶片與處理晶片合二為一的AMD Fusion晶片,亦即是「加速處理器」(Accelerated Processing Unit,簡稱「APU」),獲得PC業界不少生產廠家採用,包括惠普、宏碁及Sony等等。 現在AMD也推出Steamroller架構的APU處理器來與Intel Haswell微架構其中中低價位的處理器競爭,在主流效能級則推出幾款依照舊有Piledriver架構的FX處理器來與Intel Haswell微架構中主流效能級的處理器競爭。



第一次上課...有點聽不懂...哈哈~