subdesign.vhd

来自「出租车计价器」· VHDL 代码 · 共 37 行

VHD
37
字号
 Subdesign 23to0
     (inclk    :input;
     ot[13..0] :output;
    )
    Variable
     hw[1..0],lw[3..0]:dff; 
    Begin
      (hw[],lw[]).clk=inclk;
      if (hw[]==2)and(lw[]==3)  then
         hw[]=0;lw[]=0;
      elsif lw[]==9 then
         hw[]=hw[]+1;lw[]=0;
      else
         hw[]=hw[];lw[]=lw[]+1;
      end if;
      Table
        hw[]=>ot13,ot12,ot11,ot10,ot9,ot8,ot7;
             0 => 1,1,1,1,1,1,0;
             1 => 0,1,1,0,0,0,0;
             2 => 1,1,0,1,1,0,1;
      End table;
      Table
        lw[]=>ot6,ot5,ot4,ot3,ot2,ot1,ot0;
            0 => 1,1,1,1,1,1,0;
            1 => 0,1,1,0,0,0,0;
            2 => 1,1,0,1,1,0,1;
            3 => 1,1,1,1,0,0,1;
            4 => 0,1,1,0,0,1,1;
            5 => 1,0,1,1,0,1,1;
            6 => 1,0,1,1,1,1,1;
            7 => 1,1,1,0,0,0,0;
            8 => 1,1,1,1,1,1,1;
            9 => 1,1,1,1,0,1,1;
      End table;
  End;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?