2015年12月2日 星期三

and/or/not, nand/nor

 module top;

wire A, B,C,D,A0,B0,C0,D0,out0,out1,out2,out3,F;
system_clock #800 clock0(A);
system_clock #400 clock1(B);
system_clock #200 clock2(C);
system_clock #100 clock3(D);

not a1(A0,A);
not a2(B0,B);
not a3(C0,C);
not a4(D0,D);
and a5(out0,A,C0,D0);
and a6(out1,A0,B0,D);
and a7(out2,B,C0,D0);
and a8(out3,C,D);
or a9(F,out0,out1,out2,out3);

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 top;

wire A, B,C,D,A0,B0,C0,D0,F,F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12;
system_clock #800 clock0(A);
system_clock #400 clock1(B);
system_clock #200 clock2(C);
system_clock #100 clock3(D);
nand (A0,A,A);
nand (B0,B,B);
nand (C0,C,C);
nand (D0,D,D);
nand na1(F1,A,C0,D0);
nand na2(F2,F1,F1);
nand na3(F3,D,A0,B0);
nand na4(F4,F3,F3);
nand na5(F5,B,C0,D0);
nand na6(F6,F5,F5);
nand na7(F7,C,D);
nand na8(F8,F7,F7);
nand (F9,F2,F2);
nand (F10,F4,F4);
nand (F11,F6,F6);
nand (F12,F8,F8);
nand (F,F9,F10,F11,F12);
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年11月25日 星期三

3位元全加法器(行為/結構)

 module test_adder1;

 reg [2:0]a,b;
 reg [2:0]carry_in ;
 wire [2:0]sum;
 wire [2:0]carry_out;

 adder1_behavorial A1(carry_out[0], sum[0], a[0], b[0], carry_in[0]);
 adder1_behavorial A2(carry_out[1], sum[1], a[1], b[1], carry_in[1]);
 adder1_behavorial A3(carry_out[2], sum[2], a[2], b[2], carry_in[2]);

 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_out != 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_out != 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_out != 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_out != 1 | sum !== 0)
                $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_out != 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_out != 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_out != 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

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日 星期三

11/18 一位元全加法器&行為模式


 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_out != 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_out != 0 | sum !== 0)
                $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_out != 0 | 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_out != 0 | sum !== 0)
                $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_out != 0 | 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_out != 0 | 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_out != 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

module fulladder (sum , c_out, a , b , c_in);

output sum,c_out;
input a, b, c_in;

wire s1,c1,c2 ;
and(cl, a,b) ;
xor(s1, a,b);
xor  (sum, s1, c_in) ;
and  (c2, s1, c_in) ;
or  (c_out, c2, c1) ;
endmodule

2015年11月4日 星期三

一.二位元多工器(行為模式)

module top;
  integer ia,ib,is;
  reg  a,b,s;
  wire out;

  mux_behavioral mux1(out,a,b,s);

  initial
    begin
      for (is=0; is<=1; is = is+1)
        begin
          s = is;
          for (ia=0; ia<=1; ia = ia + 1)
            begin
              a = ia;
              for (ib=0; ib<=1; ib = ib + 1)
               begin
                 b = ib;
                 #100 $display("a=%d b=%d s=%d   out=%d",a,b,s,out);
               end
            end
        end
    end
endmodule

module mux_behavioral(OUT, A, B, SEL);
 output OUT;
 input A,B,SEL;
 wire  A,B,SEL;
 reg    OUT;

  always @(A or B or SEL)
   OUT = (A & SEL)|(B & ~SEL );
endmodule


