電腦系統要素-第三章 時序邏輯

來源:互聯網
上載者:User

標籤:bit   距離   reset   als   and   reg   位元   else   int   

1 本章介紹時鐘和觸發器,構建記憶單元。觸發器是具有記憶功能的最小記憶單元,能夠儲存一個bit位。
2 設計電腦時鐘時,刻度的長度要比1個位元在電腦兩個物理距離最長的晶片之間的傳輸時間稍長。
3 D觸發器
4 寄存器
1) 1位元位寄存器
/**
* 1-bit register:
* If load[t] == 1 then out[t+1] = in[t]
* else out does not change (out[t+1] = out[t])
*/

CHIP Bit {
IN in, load;
OUT out;

PARTS:
Mux(a=out1,b=in,sel=load,out=out2);
DFF(in=out2,out=out1);
And(a=out1,b=true,out=out);
}
2) Register
/**
* 16-bit register:
* If load[t] == 1 then out[t+1] = in[t]
* else out does not change
*/

CHIP Register {
IN in[16], load;
OUT out[16];

PARTS:
Bit(in=in[0],load=load,out=out[0]);
Bit(in=in[1],load=load,out=out[1]);
Bit(in=in[2],load=load,out=out[2]);
Bit(in=in[3],load=load,out=out[3]);
Bit(in=in[4],load=load,out=out[4]);
Bit(in=in[5],load=load,out=out[5]);
Bit(in=in[6],load=load,out=out[6]);
Bit(in=in[7],load=load,out=out[7]);
Bit(in=in[8],load=load,out=out[8]);
Bit(in=in[9],load=load,out=out[9]);
Bit(in=in[10],load=load,out=out[10]);
Bit(in=in[11],load=load,out=out[11]);
Bit(in=in[12],load=load,out=out[12]);
Bit(in=in[13],load=load,out=out[13]);
Bit(in=in[14],load=load,out=out[14]);
Bit(in=in[15],load=load,out=out[15]);
}
3) RAM8

CHIP RAM8 {
IN in[16], load, address[3];
OUT out[16];

PARTS:
DMux8Way(in=load,sel=address,a=a1,b=b1,c=c1,d=d1,e=e1,f=f1,g=g1,h=h1);
Register(in=in,load=a1,out=out1);
Register(in=in,load=b1,out=out2);
Register(in=in,load=c1,out=out3);
Register(in=in,load=d1,out=out4);
Register(in=in,load=e1,out=out5);
Register(in=in,load=f1,out=out6);
Register(in=in,load=g1,out=out7);
Register(in=in,load=h1,out=out8);
Mux8Way16(a=out1,b=out2,c=out3,d=out4,e=out5,f=out6,g=out7,h=out8,sel=address,out=out);
}
4) RAM64
CHIP RAM64 {
IN in[16], load, address[6];
OUT out[16];

PARTS:
DMux8Way(in=load,sel=address[3..5],a=a1,b=b1,c=c1,d=d1,e=e1,f=f1,g=g1,h=h1);
RAM8(in=in,load=a1,address=address[0..2],out=out1);
RAM8(in=in,load=b1,address=address[0..2],out=out2);
RAM8(in=in,load=c1,address=address[0..2],out=out3);
RAM8(in=in,load=d1,address=address[0..2],out=out4);
RAM8(in=in,load=e1,address=address[0..2],out=out5);
RAM8(in=in,load=f1,address=address[0..2],out=out6);
RAM8(in=in,load=g1,address=address[0..2],out=out7);
RAM8(in=in,load=h1,address=address[0..2],out=out8);
Mux8Way16(a=out1,b=out2,c=out3,d=out4,e=out5,f=out6,g=out7,h=out8,sel=address[3..5],out=out);
}
5) PC計數器
/**
* A 16-bit counter with load and reset control bits.
* if (reset[t] == 1) out[t+1] = 0
* else if (load[t] == 1) out[t+1] = in[t]
* else if (inc[t] == 1) out[t+1] = out[t] + 1 (integer addition)
* else out[t+1] = out[t]
*/

CHIP PC {
IN in[16],load,inc,reset;
OUT out[16];

PARTS:
Mux16(a=back,b=in,sel=load,out=in1);
Mux16(a=in1,b=false,sel=reset,out=in2);
Register(in=in2,load=true,out=out1);
And16(a=out1,b=true,out=out);
Inc16(in=out1,out=out2);
Mux16(a=out1,b=out2,sel=inc,out=back);
}

電腦系統要素-第三章 時序邏輯

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.