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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T23:16:00+00:00 2026-05-19T23:16:00+00:00

I have this VHDL code library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity

  • 0

I have this VHDL code

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


entity addDecoder is
port(addrInput : in real; 
  ROM_sel_n, RAM_sel_n, PIO_sel_n, SIO_sel_n, INT_sel_n : out bit);
end addDecoder;

architecture Behavioral of addDecoder is

begin
AddSelect : process(addrInput) is
begin   
    if(addrInput <= X'3FFF') then
        ROM_sel_n <= '1';
    elsif(addrInput > X'3FFF' and addrInput <= X'5FFF') then
        RAM_sel_n <= '1';
    elsif(addrInput > X'5FFF' and addrInput <= X'8FFF') then
        PIO_sel_n <= '1';
    elsif(addrInput > X'8FFF' and addrInput <= X'9FFF') then
        SIO_sel_n <= '1';
    elsif(addrInput > X'9FFF' and addrInput <= X'FFFF') then
        INT_sel_n <= '1';
end process AddSelect;
end Behavioral;

What is wrong with it. I’m getting an error with the comparing of the hexadecimal values. Am I not doing this correctly? The error is this: parse error, unexpected INTEGER_LITERAL, expecting OPENPAR or IDENTIFIER

  • 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-19T23:16:00+00:00Added an answer on May 19, 2026 at 11:16 pm

    As Philippe already said, don’t use std_logic_arith/unsigned. Use numeric_std. I’ve written about why….

    If you want to continue to make comparisons with vectors (as well as using " rather than ' around the values) you should make your addrInput an unsigned vector.

    if addrInput < X"1FFF" then
    

    Alternatively make it a natural and compare against integer values:

    if addrInput < 8191 then
    

    Also, as you are using elsif, you could simplify your statements thus:

    if addrInput <= X"3FFF" then
        ROM_sel_n <= '1';
    elsif addrInput <= X"5FFF" then
        RAM_sel_n <= '1';
    -- etc
    

    Finally, drop the ()s around your if conditions, it makes you look like a C-programmer 🙂

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

Sidebar

Related Questions

Assume I have this simple core with generics as genertest.vhd : -------------------------------------------------------------------------- library IEEE;
I am trying to model a T Flip Flop using VHDL. library ieee; use
I have this little code which lists all matches of items that contains the
I have this DependencyProperty which holds an entity with a property that is a
I have this code for doing an ajax request to a webservice: var MyCode
I have a little problem with following VHDL code: process (zbroji) begin if rising_edge(zbroji)
i have this: http://jsfiddle.net/uAQ8B/5/ This list should have all the objects on the left
I have this code to send variables to a datagrid on another page protected
I have a signal in VHDL declared like this : signal Temp_Key : std_logic_vector(79
have this code: $products = $feed->_xpath->query( //cf:vehicle ); foreach( $products as $product ) {

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.