zoukankan      html  css  js  c++  java
  • 视频信号中xyz的提取

    视频信号中xyz的提取

    `timescale 1ns / 1ps
    //////////////////////////////////////////////////////////////////////////////////
    // Company: 
    // Engineer: chensimin
    // 
    // Create Date: 2019/01/15 11:52:24
    // Design Name: 
    // Module Name: detect_video
    // Project Name: 
    // Target Devices: 
    // Tool Versions: 
    // Description: 
    // 
    // Dependencies: 
    // 
    // Revision:
    // Revision 0.01 - File Created
    // Additional Comments:
    // 
    //////////////////////////////////////////////////////////////////////////////////
    
    
    module detect_video(
    
        input    wire          clk,
        input    wire          rst,
    
        output   reg   [9:0]   vid_out = 0 ,
    
        output   wire          xyz
    
        );
    
    
    //------------------------------------------------------------------
    
    reg  [7:0] i = 0;
    
    always @(posedge clk or posedge rst)
    begin
        if(rst)
        begin
            i       <= 0;
            vid_out <= 10'h000;
        end 
        else 
        begin
            case(i)
            0:
            begin
                i <= i + 1'b1;
                vid_out <= 10'h000;
            end
            1:
            begin
                i <= i + 1'b1;
                vid_out <= 10'h3FF;
            end
            2:
            begin
                i <= i + 1'b1;
                vid_out <= 10'h000;
            end
            3:
            begin
                i <= i + 1'b1;
                vid_out <= 10'h000;
            end        
            4:
            begin
                i <= i + 1'b1;
                vid_out <= 10'h274;
            end    
            5:
            begin
                i <= i + 1'b1;
                vid_out <= 10'h000;        
            end    
            6:
            begin
                i <= i + 1'b1;
                vid_out <= 10'h080;        
            end        
            default:
            begin
                i <= i;
                vid_out <= 10'h000;
            end
            endcase 
        end 
    end
    
    
    
    detect_xyz U0 (
    
        .clk(clk),
        .rst(rst),
        .vid_in(vid_out),
        .xyz(xyz)
    );
    
    
    endmodule
    
    
    
    /*
    
    
    
    add_force {/detect_video/clk} -radix hex {1 0ns} {0 50000ps} -repeat_every 100000ps
    add_force {/detect_video/rst} -radix hex {1 0ns} {0 200ns}
    
    
    
    */
    `timescale 1ns / 1ps
    //////////////////////////////////////////////////////////////////////////////////
    // Company: 
    // Engineer: chensimin
    // 
    // Create Date: 2019/01/15 13:30:22
    // Design Name: 
    // Module Name: detect_xyz
    // Project Name: 
    // Target Devices: 
    // Tool Versions: 
    // Description: 
    // 
    // Dependencies: 
    // 
    // Revision:
    // Revision 0.01 - File Created
    // Additional Comments:
    // 
    //////////////////////////////////////////////////////////////////////////////////
    
    
    module detect_xyz (
    
        input        wire               clk,
        input        wire               rst,
        input        wire       [9:0]   vid_in,
    
        output       reg                xyz
    
        );
    
    
    //------------------------------------------------------------------
    
    reg [9:0]vid_in_delay_0 = 0;
    reg [9:0]vid_in_delay_1 = 0;
    
    reg xyz = 0;
    
    always @(posedge clk or posedge rst)
    begin
        if(rst)
        begin
            vid_in_delay_0 <= 10'h000;
            vid_in_delay_1 <= 10'h000;
        end
    
        else 
        begin
            vid_in_delay_0 <= vid_in;
            vid_in_delay_1 <= vid_in_delay_0;
    
            if( vid_in_delay_1 == 10'h3FF && vid_in_delay_0 == 10'h000 
                && vid_in == 10'h000)
                xyz <= 1;
            else 
                xyz <= 0;
        end
    end
    
    
    endmodule

    仿真结果:

  • 相关阅读:
    解决 src/MD2.c:31:20: fatal error: Python.h: No such file or directory安装包错误
    Java 保存对象到文件并恢复 ObjectOutputStream/ObjectInputStream
    Elasticsearch安装配置和测试
    [知识图谱] 环境配置:Java8 + Maven3 + HBase + Titan
    Java8安装配置
    MongoDB 安装、运行、使用、数据恢复
    Java堆空间溢出解决方法 Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
    服务器重装和配置:Ubuntu16.04 + Anaconda3 + GTX1080驱动 + CUDA8 + cuDNN + 常用工具安装
    [Linux] 输出文件的指定行
    [Linux] sed命令使用之在文件中快速删除/增加指定行
  • 原文地址:https://www.cnblogs.com/chensimin1990/p/10271644.html
Copyright © 2011-2022 走看看