Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can someone write a test bench for this 4x16 register file in verilog `timescale 1ns / 1ns module regfile4x16a (input clk, input write, input [2:0]

 Can someone write a test bench for this 4x16 register file in verilog `timescale 1ns / 1ns module regfile4x16a (input clk, input write, input [2:0] wrAddr, input [15:0] wrData, input [2:0] rdAddrA, output [15:0] rdDataA, input [2:0] rdAddrB, output [15:0] rdDataB); reg [15:0] reg0, reg1, reg2, reg3; assign rdDataA = rdAddrA == 0 ? reg0 : rdAddrA == 1 ? reg1 : rdAddrA == 2 ? reg2 : rdAddrA == 3 ? reg3 : 0; assign rdDataB = rdAddrB == 0 ? reg0 : rdAddrB == 1 ? reg1 : rdAddrB == 2 ? reg2 : rdAddrB == 3 ? reg3 : 0; always @(posedge clk) begin if (write) case (wrAddr) 0: begin reg0 <= wrData; end 1: begin reg1 <= wrData; end 2: begin reg2 <= wrData; end 3: begin reg3 <= wrData; end endcase // case (wrAddr) end // always @ (posedge clk) endmodule

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems 25th European Conference Adbis 2021 Tartu Estonia August 24 26 2021 Proceedings Lncs 12843

Authors: Ladjel Bellatreche ,Marlon Dumas ,Panagiotis Karras ,Raimundas Matulevicius

1st Edition

3030824713, 978-3030824716

More Books

Students also viewed these Databases questions

Question

what are the provisions in the absence of Partnership Deed?

Answered: 1 week ago

Question

1. What is called precipitation?

Answered: 1 week ago

Question

1.what is dew ?

Answered: 1 week ago

Question

General Purpose of Your Speech Analyzing Your Audience

Answered: 1 week ago

Question

Ethical Speaking: Taking Responsibility for Your Speech?

Answered: 1 week ago