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 9060309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T15:11:47+00:00 2026-06-16T15:11:47+00:00

Homework for designing risc processor. I have 16 bit PC like this signal pc_din,

  • 0

Homework for designing risc processor. I have 16 bit PC like this

signal pc_din, PC, pc_rel, pc_dir, pc_inc : std_logic_vector(15 downto 0); -- pc datapath
pc_inc <= pc + 1;
pc_dir <= pc(15 downto 13) &  ADD;
pc_rel <=  pc_inc + ext(15 downto 0);

Mux for PC source is

with PCSrc select
pc_din <= A when from_A,
pc_rel when from_pcrel,
pc_dir when from_pcdir,
pc_inc when from_pcinc,
(others=>'-') when others;

I have LPM generated 16 by 256 single port ROM for instruction memory

component mem
PORT(
address : IN STD_LOGIC_VECTOR (7 DOWNTO 0);
clock   : IN STD_LOGIC ;
q   : OUT STD_LOGIC_VECTOR (15 DOWNTO 0)
);
end component;

PC register port map is

pc_reg: reg Port map (clk=>clk, rst=>rst, D=>pc_din, Q=>PC, we=>ldPC);

Now the question is how can i port map the mem component because pc is 16 bit and address is 8 bit

rom: mem port map(address=>???, clock=>clk, q=>instr_din);
  • 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-06-16T15:11:48+00:00Added an answer on June 16, 2026 at 3:11 pm

    It is normal for the available memory to be smaller than the memory space the CPU can access.

    That just means you need to design a memory map for your processor, and implement it. Are there any known constraints to help?

    For example, some processors set the PC to 16#FFFE# on reset, others to 0. This means you need a page of program memory either at the top of the memory space, or at the bottom.

    Also you need to consider whether that PC is a byte address or a word address; and (if it is a byte address) whether it will ever be odd ( in which case you need to support unaligned addresses). Since you say it is a RISC CPU I am going to assume you don’t need to support unaligned addresses, but this should be specified somewhere.

    If it is byte addressed, you need to translate the byte address to the correct word address for your ROM – supporting aligned accesses only, this is easy; just drop the LSB.

    When you have designed your memory map, you can design a decoder that only selects the program ROM when the high order address bits are the correct value. It is sometimes possible to simplify this decoding by mapping the ROM at multiple addresses (treating some address bits as don’t cares) but this is not always a good idea as it can lead to problems expanding the memory later.

    So, assuming byte addressing, aligned access only, and you know what your memory map looks like:

    ROM_Address <= PC(8 downto 1);
    ROM_Enable  <= some expression involving PC(15 downto 9);
    

    and you are done.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay this is a homework question, and I just don't have a clue how
This is a homework problem that I have. I have been doing some research
I have this insane homework where I have to create an expression to validate
I got this homework. And have solved it in following way. I need your
This is not homework. I'm designing an RPG, and for ability scores I am
Doing homework with signals and fork and have a problem with the signal. I've
I have a homework that include a new operation (a [n] b), given: a
This is not homework . I am interested in setting up a simulation of
I have a homework in which i have 640x480 image and i want to
This is a homework question, but I think there's something missing from it. It

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.