国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

基于FPGA的數(shù)字秒表設(shè)計(jì)(完整工程)

這篇具有很好參考價(jià)值的文章主要介紹了基于FPGA的數(shù)字秒表設(shè)計(jì)(完整工程)。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問(wèn)。

目錄

概述

設(shè)計(jì)功能

數(shù)字秒表設(shè)計(jì)的目的

模塊仿真

設(shè)計(jì)代碼


概述

該設(shè)計(jì)是用于體育比賽的數(shù)字秒表,基于FPGA在Quartus II 9.0sp2軟件下應(yīng)用VHDL語(yǔ)言編寫(xiě)程序,采用ALTRA公司CycloneII系列的EP2C8Q208芯片進(jìn)行了計(jì)算機(jī)仿真,并給出了相應(yīng)的仿真結(jié)果。本設(shè)計(jì)有效的克服了傳統(tǒng)的數(shù)字秒表的缺點(diǎn)采用EDA技術(shù)采取自上而下的設(shè)計(jì)思路。繪制出了具體的邏輯電路,最后又通過(guò)硬件上對(duì)其進(jìn)行調(diào)試和驗(yàn)證。該電路能夠?qū)崿F(xiàn)很好的計(jì)時(shí)功能,計(jì)時(shí)精度高,最長(zhǎng)計(jì)時(shí)時(shí)間可達(dá)一個(gè)小時(shí)。?

設(shè)計(jì)功能

1、完成一個(gè)帶有時(shí)分秒顯示的數(shù)字秒表;?
2、12、24小時(shí)可以調(diào)節(jié);
3、能作秒表計(jì)時(shí);
4、能夠倒計(jì)時(shí)顯示;

數(shù)字秒表設(shè)計(jì)的目的

本次設(shè)計(jì)的目的就是在掌握EDA實(shí)驗(yàn)開(kāi)發(fā)系統(tǒng)的初步使用基礎(chǔ)上,了解EDA技術(shù),對(duì)計(jì)算機(jī)系統(tǒng)中時(shí)鐘控制系統(tǒng)進(jìn)一步了解,掌握狀態(tài)機(jī)工作原理,同時(shí)了解計(jì)算機(jī)時(shí)鐘脈沖是怎么產(chǎn)生和工作的。(此處省略)

模塊仿真

用計(jì)數(shù)器設(shè)計(jì)簡(jiǎn)單秒表fpga,fpga開(kāi)發(fā)

用計(jì)數(shù)器設(shè)計(jì)簡(jiǎn)單秒表fpga,fpga開(kāi)發(fā)

用計(jì)數(shù)器設(shè)計(jì)簡(jiǎn)單秒表fpga,fpga開(kāi)發(fā)文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-754133.html

設(shè)計(jì)代碼

