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

  • Home
  • SEARCH
  • 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

I have this code in jQuery, that I want to reimplement with the prototype
have this code import threading def Thread(f): def decorator(*args,**kargs): print(args) thread = threading.Thread(target=f, args=args)
Have have this line of code in my form when I create a new
I have this code: if (PsionTeklogix.Keyboard.Keyboard.GetModifierKeyState(Key.Orange) == KeyState.Lock) PsionTeklogix.Keyboard.Keyboard.InjectKeyboardCommand(Function.Orange, 0, 0); if (PsionTeklogix.Keyboard.Keyboard.GetModifierKeyState(Key.Blue) ==
I have this dicT in my code that contain some positions. position = ['712,352',
I have this code in my controller for Index view.. public ActionResult Index(int? id)
i have this code where you can select the date you like to attend
I have this idea for a free backup application. The largest problem I need
I have this gigantic ugly string: J0000000: Transaction A0001401 started on 8/22/2008 9:49:29 AM
I have this line in a javascript block in a page: res = foo('<%=

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.