module top;  
integer is;
  integer ia[1:0],ib[1:0];
  reg [1:0]a,b;
  reg s;
  wire [1:0]out;

  mux_behavioral mux2(out,a,b,s);

  initial
    begin
      for (is=0; is<=1; is = is + 1)
       begin
        s = is;
         for (ia[0]=0; ia[0]<=1; ia[0] = ia[0]+1)
          begin
           a[0]= ia[0];
            for (ia[1]=0; ia[1]<=1; ia[1] = ia[1]+ 1)
             begin
              a[1] = ia[1];
               for (ib[0]=0; ib[0]<=1; ib[0] = ib[0]+1)
                 begin
                   b[0] = ib[0];
                    for (ib[1]=0; ib[1]<=1; ib[1] = ib[1]+ 1)
                     begin
                      b[1] = ib[1];
                 #1 $display("a[0]=%d a[1]=%d b[0]=%d b[1]=%d s=%d out[0]%d out[1]%d",a[0],a[1],b[0],b[1],s,out[0],out[1]);
                      end
                    end
                  end
              end
         end
    end
endmodule

module mux_behavioral(OUT,A,B,SEL);
 output [1:0]OUT;
 input [1:0] A,B;
 input SEL;

mux1 X1(OUT[0],A[0],B[0],SEL);
mux1 X2(OUT[1],A[1],B[1],SEL);

endmodule

module mux1(OUT, A, B, SEL);
 output OUT;
 input A,B,SEL;

 not n1(NOT_SEL, SEL);
 and a1 (X, A, NOT_SEL);
 and a2 (Y, SEL, B);
 or  o1 (OUT, X, Y);

endmodule

2015年10月28日 星期三

10/28 (1+2)多工器 (2+2)多工器

 module top;

wire [3:0]A,SEL,B,OUT;

system_clock #100 clock1(A[1]);
system_clock #200 clock2(A[0]);
system_clock #6400 clock3(SEL);
system_clock #400 clock4(B[1]);
system_clock #800 clock5(B[0]);
system_clock #1600 clock6(A[2]);
system_clock #3200 clock7(B[2]);
system_clock #800 clock8(A[3]);
system_clock #6400 clock9(B[3]);
mux2 M32(OUT[3:2], A[3:2], B[3:2], SEL);

mux2 M10(OUT[1:0], A[1:0], B[1:0], SEL);

endmodule


module mux2(OUT, A, B, SEL);
output [1:0] OUT;
input [1:0] A,B;
input SEL;
mux hi (OUT[1], A[1], B[1], SEL);
mux lo (OUT[0], A[0], B[0], SEL);
endmodule


module mux(OUT, A, B, SEL);

output OUT;

input A,B,SEL;

not I5 (sel_n, SEL) ;

and I6 (sel_a, A, SEL);

and I7 (sel_b, sel_n, B);

or I4 (OUT, sel_a, sel_b);

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>12800)$stop;

endmodule
mux2 M2(OUT[2], A[2], B[2], SEL);

mux2 M1(OUT[1:0], A[1:0], B[1:0], SEL);

endmodule


module mux2(OUT, A, B, SEL);
output [1:0] OUT;
input [1:0] A,B;
input SEL;
mux hi (OUT[1], A[1], B[1], SEL);
mux lo (OUT[0], A[0], B[0], SEL);
endmodule


module mux(OUT, A, B, SEL);

output OUT;

input A,B,SEL;

not I5 (sel_n, SEL) ;

and I6 (sel_a, A, SEL);

and I7 (sel_b, sel_n, B);

or I4 (OUT, sel_a, sel_b);

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>12800)$stop;

endmodule

10/21


module top;

wire A2,A1,A0,SEL,B2,B1,B0,c0,c1,c2,c3,c4,c5,c6,out7,out8,out9;
system_clock #6400 clock1(SEL);
system_clock #3200 clock2(A2);
system_clock #1600 clock3(A1);
system_clock #800 clock4(A0);
system_clock #400 clock5(B2);
system_clock #200 clock6(B1);
system_clock #100 clock7(B0);

and a0(c0,A2,SEL);
and a1(c1,A1,SEL);
and a2(c2,A0,SEL);

not a5(c5,SEL);

and a3(c3,c5,B2);
and a4(c4,c5,B1);
and a6(c6,c5,B0);
or a7(out7,c1,c4);
or a8(out8,c2,c6);
or a9(out9,c0,c3);
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>6400)$stop;

endmodule

2015年9月16日 星期三

CIC

IC相關能力鑑定


   測驗內容:(詳細內容依簡章公告為主)
