QuartusII使用教程

一、打开软件

二、输入下面代码

module top(
    input data_in,
     input clk,
     input rst,
     output reg [7:0] reg_vec,
     output reg [7:0] reg_loop,
     output reg data_out_vec,
     output  reg data_out_loop
);
integer loop;


always@(posedge clk)
begin
    if(rst==1'b0)
    begin
        reg_vec<=8'h00;
        data_out_vec<=1'b0;
    end
    else
    begin
        reg_vec[0]<=data_in;        //s1
        reg_vec[1]<=reg_vec[0];     //s2
        reg_vec[2]<=reg_vec[1];     //s3
        reg_vec[3]<=reg_vec[2];     //s4
        reg_vec[4]<=reg_vec[3];     //s5
        reg_vec[5]<=reg_vec[4];     //s6
        reg_vec[6]<=reg_vec[5];     //s7
        reg_vec[7]<=reg_vec[6];     //s8
        data_out_vec<=reg_vec[7];   //s9
    end
end

always@(posedge clk)
begin
    if(rst==1'b0)
    begin
        reg_loop<=8'h00;
        data_out_loop<=1'b0;
    end
    else
    begin
      reg_loop[0]<=data_in;                    //s10
        for(loop=0;loop<=6;loop=loop+1)          //s11
            reg_loop[loop+1]<=reg_loop[loop];     //s12
           data_out_loop<=reg_loop[7];              //s13
    end
end
endmodule

三、保存文件

 

 

 

 

 

 

四、执行代码

五、查看波形

 

 

 

 

 

 六、查看代码的原理图

File->create/Update->Create Symbol Files for Current File

File->open File->all files->xxx.bsf

生成的原理图如下所示

七、modelsim与QuartusII联合仿真

参考博文连接:https://blog.csdn.net/lizao_three/article/details/116944272

posted @ 2022-04-16 18:02  super_sweet  阅读(3156)  评论(0编辑  收藏  举报