当前位置:网站首页>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

边栏推荐
- Fine-grained Fact Verification with Kernel GA Network
- Soft exam review summary
- Visual Studio 2012/2015发布Web应用连同.cs源码一起发布
- Verilog 每日一题 (VL28 加减计数器)
- Create a custom paging control
- Read excel xlsx format file in unity
- Unity shader texture animation
- The practice of beego framework in goweb development: Section I Introduction to beego framework
- 解决SQL Server数据库独占的问题
- C # traversal set
猜你喜欢

Verilog 每日一题(VL14 自动贩售机1--FSM常见题型)

配置V530交换机步骤

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

Unity3d shader achieves ablation effect

Problem solution of code heartstrings Junior Group (official competition) of Dalian University of Technology (Development Zone campus) in 2021

kubernetes service 原理解析

我为什么选择使用Go语言?

格雷码和二进制的转换及典型例题(4bits格雷码计数器)

Re10: are we really making much progress? Revisiting, benchmarking, and refining heterogeneous gr

Microservice Architecture - service registry and service gateway (6.8) (Reprint)
随机推荐
批量下载文件
Shopee code League 2022 - qualification round p3.connecting the numbers (segment tree / bipartite graph determination, to be discussed)
kubernetes service 原理解析
GEAR: Graph-based Evidence Aggregating and Reasoning for Fact Verification
Create a custom paging control
Problem solution of code heartstrings Junior Group (official competition) of Dalian University of Technology (Development Zone campus) in 2021
Verilog 每日一题(VL8 使用generate…for语句简化代码)
数据库故障容错之系统时钟故障
Jupyter notebook win installation record
Analysis of kubernetes service principle
The practice of beego framework developed by goweb: Section 4 database configuration and connection
The 2021 ICPC ASIA Taipei Regional programming contest L. leadfoot (combinatorics /2-adic assignment function +kummer theorem)
: No such file or directory
Verilog 每日一题 (VL27 可置位计数器)
WPF command button transparent style
Unity shader depth of field effect
Games101 assignment04 job 04
Codeworks round 801 (Div. 2) and epic Institute of technology round D. tree queries (tree DP)
Read excel xlsx format file in unity
Andthen of function interface