2015年12月30日 星期三

上機考 nand

odule top;

wire a, A, b, B, c, C, d, D, 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);

nand S1(a, A, B);
nand S2(b, B, B);
nand S3(c, C, C);
nand S4(d, D, D);
nand C1(F1, a ,b , C);
nand C2(F2, a, B, C);
nand C3(F3, A, C, D);
nand C4(F4, A,b, C);
nand o1(F, F4, F2, F3, F1);

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,E,F;
system_clock #1600 clock1(A);
system_clock #800 clock2(B);
system_clock #400 clock3(C);
system_clock #200 clock4(D);

not z1(a,A);
not z2(b,B);
not z3(c,C);
not z4(d,D);
and X1(F1, C, D);
and X2(F2, a, b, D);
and X3(F3, B, c, d);
and X4(F4, A, c, d);
or W(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>1000)$stop;

endmodule

2015年11月25日 星期三

11/25三位元全加法

module fulladder (sum, c_out, a, b, c_in);
wire s1, c1, c2;
output sum;
output c_out;
input a, b, c_in;
xor g1(s1, a, b);
xor g2(sum, s1, c_in);
and g3(c1, a,b);
and g4(c2, s1, c_in) ;
xor g5(c_out, c2, c1) ;

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解b*g


11/18 B*G

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_in != 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 = 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


no.2

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);
  assign carry_out = a&carry_in|a&b|b&carry_in;
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_in != 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 = 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年11月4日 星期三

11/4二位元


....

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

  mux_structural 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;
 #1 $display("a=%d b=%d s=%d   out=%d",a,b,s,out);
 end
 end
 end
 end
 endmodule

 module mux_structural(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 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


11/4改錯




2015年10月28日 星期三

10/28 4位元

                                  剛開始還是有點不懂!但後來請教隔壁的就略懂一些

2015年10月7日 星期三

10/7 hello

module top;
system_clock #1600 clock1(A);
system_clock #800 clock2(B);
system_clock #400 clock3(C);
system_clock #200 clock4(D);
system_clock #100 clock5(E);
mux M1(OUT1 ,OUT2 ,OUT3, OUT4, A, B, C, D, E);
endmodule


module mux(OUT1 ,OUT2 ,OUT3, OUT4, A, B, C, D, E);
output OUT;
input OUT1 ,OUT2 ,OUT3, OUT4, A, B, C, D, E;
not a1(OUT1 ,A , B) ;
and a2(OUT2 ,C , D);
not a3(OUT2);
and a4(OUT3 , E);
and a5(E ,OUT3 ,OUT2, OUT1);
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年9月30日 星期三

AND邏輯閘

                                     開始對這門課有一點興趣了!!!

2015年9月23日 星期三

硬體

好爽!!! 雖然大部分都是請教同學 但是至少知道要怎麼做了

2015年9月16日 星期三

AMD雙架構核心

透過雲端提供完整的專業顯示卡效能

AMD SKY 技術將遊戲與虛擬化工作站和應用程式推向另一波新高點 – 將 AMD Radeon™ 顯示卡和 AMD FirePro™ 專業顯示卡的強大效能帶入雲端。雲端可讓使用者從任何地方都能順暢存取。服務供應商透過網際網路,為玩家選擇的任何裝置提供高品質、低延遲的遊戲體驗。IT 管理員可將工作者從實體 PC 移至虛擬桌面,並可輕鬆地從單一集中位置加以管理。各種限制正在逐漸消失中。

IC數位晶片簡介

源起

  積體電路(IC)為通訊、資訊及消費性電子等3C產業朝向數位化、體積微小化之關鍵性零組件。歷年國內來諸多會議中,均將「提昇國內晶片設計之研究水準,培育晶片系統設計人才」列為重大議題。行政院科技部依據第四次全國科學技術會議之結論,於民國八十一年五月起推動「晶片設計製作中心」(Chip Implementation Center)籌設專案計畫,八十二年一月於新竹科學工業園區成立中心籌備工作小組。八十六年七月有鑑於科技發展趨勢,更名為「國家晶片系統設計中心」。為強化南部高科技研發環境,特於九十一年九月於台南科學工業園區設立南區辦公室,以發展與新竹科學園區相輔相成之前瞻研究,建立高科技技術及產業發展聚落。九十二年元月起為配合國家科學委員會所屬國家實驗室法人化作業,改隸於「財團法人國家實驗研究院」繼續推動各項業務工作。

中心目標

  本中心之設立宗旨為「培育積體電路晶片及系統設計人才、提昇積體電路晶片及系統設計技術」,期能強化我國積體電路晶片及系統設計能力。主要任務為:
(一) 建立積體電路晶片及系統設計環境。
(二) 提供積體電路晶片及系統設計雛型品之實作與測試服務。
(三) 推展積體電路晶片及系統設計之「產、學、研」合作研究,並將學術界之研究成果落實推廣至產業界。
(四) 推動國內外積體電路晶片及系統設計相關技術之合作與交流。