本文主要是介绍模拟14位相机输出输入到bram Verilog代码,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1 模拟输出代码
`timescale 1ns / 1psmodule simulate_camera_out (input clk,input rest_n,output camera_clk, //像素时钟output [13:0] camera_data, //像素值数据output [19:0] pixel_xy, //此时输出的像素值坐标output reg frame_valid //帧有效信号,1代表帧有效0代表帧无效
);localparam PIXEL_SIZE = 640 * 512; //输出像素数量localparam PIXEL_VALUE = 16383; //14位1localparam FRAME_DELAY = 100; //延迟100个时钟单位reg [19:0] pixel_count;reg [13:0] out_count;reg [14:0] frame_delay_count;assign camera_clk = clk;assign camera_data = out_count;assign pixel_xy = pixel_count;//计算此时输出的像素坐标,0~640*512-1always @(posedge clk or negedge rest_n) beginif (!rest_n) beginpixel_count <= 0;end else beginif (frame_valid == 0) beginpixel_count <= 0;end else if (pixel_count == PIXEL_SIZE - 1) beginpixel_count <= 0;
这篇关于模拟14位相机输出输入到bram Verilog代码的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!