科目鑑定內容
學科筆試 1. VLSI Fundamental
 2. Layout Skill
 3. Verification
 4. Unix/Linux Fundamental
術科實作佈局題:考生需在考試時間內全數完成以下四項條件即為通過;若有一項以上(或多項)未達成標準則為不通過。

佈局題評分四項條件為:
 (1) 佈局面積:符合題目所要求之面積條件
 (2) 佈局長寬比:符合題目所規範之長寬比?條件
 (3) DRC 驗證完成且完全無誤
 (4) LVS 驗證完成且完全無誤

除錯題:考生需在考試時間內,按題目之描述將已知的佈局檔匯入,並將各題佈局檔的 DRC、LVS 錯誤找出進行修正,最後完成驗證,再分別匯出 DRC、LVS 正確無誤之佈局檔與相關驗證結果。除錯題以解決原始題目的 DRC、LVS 錯誤為主,若考生因解決題目錯誤而額外產生其他 DRC 或 LVS 錯誤,將按照額外產生的錯誤數量進行扣分(每多一個額外錯誤扣 1 分),僅扣至該題 0 分為止。

■ 術科實作題使用之EDA Tool列表如下:
製程資料(Technology)CIC Virtual 0.18um CMOS Technology
佈局編輯軟體(Layout Editor)Cadence - Virtuoso
Synopsys – Laker
DRC驗證軟體(DRC Verification)Mentor Graphics – Calibre DRC
LVS驗證軟體(LVS Verification)Mentor Graphics – Calibre LVS

■ 測驗題型:
測驗項目學科筆試術科實作
題數503
作答時間80分鐘270分鐘
測驗內容選擇 50 題佈局題 1 題,除錯題 2 題

■ 術科實作考試注意事項:
1. 製程資料(CIC Virtual 0.18um CMOS Technology),不提供PDK Library, P-cell, M-cell,等功能,所有元件(device),包含電晶體、電阻、電容等均需自行繪製。
2. 術科考試時,需自行於Terminal 視窗以指令方式開啟佈局軟體。
3. 術科佈局題考試時,考生最後須將佈局(Layout)匯出(Stream-out)成為GDS 檔案。
4. 術科除錯題考試時,考生需將考題之GDS 檔案,匯入(Stream-in)佈局軟體內。
5. 佈局題考試時,考題不僅限於繪製電晶體元件,可能包含製程資料(CIC Virtual 0.18umCMOS Technology)所提供之電容、各類電阻等元件,請於考前自行練習相關元件佈局繪製方式。

■ 合格標準:
筆試成績需達 80 分以上,術科成績需達 70 分以上,可取得授證資格。

數位IC設計能力鑑定


   測驗內容:(詳細內容依簡章公告為主)
科目鑑定內容
學科筆試 以數位電路邏輯設計概念(包含大專院校教科書之Digital System, Logic Design, Logic Synthesis and Verification, VLSI Testing…等)、Verilog語法以及數位IC設計EDA工具流程為主;內容包含:
 1. Logic design
 2. Verilog coding
 3. Logic Synthesis
 4. Logic Verification
 5.Testing
 6.Power & Timing Analysis
術科實作由主辦單位提供指定題目、設計規格、設計方塊圖及相對應之測試向量,考生在考試時間內利用標準元件數位電路設計方式完成符合規格之晶片設計。
術科實作評分之4個主要項目為:
(A)Verilog coding須符合題目所要求之功能規格
(B)Verilog coding須通過主辦單位所提供之nLint rule檢查
(C)邏輯合成後之gate-level simulation驗證完全無誤
(D)電路合成軟體時序分析驗證須符合題目所要求之規格

■ 測驗題型:
測驗項目學科筆試術科實作
題數502
作答時間100分鐘300分鐘
測驗內容選擇 50 題基礎 1 題,進階 1 題

■ 合格標準:
筆試成績需達 80 分以上,術科成績需達 70 分以上,可取得授證資格。

資料來自:國研院晶片中心

ARM/Intel