(代碼較長(zhǎng),完整工程免費(fèi)分享,需要獲取可關(guān)注:FPGA苑)
module time_clock(
    clk,
    reset_n,
    hour_select_key,
    second_counter_key,
    second_countdown_key,
    pause_key,
    duan,
    wei
    );
    
    input           clk;                            //clk:50MHZ時(shí)鐘輸入;
    input           reset_n;                        //復(fù)位信號(hào)輸入,低電平有效;
    
    input           hour_select_key;                //12、24小時(shí)可以調(diào)節(jié)按鍵,當(dāng)為‘1’時(shí)為24,‘0’時(shí)為12小時(shí);
    input           second_counter_key;             //當(dāng)該按鍵為‘1’時(shí)為秒表計(jì)時(shí)功能,‘0’時(shí)為正常功能;
    input           second_countdown_key;           //當(dāng)該按鍵為‘1’時(shí)為倒計(jì)時(shí)功能,‘0’時(shí)為正常功能;
    input           pause_key;                      //暫停功能按鍵,進(jìn)行秒表計(jì)時(shí)和倒計(jì)時(shí)時(shí)可以通過(guò)該按鍵進(jìn)行暫停,‘1’暫停,‘0’繼續(xù)
    
    output  [7:0]   duan;                           //duan:數(shù)碼管段碼;
    output  [7:0]   wei;                            //wei:數(shù)碼管位碼;
    
    reg     [7:0]   duan;                           //duan:數(shù)碼管段碼;
    reg     [7:0]   wei;                            //wei:數(shù)碼管位碼;

    reg     [24:0]  count;                          //1HZ時(shí)鐘計(jì)數(shù)器
    reg     [13:0]  count2;                         //掃描時(shí)鐘計(jì)數(shù)器
    reg             clk_1hz;                        //1HZ時(shí)鐘信號(hào)

    reg     [3:0]   miao_ge;                        //秒個(gè)位數(shù)BCD碼
    reg     [2:0]   miao_shi;                       //秒十位BCD二進(jìn)制碼
    reg     [3:0]   fen_ge;                         //分鐘個(gè)位數(shù)
    reg     [2:0]   fen_shi;                        //分鐘十位數(shù)
    reg     [1:0]   shi_ge;                         //時(shí)鐘個(gè)位數(shù)
    reg     [1:0]   shi_shi;                        //時(shí)鐘十位數(shù)
    reg     [1:0]   shi_select_ge;                  //時(shí)鐘選擇個(gè)位數(shù),用于調(diào)節(jié)時(shí)制
    reg     [1:0]   shi_select_shi;                 //時(shí)鐘選擇十位數(shù),用于調(diào)節(jié)時(shí)制

    reg             clk_scan;                       //數(shù)碼管掃描時(shí)鐘
    reg     [2:0]   select;                         //用于掃描時(shí)選擇顯示位碼

    //****************************************************************************************************
    //  模塊名稱:秒時(shí)鐘分頻模塊
    //  功能描述:
    //****************************************************************************************************
    always @(posedge clk or negedge reset_n)//1HZ時(shí)鐘進(jìn)程
    begin
        if(reset_n == 1'b0)
        begin
            count <= 25'd0;
            clk_1hz <= 1'b0;
        end
        else
            if(count == 25'd25000000)
            begin
                clk_1hz <= ~clk_1hz;
                count <= 25'd0;
            end
            else
                count <= count + 1'b1;
    end
    
    reg     [17:0]  counter_count;
    reg             clk_100hz;
    always @(posedge clk or negedge reset_n)//100HZ時(shí)鐘進(jìn)程
    begin
        if(reset_n == 1'b0)
        begin
            counter_count <= 18'd0;
            clk_100hz <= 1'b0;
        end
        else
            if(~pause_key == 1'b0)
                if(counter_count == 18'd250000)
                begin
                    clk_100hz <= ~clk_100hz;
                    counter_count <= 18'd0;
                end
                else
                    counter_count <= counter_count + 1'b1;
            else
            begin
                clk_100hz <= 1'b0;
                counter_count <= 18'd0;
            end
    end
    //****************************************************************************************************
    //  模塊名稱:計(jì)時(shí)調(diào)節(jié)模塊
    //  功能描述:
    //****************************************************************************************************
    always @(posedge clk or negedge reset_n)//1HZ時(shí)鐘進(jìn)程
    begin
        if(reset_n == 1'b0)
        begin
            shi_select_ge <= 2'd3;
            shi_select_shi <= 2'd2;
        end
        else
            if(hour_select_key == 1'b1)//12、24小時(shí)可以調(diào)節(jié)按鍵,當(dāng)為‘1’時(shí)為24,‘0’時(shí)為12小時(shí)
            begin
                shi_select_ge <= 2'd3;
                shi_select_shi <= 2'd2;
            end
            else
            begin
                shi_select_ge <= 2'd1;
                shi_select_shi <= 2'd1;
            end
    end        
    //****************************************************************************************************
    //  模塊名稱:秒計(jì)時(shí)模塊
    //  功能描述:
    //****************************************************************************************************
    always @(posedge clk_1hz or negedge reset_n)//秒分時(shí)各位累加功能進(jìn)程
    begin
        if(reset_n == 1'b0)
        begin
            miao_ge <= 4'd9;
            miao_shi <= 3'd5;
            fen_ge <= 4'd9;
            fen_shi <= 3'd5;
            shi_ge <= 2'd3;
            shi_shi <= 2'd2;
        end
        else
            if(miao_ge ==4'd9)
            begin
                miao_ge <= 4'd0;
                if(miao_shi == 3'd5)
                begin
                    miao_shi <= 3'd0;
                    if(fen_ge == 4'd9)
                    begin
                        fen_ge <= 4'd0;
                        if(fen_shi == 3'd5)
                        begin
                            fen_shi <= 3'd0;
                            if(shi_ge == shi_select_ge)//24小時(shí)制對(duì)應(yīng)3,12小時(shí)制則對(duì)應(yīng)1
                            begin
                                shi_ge <= 2'd0;
                                if(shi_shi == shi_select_shi)//24小時(shí)制對(duì)應(yīng)2,12小時(shí)制則對(duì)應(yīng)1
                                    shi_shi <= 2'd0;
                                else
                                    shi_shi <= shi_shi + 1'b1;									  
                            end
                            else
                                shi_ge <= shi_ge + 1'b1;
                        end
                        else
                            fen_shi <= fen_shi + 1'b1;
                    end
                    else
                        fen_ge <= fen_ge + 1'b1;
                end
                else
                    miao_shi <= miao_shi + 1'b1;
            end
            else
                miao_ge <= miao_ge + 1'b1;
    end 
    //****************************************************************************************************
    //  模塊名稱:數(shù)碼管位選擇時(shí)鐘產(chǎn)生模塊
    //  功能描述:
    //****************************************************************************************************
    always @(posedge clk or negedge reset_n)//數(shù)碼管掃描時(shí)鐘產(chǎn)生進(jìn)程
    begin
        if(reset_n == 1'b0)
        begin
            count2 <= 14'd0;
            clk_scan <= 1'b0;
        end
        else
            if(count2 == 14'd10000)
            begin
                count2 <= 14'd0;
                clk_scan <= ~clk_scan;
            end
            else
                count2 <= count2 + 1'b1;
    end
    //****************************************************************************************************
    //  模塊名稱:數(shù)碼管位選擇產(chǎn)生信號(hào)模塊
    //  功能描述:
    //****************************************************************************************************
    always @(posedge clk_scan or negedge reset_n)
    begin 
        if(reset_n == 1'b0)
            select <= 3'b000;
        else
            select <= select + 1'b1;
    end
    //****************************************************************************************************
    //  模塊名稱:秒表計(jì)時(shí)
    //  功能描述:秒表計(jì)時(shí)
    //**************************************************************************************************** 
    reg     [3:0]   counter_haomiao_ge;             //秒表計(jì)時(shí),毫秒個(gè)位數(shù)BCD碼
    reg     [3:0]   counter_haomiao_shi;            //秒表計(jì)時(shí),毫秒十位數(shù)BCD碼
    reg     [3:0]   counter_miao_ge;                //秒表計(jì)時(shí),秒個(gè)位數(shù)BCD碼
    reg     [2:0]   counter_miao_shi;               //秒表計(jì)時(shí),秒十位BCD二進(jìn)制碼
    reg     [3:0]   counter_fen_ge;                 //秒表計(jì)時(shí),分鐘個(gè)位數(shù)
    reg     [2:0]   counter_fen_shi;                //秒表計(jì)時(shí),分鐘十位數(shù)
    reg     [1:0]   counter_shi_ge;                 //秒表計(jì)時(shí),時(shí)鐘個(gè)位數(shù)
    reg     [1:0]   counter_shi_shi;                //秒表計(jì)時(shí),時(shí)鐘十位數(shù)
    always @(posedge clk_100hz or negedge reset_n)
    begin
        if(reset_n == 1'b0)
        begin
            counter_haomiao_ge <= 4'd0;
            counter_haomiao_shi <= 4'd0;
            counter_miao_ge <= 4'd0;
            counter_miao_shi <= 3'd0;
            counter_fen_ge <= 4'd0;
            counter_fen_shi <= 3'd0;
            counter_shi_ge <= 2'd0;
            counter_shi_shi <= 2'd0;
        end
        else
            if(~second_counter_key == 1'b1)
                if(counter_haomiao_ge == 4'd9)
                begin
                    counter_haomiao_ge <= 4'd0;
                    if(counter_haomiao_shi == 4'd9)
                    begin
                        counter_haomiao_shi <= 4'd0;
                        if(counter_miao_ge ==4'd9)
                        begin
                            counter_miao_ge <= 4'd0;
                            if(counter_miao_shi == 3'd5)
                            begin
                                counter_miao_shi <= 3'd0;
                                if(counter_fen_ge == 4'd9)
                                begin
                                    counter_fen_ge <= 4'd0;
                                    if(counter_fen_shi == 3'd5)
                                    begin
                                        counter_fen_shi <= 3'd0;
                                        if(counter_shi_ge == 2'd3)//24小時(shí)制對(duì)應(yīng)3,12小時(shí)制則對(duì)應(yīng)1
                                        begin
                                            counter_shi_ge <= 2'd0;
                                            if(counter_shi_shi == 2'd2)//24小時(shí)制對(duì)應(yīng)2,12小時(shí)制則對(duì)應(yīng)1
                                                counter_shi_shi <= 2'd0;
                                            else
                                                counter_shi_shi <= counter_shi_shi + 1'b1;									  
                                        end
                                        else
                                            counter_shi_ge <= counter_shi_ge + 1'b1;
                                    end
                                    else
                                        counter_fen_shi <= counter_fen_shi + 1'b1;
                                end
                                else
                                    counter_fen_ge <= counter_fen_ge + 1'b1;
                            end
                            else
                               counter_miao_shi <= counter_miao_shi + 1'b1;
                        end
                        else
                            counter_miao_ge <= counter_miao_ge + 1'b1;
                    end
                    else
                        counter_haomiao_shi <= counter_haomiao_shi + 1'b1;
                end
                else
                    counter_haomiao_ge <= counter_haomiao_ge + 1'b1;
            else
            begin
                counter_haomiao_ge <= 4'd0;
                counter_haomiao_shi <= 4'd0;
                counter_miao_ge <= 4'd0;
                counter_miao_shi <= 3'd0;
                counter_fen_ge <= 4'd0;
                counter_fen_shi <= 3'd0;
                counter_shi_ge <= 2'd0;
                counter_shi_shi <= 2'd0;
            end
    end 
    //****************************************************************************************************
    //  模塊名稱:倒計(jì)時(shí)模塊
    //  功能描述:
    //**************************************************************************************************** 
    reg     [3:0]   countdown_haomiao_ge;           //倒計(jì)時(shí),毫秒個(gè)位數(shù)BCD碼
    reg     [3:0]   countdown_haomiao_shi;          //倒計(jì)時(shí),毫秒十位數(shù)BCD碼
    reg     [3:0]   countdown_miao_ge;              //倒計(jì)時(shí),秒個(gè)位數(shù)BCD碼
    reg     [2:0]   countdown_miao_shi;             //倒計(jì)時(shí),秒十位BCD二進(jìn)制碼
    always @(posedge clk_100hz or negedge reset_n)//秒分時(shí)各位累加功能進(jìn)程
    begin
        if(reset_n == 1'b0)
        begin
            countdown_haomiao_ge <= 4'd9;
            countdown_haomiao_shi <= 4'd9;
            countdown_miao_ge <= 4'd9;
            countdown_miao_shi <= 3'd5;
        end
        else
            if(~second_countdown_key == 1'b1)
                if(countdown_haomiao_ge == 4'd0)
                begin
                    countdown_haomiao_ge <= 4'd9;
                    if(countdown_haomiao_shi == 4'd0)
                    begin
                        countdown_haomiao_shi <= 4'd9;
                        if(countdown_miao_ge ==4'd0)
                        begin
                            countdown_miao_ge <= 4'd9;
                            if(countdown_miao_shi == 3'd0)
                            begin
                                countdown_miao_shi <= 3'd5;
                            end
                            else
                               countdown_miao_shi <= countdown_miao_shi - 1'b1;
                        end
                        else
                            countdown_miao_ge <= countdown_miao_ge - 1'b1;
                    end
                    else
                        countdown_haomiao_shi <= countdown_haomiao_shi - 1'b1;
                end
                else
                    countdown_haomiao_ge <= countdown_haomiao_ge - 1'b1;
            else
            begin
                countdown_haomiao_ge <= 4'd9;
                countdown_haomiao_shi <= 4'd9;
                countdown_miao_ge <= 4'd9;
                countdown_miao_shi <= 3'd5;
            end    
    end 
    //****************************************************************************************************
    //  模塊名稱:功能選擇模塊
    //  功能描述:
    //****************************************************************************************************        
    reg     [3:0]   reg_haomiao_ge;                 //毫秒個(gè)位數(shù)BCD碼
    reg     [3:0]   reg_haomiao_shi;                //毫秒十位數(shù)BCD碼
    reg     [3:0]   reg_miao_ge;                    //秒個(gè)位數(shù)BCD碼
    reg     [2:0]   reg_miao_shi;                   //秒十位BCD二進(jìn)制碼
    reg     [3:0]   reg_fen_ge;                     //分鐘個(gè)位數(shù)
    reg     [2:0]   reg_fen_shi;                    //分鐘十位數(shù)
    reg     [3:0]   reg_shi_ge;                     //時(shí)鐘個(gè)位數(shù)
    reg     [1:0]   reg_shi_shi;                    //時(shí)鐘十位數(shù)
    always @(posedge clk or negedge reset_n)
    begin
        if(reset_n == 1'b0)
        begin
            reg_haomiao_ge <= 4'd9;
            reg_haomiao_shi <= 4'd9;
            reg_miao_ge <= 4'd9;
            reg_miao_shi <= 3'd5;
            reg_fen_ge <= 4'd9;
            reg_fen_shi <= 3'd5;
            reg_shi_ge <= 4'd3;
            reg_shi_shi <= 2'd2;
        end
        else
        begin
            case({~second_counter_key,~second_countdown_key})
                2'b10://秒表功能
                begin
                    reg_haomiao_ge <= counter_haomiao_ge;
                    reg_haomiao_shi <= counter_haomiao_shi;
                    reg_miao_ge <= counter_miao_ge;
                    reg_miao_shi <= counter_miao_shi;
                    reg_fen_ge <= counter_fen_ge;
                    reg_fen_shi <= counter_fen_shi;
                    reg_shi_ge <= counter_shi_ge;
                    reg_shi_shi <= counter_shi_shi;
                end
                2'b01://倒計(jì)時(shí)功能
                begin
                    reg_haomiao_ge <= countdown_haomiao_ge;
                    reg_haomiao_shi <= countdown_haomiao_shi;
                    reg_miao_ge <= countdown_miao_ge;
                    reg_miao_shi <= countdown_miao_shi;
                    reg_fen_ge <= 4'hf;             //不進(jìn)行顯示
                    reg_fen_shi <= 3'b111;          //不進(jìn)行顯示
                    reg_shi_ge <= 4'b1111;          //不進(jìn)行顯示
                    reg_shi_shi <= 2'b11;           //不進(jìn)行顯示
                end
                default://正常功能,顯示時(shí)分秒
                begin
                    reg_haomiao_ge <= 4'hf;         //不進(jìn)行顯示
                    reg_haomiao_shi <= 4'hf;        //不進(jìn)行顯示
                    reg_miao_ge <= miao_ge;
                    reg_miao_shi <= miao_shi;
                    reg_fen_ge <= fen_ge;
                    reg_fen_shi <= fen_shi;
                    reg_shi_ge <= shi_ge;
                    reg_shi_shi <= shi_shi;
                end
            endcase
        end
    end
    //****************************************************************************************************
    //  模塊名稱:譯碼電路
    //  功能描述:
    //****************************************************************************************************
    always @(posedge clk)//敏感信號(hào)列表reg_haomiao_ge or miao_ge or miao_shi or fen_ge or fen_shi or shi_ge or shi_shi or select
    begin 
        if(select == 3'd0)
        begin
            wei <= 8'b11111110;//毫秒個(gè)位數(shù)顯示
            case(reg_haomiao_ge)
                4'b0000:duan <= 8'b1100_0000;//0
                4'b0001:duan <= 8'b1111_1001;//1
                4'b0010:duan <= 8'b1010_0100;//2
                4'b0011:duan <= 8'b1011_0000;//3
                4'b0100:duan <= 8'b1001_1001;//4
                4'b0101:duan <= 8'b1001_0010;//5
                4'b0110:duan <= 8'b1000_0010;//6
                4'b0111:duan <= 8'b1111_1000;//7
                4'b1000:duan <= 8'b1000_0000;//8
                4'b1001:duan <= 8'b1001_0000;//9
                default:duan <= 8'hff;
            endcase
        end
        else if(select == 3'd1)
        begin
            wei <= 8'b11111101;//毫秒十位數(shù)顯示
            case(reg_haomiao_shi)
                4'b0000:duan <= 8'b1100_0000;//0
                4'b0001:duan <= 8'b1111_1001;//1
                4'b0010:duan <= 8'b1010_0100;//2
                4'b0011:duan <= 8'b1011_0000;//3
                4'b0100:duan <= 8'b1001_1001;//4
                4'b0101:duan <= 8'b1001_0010;//5
                4'b0110:duan <= 8'b1000_0010;//6
                4'b0111:duan <= 8'b1111_1000;//7
                4'b1000:duan <= 8'b1000_0000;//8
                4'b1001:duan <= 8'b1001_0000;//9
                default:duan <= 8'hff;
            endcase
        end
        else if(select == 3'd2)
        begin
            wei <= 8'b11111011;//秒個(gè)位數(shù)顯示
            case(reg_miao_ge)
                4'b0000:duan <= 8'b1100_0000;//0
                4'b0001:duan <= 8'b1111_1001;//1
                4'b0010:duan <= 8'b1010_0100;//2
                4'b0011:duan <= 8'b1011_0000;//3
                4'b0100:duan <= 8'b1001_1001;//4
                4'b0101:duan <= 8'b1001_0010;//5
                4'b0110:duan <= 8'b1000_0010;//6
                4'b0111:duan <= 8'b1111_1000;//7
                4'b1000:duan <= 8'b1000_0000;//8
                4'b1001:duan <= 8'b1001_0000;//9
                default:duan <= 8'hff;
            endcase
        end

        else if(select == 3'd3)
        begin
            wei <= 8'b11110111;//秒十位數(shù)顯示
            case(reg_miao_shi)
                3'b000:duan <= 8'b1100_0000;
                3'b001:duan <= 8'b1111_1001;
                3'b010:duan <= 8'b1010_0100;
                3'b011:duan <= 8'b1011_0000;
                3'b100:duan <= 8'b1001_1001;
                3'b101:duan <= 8'b1001_0010;
                3'b110:duan <= 8'b1000_0010;
                default:duan <= 8'hff;
            endcase
        end

        else if(select == 3'd4)
        begin
            wei <= 8'b11101111;//分鐘個(gè)位數(shù)顯示
            case(reg_fen_ge)
            4'b0000:duan <= 8'b1100_0000;
            4'b0001:duan <= 8'b1111_1001;
            4'b0010:duan <= 8'b1010_0100;
            4'b0011:duan <= 8'b1011_0000;
            4'b0100:duan <= 8'b1001_1001;
            4'b0101:duan <= 8'b1001_0010;
            4'b0110:duan <= 8'b1000_0010;
            4'b0111:duan <= 8'b1111_1000;
            4'b1000:duan <= 8'b1000_0000;
            4'b1001:duan <= 8'b1001_0000;
            default:duan <= 8'hff;
            endcase
        end

        else if(select == 3'd5)
        begin
            wei <= 8'b11011111;//分鐘十位數(shù)顯示
            case(reg_fen_shi)
            3'b000:duan <= 8'b1100_0000;
            3'b001:duan <= 8'b1111_1001;
            3'b010:duan <= 8'b1010_0100;
            3'b011:duan <= 8'b1011_0000;
            3'b100:duan <= 8'b1001_1001;
            3'b101:duan <= 8'b1001_0010;
            3'b110:duan <= 8'b1000_0010;
            default:duan <= 8'hff;
            endcase
        end

        else if(select == 3'd6)
        begin
            wei <= 8'b10111111;//時(shí)鐘個(gè)位數(shù)顯示
            case(reg_shi_ge)
            4'b0000:duan <= 8'b1100_0000;
            4'b0001:duan <= 8'b1111_1001;
            4'b0010:duan <= 8'b1010_0100;
            4'b0011:duan <= 8'b1011_0000;
            default:duan <= 8'hff;
            endcase
        end

        else 
            begin
            wei <= 8'b01111111;//時(shí)鐘十位數(shù)顯示
            case(reg_shi_shi)
            3'b000:duan <= 8'b1100_0000;
            3'b001:duan <= 8'b1111_1001;
            3'b010:duan <= 8'b1010_0100;
            default:duan <= 8'hff;
            endcase
        end
    end
endmodule

到了這里,關(guān)于基于FPGA的數(shù)字秒表設(shè)計(jì)(完整工程)的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來(lái)自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • 數(shù)字電路13-任意進(jìn)制計(jì)數(shù)器設(shè)計(jì)

    數(shù)字電路13-任意進(jìn)制計(jì)數(shù)器設(shè)計(jì)

    因?yàn)槭忻嫔系倪M(jìn)制計(jì)數(shù)器的種類(lèi)優(yōu)先,所以需要特定進(jìn)制時(shí),只能自己在已有產(chǎn)品的基礎(chǔ)上構(gòu)成需要的特定進(jìn)制。 十進(jìn)制計(jì)數(shù)器也是通過(guò)4位二進(jìn)制計(jì)數(shù)器,去掉多余狀態(tài)所得 根據(jù)十進(jìn)制計(jì)數(shù)器,可得M進(jìn)制計(jì)數(shù)器的特點(diǎn),即狀態(tài)數(shù)、脈沖數(shù)、末狀態(tài) 如前面的十進(jìn)制計(jì)數(shù)器,

    2024年02月07日
    瀏覽(26)
  • 藍(lán)橋杯單片機(jī)學(xué)習(xí)6——定時(shí)器/計(jì)數(shù)器&定時(shí)器實(shí)現(xiàn)秒表功能

    藍(lán)橋杯單片機(jī)學(xué)習(xí)6——定時(shí)器/計(jì)數(shù)器&定時(shí)器實(shí)現(xiàn)秒表功能

    上一期我們學(xué)習(xí)了外部中斷的相關(guān)內(nèi)容,現(xiàn)在我接著來(lái)學(xué)習(xí)定時(shí)器。 定時(shí)器/計(jì)數(shù)器是一種能夠?qū)?nèi)部時(shí)鐘信號(hào)或者外部輸入信號(hào)進(jìn)行計(jì)數(shù),當(dāng)計(jì)數(shù)值達(dá)到設(shè)定要求時(shí),向CPU提出中斷請(qǐng)求,從而實(shí)現(xiàn)定時(shí)或計(jì)數(shù)功能的外設(shè)。定時(shí)器的基本工作原理是進(jìn)行計(jì)數(shù)。 舉個(gè)栗子 :你可

    2024年02月04日
    瀏覽(21)
  • 【FPGA】Verilog:時(shí)序電路設(shè)計(jì) | 二進(jìn)制計(jì)數(shù)器 | 計(jì)數(shù)器 | 分頻器 | 時(shí)序約束

    【FPGA】Verilog:時(shí)序電路設(shè)計(jì) | 二進(jìn)制計(jì)數(shù)器 | 計(jì)數(shù)器 | 分頻器 | 時(shí)序約束

    前言: 本章內(nèi)容主要是演示Vivado下利用Verilog語(yǔ)言進(jìn)行電路設(shè)計(jì)、仿真、綜合和下載 示例:計(jì)數(shù)器與分頻器 ? ?? 功能特性:?采用?Xilinx Artix-7 XC7A35T芯片? 配置方式:USB-JTAG/SPI Flash 高達(dá)100MHz 的內(nèi)部時(shí)鐘速度? 存儲(chǔ)器:2Mbit SRAM ??N25Q064A SPI Flash(樣圖舊款為N25Q032A) 通用

    2024年02月02日
    瀏覽(34)
  • 【FPGA】Verilog:時(shí)序電路設(shè)計(jì) | 自循環(huán)移位寄存器 | 環(huán)形計(jì)數(shù) | 扭環(huán)計(jì)數(shù) | 約翰遜計(jì)數(shù)器

    【FPGA】Verilog:時(shí)序電路設(shè)計(jì) | 自循環(huán)移位寄存器 | 環(huán)形計(jì)數(shù) | 扭環(huán)計(jì)數(shù) | 約翰遜計(jì)數(shù)器

    前言: 本章內(nèi)容主要是演示Vivado下利用Verilog語(yǔ)言進(jìn)行電路設(shè)計(jì)、仿真、綜合和下載 示例:計(jì)數(shù)器 ? ?? 功能特性:?采用?Xilinx Artix-7 XC7A35T芯片? 配置方式:USB-JTAG/SPI Flash 高達(dá)100MHz 的內(nèi)部時(shí)鐘速度? 存儲(chǔ)器:2Mbit SRAM ??N25Q064A SPI Flash(樣圖舊款為N25Q032A) 通用IO:Switch :

    2024年02月10日
    瀏覽(110)
  • 【FPGA零基礎(chǔ)學(xué)習(xí)之旅#7】BCD計(jì)數(shù)器設(shè)計(jì)

    【FPGA零基礎(chǔ)學(xué)習(xí)之旅#7】BCD計(jì)數(shù)器設(shè)計(jì)

    ??歡迎來(lái)到FPGA專欄~BCD計(jì)數(shù)器設(shè)計(jì) ☆* o(≧▽≦)o *☆ 嗨 ~我是 小夏與酒 ?? ? 博客主頁(yè): 小夏與酒的博客 ??該系列 文章專欄: FPGA學(xué)習(xí)之旅 文章作者技術(shù)和水平有限,如果文中出現(xiàn)錯(cuò)誤,希望大家能指正?? ?? 歡迎大家關(guān)注! ?? 頂層模塊中的BCD模塊級(jí)聯(lián): Verilog實(shí)現(xiàn)

    2024年02月08日
    瀏覽(24)
  • FPGA設(shè)計(jì)開(kāi)發(fā)(基礎(chǔ)課題):74LS160計(jì)數(shù)器芯片設(shè)計(jì)

    FPGA設(shè)計(jì)開(kāi)發(fā)(基礎(chǔ)課題):74LS160計(jì)數(shù)器芯片設(shè)計(jì)

    一、設(shè)計(jì)目的 1、學(xué)會(huì)用HDL語(yǔ)言設(shè)計(jì)時(shí)序電路; 2、用HDL語(yǔ)言設(shè)計(jì)74LS160計(jì)數(shù)器芯片的數(shù)字功能。 二、設(shè)計(jì)原理 計(jì)數(shù)器是最常用的寄存器邏輯電路,從微處理器的地址發(fā)生器到頻率計(jì)都需要用到計(jì)數(shù)器。一般計(jì)數(shù)器可以分為兩類(lèi):加法計(jì)數(shù)器和減法計(jì)數(shù)器。加法計(jì)數(shù)器每來(lái)一個(gè)

    2024年02月08日
    瀏覽(23)
  • Verilog數(shù)字系統(tǒng)設(shè)計(jì)——10進(jìn)制計(jì)數(shù)器,具有異步復(fù)位功能

    Verilog數(shù)字系統(tǒng)設(shè)計(jì)——10進(jìn)制計(jì)數(shù)器,具有異步復(fù)位功能

    編程實(shí)現(xiàn)10進(jìn)制計(jì)數(shù)器,具有異步復(fù)位功能,十位和個(gè)位用8421BCD碼表示,各端口定義如下圖所示: 仔細(xì)考慮端口定義中每個(gè)端口的含義; 要求完成程序編輯、編譯、時(shí)序仿真; 實(shí)驗(yàn)提交Verilog設(shè)計(jì)文件(.v文件)、仿真波形截圖以及對(duì)于第3個(gè)步驟所提出問(wèn)題的回答,文件打包

    2024年02月11日
    瀏覽(19)
  • 【FPGA】時(shí)序邏輯電路——基于計(jì)數(shù)器實(shí)現(xiàn)一個(gè)以1秒頻率閃爍的LED燈

    【FPGA】時(shí)序邏輯電路——基于計(jì)數(shù)器實(shí)現(xiàn)一個(gè)以1秒頻率閃爍的LED燈

    1 D觸發(fā)器 分析: 特性:輸出端Q只在CK處于上升沿的時(shí)候變化 圖中波形的形成過(guò)程: 當(dāng)D處于高電平時(shí),CK未處于上升沿時(shí),Q仍處于低電平 當(dāng)CK來(lái)到上升沿,Q需要根據(jù)D發(fā)生變化,由于D是高電平,所以Q要從低電平變化成高電平 D從高電平變化成低電平,但是此時(shí)CK未來(lái)到上升沿

    2024年02月09日
    瀏覽(18)
  • 數(shù)字邏輯實(shí)驗(yàn)之利用D觸發(fā)器,設(shè)計(jì)并實(shí)現(xiàn)三位扭環(huán)計(jì)數(shù)器

    數(shù)字邏輯實(shí)驗(yàn)之利用D觸發(fā)器,設(shè)計(jì)并實(shí)現(xiàn)三位扭環(huán)計(jì)數(shù)器

    【 實(shí)驗(yàn)要求 】: 采用Moore(摩爾型)電路,利用D觸發(fā)器,設(shè)計(jì)并實(shí)現(xiàn)三位扭環(huán)計(jì)數(shù)器并用Verilog編程語(yǔ)言寫(xiě)出其代碼。 【 實(shí)驗(yàn)?zāi)康?】? 掌握時(shí)序邏輯電路的設(shè)計(jì)方法; 熟悉Vivado2014集成開(kāi)發(fā)環(huán)境和; 實(shí)現(xiàn)如下圖所示的三位扭環(huán)計(jì)數(shù)器。 ? 【 實(shí)驗(yàn)環(huán)境 】 FPGA虛擬仿真平臺(tái)。

    2024年02月03日
    瀏覽(113)
  • 基于STM32的四位數(shù)碼管計(jì)數(shù)器設(shè)計(jì)與實(shí)現(xiàn)

    基于STM32的四位數(shù)碼管計(jì)數(shù)器設(shè)計(jì)與實(shí)現(xiàn)

    ?作者簡(jiǎn)介:熱愛(ài)科研的嵌入式開(kāi)發(fā)者,修心和技術(shù)同步精進(jìn), 代碼獲取、問(wèn)題探討及文章轉(zhuǎn)載可私信。 ???愿你的生命中有夠多的云翳,來(lái)造就一個(gè)美麗的黃昏。 ??獲取更多嵌入式資料可點(diǎn)擊鏈接進(jìn)群領(lǐng)取,謝謝支持!?? 點(diǎn)擊領(lǐng)取更多詳細(xì)資料 本文介紹了一種基于STM

    2024年02月02日
    瀏覽(27)

覺(jué)得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包