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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:21:19+00:00 2026-06-15T22:21:19+00:00

I am trying to scroll a text on the 7 segment display. The text

  • 0

I am trying to scroll a text on the 7 segment display. The text will be entered from a keyboard and I am using BASYS2 as FPGA. My keyboard interface is done, as well as my seven segment controller. But I am having problems with my shifter module. As I’m dealing with scancodes, I need to use an array of bytes. I declared such type in a package, that is “mypackage2”. However, as far as I understood, the shifter module is unable to use that type, namely “reg_array”. What do I need to change, or is there something I am missing here? As I’m new to VHDL, I might have done some basic errors. Also, the package I’ve written does not show up in the project hierarchy at the lefthand side of the window. Any help is appreciated. Thank you.

EDIT: I noticed that I shouldn’t use reg array as follows: Data_out : out reg_array(REGSIZE-1 downto 0), because its width is already specified. So I changed my code a little bit and reduced the number of errors to 3.

Here’s the shifter module:

library IEEE; 
use IEEE.STD_LOGIC_1164.ALL; 
use IEEE.STD_LOGIC_UNSIGNED.ALL; 
use IEEE.STD_LOGIC_ARITH.ALL; 
use work.mypackage2.all; 

entity shifter is 
    generic ( REGSIZE  : integer := 16); -- Text will be composed of 16 characters
    port(clk      : in  std_logic; 
         Scan_Dav : in  std_logic; -- this is '1' when there is a new scancode
         Data_in  : in  std_logic_vector(7 downto 0); --scancode from keyboard
         Data_out : out reg_array ); 
end shifter; 

architecture bhv of shifter is 

        signal shift_reg : reg_array;
begin 
    process (clk, Scan_Dav) begin 
        if rising_edge(clk) then 
            if Scan_Dav = '1' then 
                shift_reg(REGSIZE-1 downto 1) <= shift_reg(REGSIZE-2 downto 0); 
                shift_reg(15) <= shift_reg(0); 
            end if; 
        end if; 
        Data_out <= shift_reg; 
    end process; 
end bhv; 

Here’s the package:

library IEEE; 
use IEEE.STD_LOGIC_1164.all; 

package mypackage2 is 

   subtype reg is std_logic_vector(7 downto 0); -- a byte 
        type reg_array is array (0 to 15) of reg; -- array of bytes 

end mypackage2; 


package body mypackage2 is 

end mypackage2; 

And these are the latest errors:

ERROR:HDLParsers:807 - "F:/Projeilk/Shifter.vhd" Line 22. shift_reg can not be used with range downto.
ERROR:HDLParsers:807 - "F:/Projeilk/Shifter.vhd" Line 22. shift_reg can not be used with range downto.
  • 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-15T22:21:20+00:00Added an answer on June 15, 2026 at 10:21 pm

    You’ve defined the size of the byte array twice. In the package file, you’ve defined reg_array as a fixed array of 16 reg‘s. But in the architecture, you’re trying to specify the size of shift_reg by defining the size of reg_array again with (REGSIZE-1 downto 0) as if reg_array was a variable-sized array.

    You can either keep the fixed declaration of reg_array and define shift_reg as:

    signal shift_reg : reg_array;
    

    Or keep your definition of shift_reg and declare reg_array as a variable-width array like:

    type reg_array is array (natural range <>) of reg; -- variable-length array of bytes 
    

    It looks like you may have a few more errors in the code, but some of them may be cascading from this problem.

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

Sidebar

Related Questions

I am trying to scroll my textview using the following code: TextView text =
I am trying to scroll text (list elements actually) from right to left. Here
I am trying to display a text box using textView.I am adding some data
I am trying to scroll text across the screen which is working well. Update
I am trying to make some text scroll vertically using jQuery, I have been
I am trying to scroll by highlighting text and dragging down. Now, as you
I am trying to get the text to scroll at the same speed as
I'm trying to scroll a textbox using the form's WndProc method. The code I've
Still trying to figure this out from yesterday. I am trying to scroll an
I'm trying to add infinite scroll functionality to a page using code given in

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.