《计算机系统要素学习》笔记之第3章 时序逻辑

《计算机系统要素学习》笔记之第3章 时序逻辑

  • 记忆单元:由时序芯片组成
  • 底层时序门(Sequential gate):触发器(Flip-flop),数据触发器(Data Flip-flop),或DFF,D触发器
  • 规范详述
  • D触发器(DFF):data flip-flop gate,最基本时序芯片,用于设计所有记忆单元的基本组件。
  • 寄存器(Register):由16个1比特寄存器(Bit)组成。
  • 存储块(Memory或RAM):也称RAM,大小有RAM8,RAM64,RAM512,RAM4K和RAM16K。
  • 计数器(PC):简单进行加1操作
  • 实现
  • Bit
    Mux(a=loop1,b=in,sel=load,out=w1);
    DFF(in=w1,out=loop1);
    Mux(a=loop1,b=false,sel=false,out=out);
  • Register
    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]);
  • RAM8
    DMux8Way(in=load,sel=address,a=l1,b=l2,c=l3,d=l4,e=l5,f=l6,g=l7,h=l8);
    Register(in=in,load=l1,out=r1);
    Register(in=in,load=l2,out=r2);
    Register(in=in,load=l3,out=r3);
    Register(in=in,load=l4,out=r4);
    Register(in=in,load=l5,out=r5);
    Register(in=in,load=l6,out=r6);
    Register(in=in,load=l7,out=r7);
    Register(in=in,load=l8,out=r8);
    Mux8Way16(a=r1,b=r2,c=r3,d=r4,e=r5,f=r6,g=r7,h=r8,sel=address,out=out);
  • RAM64
    DMux8Way(in=load,sel=address[3…5],a=l1,b=l2,c=l3,d=l4,e=l5,f=l6,g=l7,h=l8);
    RAM8(in=in,load=l1,address=address[0…2],out=r1);
    RAM8(in=in,load=l2,address=address[0…2],out=r2);
    RAM8(in=in,load=l3,address=address[0…2],out=r3);
    RAM8(in=in,load=l4,address=address[0…2],out=r4);
    RAM8(in=in,load=l5,address=address[0…2],out=r5);
    RAM8(in=in,load=l6,address=address[0…2],out=r6);
    RAM8(in=in,load=l7,address=address[0…2],out=r7);
    RAM8(in=in,load=l8,address=address[0…2],out=r8);
    Mux8Way16(a=r1,b=r2,c=r3,d=r4,e=r5,f=r6,g=r7,h=r8,sel=address[3…5],out=out);
  • RAM512
    DMux8Way(in=load,sel=address[6…8],a=l1,b=l2,c=l3,d=l4,e=l5,f=l6,g=l7,h=l8);
    RAM64(in=in,load=l1,address=address[0…5],out=r1);
    RAM64(in=in,load=l2,address=address[0…5],out=r2);
    RAM64(in=in,load=l3,address=address[0…5],out=r3);
    RAM64(in=in,load=l4,address=address[0…5],out=r4);
    RAM64(in=in,load=l5,address=address[0…5],out=r5);
    RAM64(in=in,load=l6,address=address[0…5],out=r6);
    RAM64(in=in,load=l7,address=address[0…5],out=r7);
    RAM64(in=in,load=l8,address=address[0…5],out=r8);
    Mux8Way16(a=r1,b=r2,c=r3,d=r4,e=r5,f=r6,g=r7,h=r8,sel=address[6…8],out=out);
  • RAM4K
    DMux8Way(in=load,sel=address[9…11],a=l1,b=l2,c=l3,d=l4,e=l5,f=l6,g=l7,h=l8);
    RAM512(in=in,load=l1,address=address[0…8],out=r1);
    RAM512(in=in,load=l2,address=address[0…8],out=r2);
    RAM512(in=in,load=l3,address=address[0…8],out=r3);
    RAM512(in=in,load=l4,address=address[0…8],out=r4);
    RAM512(in=in,load=l5,address=address[0…8],out=r5);
    RAM512(in=in,load=l6,address=address[0…8],out=r6);
    RAM512(in=in,load=l7,address=address[0…8],out=r7);
    RAM512(in=in,load=l8,address=address[0…8],out=r8);
    Mux8Way16(a=r1,b=r2,c=r3,d=r4,e=r5,f=r6,g=r7,h=r8,sel=address[9…11],out=out);
  • RAM16K
    DMux4Way(in=load,sel=address[12…13],a=l1,b=l2,c=l3,d=l4);
    RAM4K(in=in,load=l1,address=address[0…11],out=r1);
    RAM4K(in=in,load=l2,address=address[0…11],out=r2);
    RAM4K(in=in,load=l3,address=address[0…11],out=r3);
    RAM4K(in=in,load=l4,address=address[0…11],out=r4);
    Mux4Way16(a=r1,b=r2,c=r3,d=r4,sel=address[12…13],out=out);
    PC
    // 组合逻辑
    Add16(a=loop1,b[0]=true,out=add0);
    Mux16(a=loop1,b=add0,sel=inc,out=w1);
    Mux16(a=w1,b=in,sel=load,out=w2);
    Mux16(a=w2,b=false,sel=reset,out=out1);
    // 延时芯片
    Register(in=out1,load=true,out=loop1);
    // 输出
    Mux16(a=loop1,b=loop1,sel=false,out=out);

猜你喜欢

转载自blog.csdn.net/weixin_43147737/article/details/84629298