目前Intel在面臨ARM的競爭,共有三個方面需要面對:
1.軟硬體系統的整合
當像是聯發科、高通、Nvidia這些晶片商在推出ARM晶片產品時,也都順帶提供了一個針對Android晶片相當完整的整合方案。而AMD雖然在行動市場上並未有所著墨,也針對Bluestack這樣的Android虛擬平台作了投資,為的就是讓自己的產品在Windows逐漸式微的情況下可以有多一重系統程式的選擇。
而Intel雖然因為也有行動平台的方案而針對Android X86有許多修正(例如讓X86平台可運行ARM程式的patch有許多部分就來自Intel)。 但是目前卻並未正式作一個完整版本的釋出,或是讓製造商在簡易型的桌機平台使用,僅讓Android X86始終是在社群用戶流通的階段,而並未有一個成熟的版本釋出。
畢竟若是讓桌面平台在使用Android方面的使用率擴大,針對X86平台優化的軟體增多,間接地也會幫助到手機平台的部分,然而這部分是Intel應該有資源做好卻沒做的部分。

2.面對使用者的開放性
目前相當受到DIY玩家熱烈支持的Rasperry Pi,就是Intel在後PC時代要面對的第二個方面。Rasperry Pi其實就是一個ARM版的小型主機板,讓DIY玩家們可以用來開發和製作一些需要複雜控制的產品。雖然Intel有行動平台Medfield,但是幾乎都沒有可以讓DIY玩家可以如同Rasperry Pi那樣使用的產品出現。
即使是像比較精簡的Atom產品,也最多只能找到一些少數的準系統商品。或許精簡平台的DIY市場目前還並不大,但是像Rasperry Pi這樣的產品逐漸火紅而造成話題,就證明還是有部分的市場存在,而Intel在這方面卻欠缺,其實就是讓Intel商品在成為行銷話題方面的一種錯失。

3.價格
當ARM商品,可以用一個二三千塊台幣的電視棒產品,就讓電視擁有使用Android成為智慧型電視的功能。而像聯發科或是採用高通的手機,也都出現擁有雙核心以上、並運作良好的產品,而且能讓價格維持在二千元人民幣以下。即使不論ARM功耗比目前在行動產品上還是優於Intel X86 CPU的部分。

與Intel之前在行動裝置上的主力產品Atom相較,扛著「Core」招牌的Core M不但效能更強大、更省電、規格上也更加輕薄。Core M所採用的製造架構是英特爾最新一代的Broadwell 14奈米製程,比前一代的Haswell 22奈米製程更加先進。受惠於製程的改善,Core M比起前一代的Core晶片,在面積上縮小了37%,是Core系列中第一個不需要風扇設計的處理器,更加適合輕薄短小的行動裝置,英特爾就曾對外展示搭載了Core M處理器,厚度只有七公厘左右的平板電腦。

自從ARM宣布64位元的ARMv8架構,以及今年又公開基於此一架構開發的Cortex-A50的A53、A57晶片後,這股趨勢更加明顯。受惠於ARM自身的big.LITTLE技術,ARM晶片在低度使用時能節省75%的能源,重度使用時則能多發揮40%的效能。這種高效能低耗電的特性,自然成為市場上的新焦點。

不論是Intel或ARM,想要達成目標其實都不容易。對於Intel來說,第一波搭載Core M的產品只有二合一的平板/筆電,如果不能夠推廣到智慧型手機上,或者是被三星等指標性大廠採用,終究功虧一簣,而Core M如何與既有的產品線Atom分工也是一大問題;另一方面,縱使安謀的伺服器晶片有低耗電的優點,但如何讓早已習慣英特爾x86架構的全球開發人員接受新的架構,將會是新的挑戰。換言之,安謀除了晶片設計之外,還得建立一個從到硬體製造到軟體開發的生態系,才能成功挑戰Intel的霸權。 這場晶片產業新舊龍頭的混戰,未來還有得看。
 
英特爾(Intel)
安謀(ARM)
成立時間
1968
1990
2013年營收
527億美元
7億1460萬美元
2013年獲利
96億美元
1億480萬美元
美國專利數量
25310
902