当前位置:网站首页>Verilog daily question (simple implementation of VL30 RAM)
Verilog daily question (simple implementation of VL30 RAM)
2022-07-28 17:22:00 【Don't make any more errors】
Title Description :
Achieve one Depth is 256, The seat width is 4bit Dual port RAM, All data are initialized to 0000. There are two sets of ports , Used for reading data and writing data respectively , Read and write operations can be performed simultaneously . When reading data indication signal read_en Is valid , By reading the address signal read_addr Read the data in the corresponding position read_data, And the output ; When writing data indication signal write_en Is valid , By writing the address signal write_addr And write data write-data, Write the corresponding data to the corresponding position .
The signal interface diagram of the program is as follows :

`timescale 1ns/1ns
module ram_mod(
input clk,
input rst_n,
input write_en,
input [7:0]write_addr,
input [3:0]write_data,
input read_en,
input [7:0]read_addr, // Address width log2(256)-1 = 7.
output reg [3:0]read_data
);
// Write data , Depth is 256, Storable 2^8=256 Data , Declaration array array
reg [3:0] array [255:0];
integer i;
always @(posedge clk or negedge rst_n) begin
if(!rst_n) begin
for(i=0;i<=255;i=i+1)
array[i] = 0; // Set all zeros
end
else
array[write_addr] =(write_en)? write_data:array[write_addr];
// According to the energy signal write_en, To declare the input address and data ( My understanding is to define a pointer )
end
// Read it ,
reg [3:0] data;
always @(posedge clk or negedge rst_n) begin
if(!rst_n) read_data = 0; // Asynchronous zeroing
else read_data =(read_en)? array[read_addr]:read_data;
// The enable signal is 1 Read only when
end
endmodule// I'd like to review counting electricity when I'm free RAM Details of this part

边栏推荐
- Azure Devops developed by visual studio 2015 team
- Codeforces round 770 (Div. 2) F. Fibonacci additions (construction + difference)
- 侦察机与预警机的区别
- Games101-assignment05 ray tracing - rays intersect triangles
- Verilog 每日一题 (VL24 多bit MUX同步器 跨时域输出)
- Problem solution of code heartstrings Junior Group (official competition) of Dalian University of Technology (Development Zone campus) in 2021
- The actual combat of the beego framework of goweb development: Section III program execution process analysis
- 带参数的微信小程序二维码生成
- 高速电路中电阻的选择
- Unity shader uses rendered texture to achieve glass effect
猜你喜欢

Goweb开发之Beego框架实战:第二节 项目初始化配置

线性代数及矩阵论(七)

How do we do full link grayscale on the database?

Atcoder regular contest 133 d.range XOR (digital dp+ classification discussion)

Unity editor learning (I) using features to change the display of fields in components

线性代数及矩阵论(九)

总数据量超万亿行,玉溪卷烟厂通过正确选择时序数据库轻松应对

The actual combat of the beego framework of goweb development: Section III program execution process analysis

飞马D200S无人机与机载激光雷达在大比例尺DEM建设中的应用

net框架
随机推荐
Valarray Library Learning
Andthen of function interface
MySQL详细学习教程(建议收藏)
Ugui learning notes (IV) ugui event system overview and Usage Summary
Codeworks round 801 (Div. 2) and epic Institute of technology round D. tree queries (tree DP)
The maximum recommended number of rows for MySQL is 2000W. Is it reliable?
Kubernetes service and ingress you need to master
高速电路中电容的选型和应用——详解
C # traversal set
Unity shader depth of field effect
Jupyter notebook win installation record
Steps to configure V530 switch
WPF command button transparent style
The practice of the beego framework for goweb development: Section V project construction and user registration
异步电路设计--同步脉冲器原理及例题
在android开发过程中遇到.sqlite文件处理
Realization of reflection and refraction effect in unity shader cube texture
微信小程序现金红包返回“IP地址非你在商户平台设置的可用IP地址”错误终极解决方法
Verilog 每日一题 (VL24 多bit MUX同步器 跨时域输出)
Verilog 每日一题 (VL28 加减计数器)