Question

Design and implement synchronous dual port 128×8 RAM using VHDL. Dual port RAM supports simultane...

Design and implement synchronous dual port 128×8 RAM using VHDL. Dual port RAM supports simultaneous read and write operations.

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

library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;

entity sync_dual_port_ram is
   port (   clock    : in std_logic;
       port0_en: in std_logic;
       port1_en: in std_logic;
       rd_wr   : in std_logic;
       din0   : in std_logic_vector(7 downto 0);
       din1   : in std_logic_vector(7 downto 0);
       addr0   : in std_logic_vector(6 downto 0);
       addr1   : in std_logic_vector(6 downto 0);
       dout0   : out std_logic_vector(7 downto 0);
       dout1   : out std_logic_vector(7 downto 0)
   );
end sync_dual_port_ram;

architecture arch of sync_dual_port_ram is

type memory is array (0 to 127) of std_logic_vector(7 downto 0);
signal ram : memory;

begin

process(clock)
begin
   if rising_edge(clock) then
       if (rd_wr = '0') then
           if (port0_en = '1') then
               ram(conv_integer(addr0)) <= din0;
           end if;
           if (port1_en = '1') then
               ram(conv_integer(addr1)) <= din1;
           end if;
       else
       end if;
   end if;

end process;

process(clock)
begin
   if rising_edge(clock) then
       dout0 <= ram(conv_integer(addr0));
       dout1 <= ram(conv_integer(addr1));
   end if;
end process;

end arch;

----------------------------------------------------------------------------------------------

Wave File Edit View Add Format Tools Bookmarks Window Help Wave -Default Msgs sync dual port ram/portoen sync dual port ram/d

Add a comment
Know the answer?
Add Answer to:
Design and implement synchronous dual port 128×8 RAM using VHDL. Dual port RAM supports simultane...
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
  • Design and implement synchronous dual port 128×8 RAM using VHDL. Dual port RAM supports simultaneous read...

    Design and implement synchronous dual port 128×8 RAM using VHDL. Dual port RAM supports simultaneous read and write operations.

  • Write a behavioral code in Verilog to implement a RAM of 256 words with each word...

    Write a behavioral code in Verilog to implement a RAM of 256 words with each word having 8 bits. RAM must have Enable, Read/Write pins and will have address bus, data bus (for both input and output). Write a testbench and demonstrate the working of all its read/write operations.

  • VIVA QUESTIONS: 1. Implement the following function using VHDL coding. (Try to minimize if you can)....

    VIVA QUESTIONS: 1. Implement the following function using VHDL coding. (Try to minimize if you can). F(A,B,C,D)=(A'+B+C). (A+B'+D'). (B+C'+D') . (A+B+C+D) 2. What will be the no. of rows in the truth table of N variables? 3. What are the advantages of VHDL? 4. Design Ex-OR gate using behavioral model? 5. Implement the following function using VHDL code f=AB+CD. 6. What are the differences between half adder and full adder? 7. What are the advantages of minimizing the logical expressions?...

  • ECE 275 - DIGITAL DESIGN Question 1: (@) Write VHDL code for a 2-to-1 multiplexer. -...

    ECE 275 - DIGITAL DESIGN Question 1: (@) Write VHDL code for a 2-to-1 multiplexer. - (6) Implement - using only the Sunction R= ab h + bch' + eg h + 8 h 2-to-1 multiplexers. Use the 2-to-1 multiplexer VHDL description as a component to write VHDL code for the of Sunction R, from Problem 1 circuit design

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

  • 3-8 decoder vhdl

    Design and implement a circuitry using 3-to-8 decoder and additional gates that has the following functionality: The output of the circuit is 1 when the input 3-bit number is less than 3 or greater than 4. Write a separate 3-to-8 decoder as a component, then use the component as a structural approach for your main code that completes the implementation of the circuit. Provide appropriate testbench timing simulations to make sure all conditions are presented in the simulations. Make sure...

  • VHDL structural code please Design an 8-bit add/subtract in Verilog AND VHDL using any of the...

    VHDL structural code please Design an 8-bit add/subtract in Verilog AND VHDL using any of the coding styles and language features covered so far in modules 8 and 9. When AS Sel0 it performs an addition, else when AS Sel 1 it performs a subtraction. OpA and OpB are assumed to be signed, 2's-Complement numbers. Hint: Bit-wise XOR AS Sel with OpB before adding it to OpA- see lecture notes Op87.0Add/ Subtract Vout

  • Problem 8 (Lab, 20 points) (1) Write a VHDL module implementing a synchronous 16-bit counter. A...

    Problem 8 (Lab, 20 points) (1) Write a VHDL module implementing a synchronous 16-bit counter. A "reset signal resets the counter to 0. An "en" signal enables the counter modification. An "up signal indicates whether the counter must be incremented (1)/decremented (0). (2) The output of the module is the value of the signal, represented as 16 bits wide. Using output timing diagram to verify your coding results.

  • Design and implement a 8 or 6 Port Dip Switch that control 4 LED Lights Components:...

    Design and implement a 8 or 6 Port Dip Switch that control 4 LED Lights Components: Dip Switch, LEDs, Resistors Description: Using a dipswitch create an application that uses bitwise operator to shift the bits to the left one bit at a time. Turning on one LED at a time that corresponds to the dipswitch position. After the bits are shifted 4 positions, start shifting the bits to the right turning the light on and off in the reverse order...

  • A Y = A+ B 1 1 1 1 1 1 Apply the idea of the truth table above and design a 3-bit comparator using XOR or XNOR gates of...

    A Y = A+ B 1 1 1 1 1 1 Apply the idea of the truth table above and design a 3-bit comparator using XOR or XNOR gates of your choice. The design should be able to determine the equality between two 3-bit words. An LED should be turned ON only when every bit in "Word A" matches every corresponding bit in "Word B". Otherwise, the LED has to be OFF Hint for I/O port Definitions: Port Name MSB...

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