Question

Register File Consider the following register file, that provide one write port and two read ports....

Register File

Consider the following register file, that provide one write port and two read ports. A register is updated on the positive edge on the clock if dw=1. Data is written to rd. The two read ports are: rn and rm.

typedef logic [15:0] reg16_t;
typedef logic [2:0] reg_sel_t;

module reg_file(
    output reg16_t rn, rm, input reg16_t rd,
    input reg_sel_t n, m, d,
    input logic dw, reset, clk
);

Use behavioural Verilog to implement reg_file.

module reg_file(
output reg16_t rn, rm, input reg16_t rd,
input reg_sel_t n, m, d,
input logic dw, reset, clk
);

endmodule

0 0
Add a comment Improve this question Transcribed image text
Answer #1

module reg_ file(

output reg16_ t rn,rm,input reg16_t Rd,

input reg_sel_t n,m,d

input ligic dw,reset,clk

);

Add a comment
Know the answer?
Add Answer to:
Register File Consider the following register file, that provide one write port and two read ports....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • VERILOG Three Minute Alarm A three minute alarm can constructed with two counters and two comparators....

    VERILOG Three Minute Alarm A three minute alarm can constructed with two counters and two comparators. The counter's have an enable input that must be 1 for the count to increment. The counters can be set to 0 with the reset port. The counter for seconds is connected to a comparator that looks for 59. This comparator should be used to enable the minute counter, and reset the second's counter. The minute counter is connected to a comparator looking for...

  • Objective: Creating a register file (memory) using Verilog. The register file is made up of four registers and each...

    Objective: Creating a register file (memory) using Verilog. The register file is made up of four registers and each register holds one nibble (half a byte, i.e., four bits) 3. Create a D flip-flop AD flip-flop holds 1 bit of data, and it only changes its data when the clock changes. We want a positive edge triggered flip-flop. Design your Verilog D flip-flop, so we will create them now. Enter the 2 to 4 line decoder. We will need two...

  • EEL4768C Lab Assignment 6 (40 points) Due 7/24/2018, 11:59 pm on Canvas Register file is an...

    EEL4768C Lab Assignment 6 (40 points) Due 7/24/2018, 11:59 pm on Canvas Register file is an important state element of the MIPS processor. Consider the register file shown below. The register file can read and write the data into the registers. The register file has two read ports (A1, A2) and one write port (A3). The width of Al, A2 and A3 is 5 bits. Writing data into the register is synchronized with the clock signal. WE is the write...

  • Use the Quartus Prime Text Editor to implement a structural model of the 4-bit data register show...

    Use the Quartus Prime Text Editor to implement a structural model of the 4-bit data register shown above in a file named reg_4bit.sv. Specify the 4-bit data register’s module according to the interface specification given in the table below. Port Mode Data Type Size Description RST in logic 1-bit Active high asynchronous reset CLK in logic 1-bit Synchronizing clock signal EN in logic 1-bit Synchronous clock enable D in logic vector 4-bits Synchronous data input Q out logic vector 4-bits...

  • a Read the following codes in Verilog and the corresponding testbench file. Describe what the codes...

    a Read the following codes in Verilog and the corresponding testbench file. Describe what the codes are doing by adding comments in the code. Then write down the simulation results of res1, res2, res3, and res4, respectively. Source code module vector_defn (num1, res1, res2, res3, res4); input [7:0] num1; output res1; output [3:0] res2; output [0:7] res3; output [15:0] res4; assign res1=num1[2]; assign res2=num1[7:4]; assign res3=num1; assign res4={2{num1}}; endmodule testbench: `timescale 1ns / 1ps module vector_defn_tb; reg [7:0] in1; wire...

  • Problem: Design a clocked synchronous state machine with two inputs A, and B, and a single...

    Problem: Design a clocked synchronous state machine with two inputs A, and B, and a single output Z that is 1 is: .A had the same value at each of the two previous clock ticks, or B has been 1 since the last time that the first condition was true. In-Lab 1. 2. 3. 4. For the finite state machine (FSM), identify the minimum number of states required Draw the state transition diagram Complete the state transition table Derive the...

  • In this question, you are asked to construct a register file with one input port and...

    In this question, you are asked to construct a register file with one input port and two output ports. The register file contains two registers and each register stores a 2-bit data. You are allowed to use D flip-flops, 2-to-1 1-bit MUXs, and 1-to-2 decoders with enable only. Draw a circuit diagram for the register file. Please label your diagram clearly (especially the signals on the MUXs and decoders).

  • How do I change these modules so that the communication is bidirectional (inout)? I'm simply not ...

    How do I change these modules so that the communication is bidirectional (inout)? I'm simply not sure how to modify the code. I know i need to add an inout port but I don't know how to do it. I have watched multiple tutorials but I can't figure it out. module mem( input logic clk, we , // write enable bit, active low input logic [n-1:0] in , input logic [m-1:0] addr , output logic [n-1:0] out ) ; parameter...

  • How do I change these modules so that the communication is bidirectional (inout)? I'm simply not...

    How do I change these modules so that the communication is bidirectional (inout)? I'm simply not sure how to modify the code. I know i need to add an inout port but I don't know how to do it. I have watched multiple tutorials but I can't figure it out. module mem( input logic clk, we , // write enable bit, active low input logic [n-1:0] in , input logic [m-1:0] addr , output logic [n-1:0] out ) ; parameter...

  • Given the following verilog code, draw the corresponding state diagram for it. module mysterious (input reset,...

    Given the following verilog code, draw the corresponding state diagram for it. module mysterious (input reset, clk, TB, TA, output reg [1:0] LB, LA); reg [1:0] cstate, nstate; parameter S0 = 2'b00; parameter S1 = 2'b01; parameter S2 = 2'b10; parameter S3 = 2'b11; parameter grn = 2'b00; parameter ylw = 2'b01; parameter rd = 2'b10; // state register always @ (posedge clk, posedge reset) begin if (reset) cstate <= S0; else cstate <= nstate; end // next state logic...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT