Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7638419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:10:23+00:00 2026-05-31T08:10:23+00:00

Recently i’m using VHDL to write a 16-but RAM. My code is: library IEEE;

  • 0

Recently i’m using VHDL to write a 16-but RAM. My code is:

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
use IEEE.Numeric_Std.all;

entity RAM is
port(
PC_in: in std_logic_vector (5 downto 0);
EN_WR_in: in std_logic_vector (1 downto 0);
RAM_in : in std_logic_vector(15 downto 0);
RAM_out : out std_logic_vector(15 downto 0);
test : out integer
);


end RAM;

architecture Behavioral of RAM is
type ram_t is array (63 downto 0) of std_logic_vector(15 downto 0);
signal ram : ram_t;
begin
PROCESS (EN_WR_in)
BEGIN
        if (EN_WR_in(1)='1') then

        IF (EN_WR_in(0) = '1') THEN
            ram(conv_integer(unsigned(PC_in))) <= RAM_in;
             else
        RAM_out <= ram(conv_integer(unsigned(PC_in)));
        end if;

        else

        RAM_out <="ZZZZZZZZZZZZZZZZ";

        end if;

END PROCESS;
     ram(20) <= "0000100010010000";
end Behavioral;

The problem that i facing with is i need to set some constant data in the ram just like

ram(20) <= "0000100010010000";

But the constant data didn’t exist during simulation. Is there any way to solve it?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T08:10:24+00:00Added an answer on May 31, 2026 at 8:10 am

    You can initialize the ram when you declare it:

    signal ram : ram_t := ( "0000100010010000", x"1234", ... );
    

    or perhaps

    signal ram : ram_t := ( 20 => "0000100010010000", others => (others=>'0') );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Recently, I'm trying to solve all the exercises in CLRS. but there are some
Recently my Project manager asked to write comments, summary and #regions for all the
Recently a friend and I were talking about securing stored procedure code in a
Recently I'm doing some work on RTMP streaming, that is using Flowplayer to integrate
recently I started using storyboard and I've the following situation: I want to set
Recently I've begun to code in Objective-C for iOS 5 devices. My brand new
Recently we have released our product. Our team decided to preserve the source code
Recently, we discovered odd behavior in some old code. This code has worked for
Recently i am making an app on facebook. So i have use facebook api.
Recently,I am handling a solution for WebPart internationalization,but I am not familiar with the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.