Question

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 enable control signal. WD contains the data for the write operation Implement the register file in VHDL/Verilog. CLK A1 A2 RD2 3 ?? WD3 Register
0 0
Add a comment Improve this question Transcribed image text
Answer #1

module register_file (input [4:0] A1, A2, A3, input [31:0] WD3,
output reg [31:0] RD1, RD2,
input CLK, input WE3);

// register is the memory with 32 Different address and width size is also 32
reg [31:0] register [0:31];

// Reading data with corresponding read address A1 and A2
always @(posedge CLK) begin
RD1 <= register[A1];

RD2 <= register[A2];
end

// Writting Data to register number A3 with WE3 = 1 and WD3 = valid write data
always @ (posedge CLK) begin
if (WE3) register[A3] <= WD3;
end

Add a comment
Know the answer?
Add Answer to:
EEL4768C Lab Assignment 6 (40 points) Due 7/24/2018, 11:59 pm on Canvas Register file is an...
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
  • 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...

  • 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...

  • Question 1 Figure 1 shows a datapath for R-type instructions which consits of a register file...

    Question 1 Figure 1 shows a datapath for R-type instructions which consits of a register file and an arithmetic logic unit (ALU). These instructions are also known as aritmetic-logical- instructions since they perform aritmetic or logical operations. The register file contains all the registers and provides two read ports and one write port. The register file always provides the contents of the registers corresponding to the read register inputs on the outputs, while the writes must be explicitly controlled with...

  • 4. List the values on the control signals for the following instructions. The MIPS architecture and...

    4. List the values on the control signals for the following instructions. The MIPS architecture and instruction formats studied in class are shown below for reference. Your answer needs to be 1, 0, or X for each signal (a 0 or 1 will not be accepted as a substitute for X) MemtoReg MemWriteBranchALUSrc RegDst RegWrite sub r2, r5, r23 beq rl, r3, L2 sw rl, 36(r4) lw r3,100(r6) addi r2,rl4,-24 j L3 ontro Unit Write ranch PCSrc Op Funct LUSre...

  • Assignment: Implement an 8 bit register in VHDL/Verilog using Model Sim software. Show two test cases...

    Assignment: Implement an 8 bit register in VHDL/Verilog using Model Sim software. Show two test cases for data read and write into the register. The register has an enable and reset signal. When the reset is high the register should be cleared. When the enable is high and reset is low, data should be written into the register. Hint: The demo code shown below has the implementation for a 4-bit register that can be used as an example. library ieee;...

  • In this lab, you will design a finite state machine to control the tail lights of...

    In this lab, you will design a finite state machine to control the tail lights of an unsual car. There are three lights on each side that operate in sequence to indicate thedirection of a turn. Figure ! shows the tail lights and Figure 2 shows the flashing sequence for (a) left turns and (b) right rums. ZOTTAS Figure 28:8: BCECECece BCECECECes BCECECECB BCECECBCB 8888 Figure 2 Part 1 - FSM Design Start with designing the state transition diagram for...

  • There is an example below Now that everything is working you can try the following exercises. To complete them you wi...

    There is an example below Now that everything is working you can try the following exercises. To complete them you will need to refer to the documentation in Appendix A The MiteASM Assembler and Appendix B The MiteFPGA Processor. Write an assembly language program for an over counter for a cricket umpire. This should 1. display a count on the 7-segment display. The count should increase by 1 when button 0 is pressed. It should reset to 0 when button...

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