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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T17:10:38+00:00 2026-06-10T17:10:38+00:00

I have made this VHDL code for writing to a USB-chip. It all runs

  • 0

I have made this VHDL code for writing to a USB-chip.

It all runs inside a case statement, where each operation (write, read, ect.) is implemented.

The two write register sections below are equal, only different by the address and data.

Can this be simplified using a procedure or something?

            -------- WRITE REGISTER ---------
            when s10 =>
                -- Txd Cmd
                txdata(7 downto 6) <=  "10";        -- CMD = register write
                txdata(5 downto 0) <=  "000100";    -- address
                state := s11;
            when s11 => 
                -- write reg
                if nxt = '1' then
                    txdata <= X"45";    -- output on clock rising edge when nxt is high
                    stp <= '1';                     
                    state := s12;
                end if;
            when s12 =>
                stp <= '0';                             
                txdata <= "00000000";       -- idle                 
                state := s20;

            -------- WRITE REGISTER ---------
            when s20 =>
                -- Txd Cmd
                txdata(7 downto 6) <=  "10";        -- CMD = register write
                txdata(5 downto 0) <=  "110101";    -- address
                state := s21;
            when s21 => 
                -- write reg
                if nxt = '1' then
                    txdata <= X"04";                                            
                    stp <= '1';                     
                    state := s22;
                end if;
            when s22 =>
                stp <= '0';                             
                txdata <= "00000000";       -- idle                 
                state := s30;
  • 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-10T17:10:39+00:00Added an answer on June 10, 2026 at 5:10 pm

    Yes, use a procedure. Is this not what you asked here already?

    Design VHDL state machine for initialization

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

Sidebar

Related Questions

I have made this code: var foo=document.createElement(div); var childs=foo.getElementsByTagName(*); console.log(childs.length);//0 OK var a=document.createElement(a); foo.appendChild(a);
I have made this code to open a database(created in SQLite browser) stored in
I have made this piece of code that makes a roll hover effect on
I have made this code(it is a part of my whole script) -- if(unset($_SESSION['USER_ID']))
I have made this code for giving out +1 point, but it doesn't work
I have made this line of code to make the words, that is searced
I have made this script to open a fancybox from code behind, but it
Well i have made this jquery code $(document).ready(function(){ $(.graduate).keyup(function(e){ if(e.keyCode!=8 && (e.keyCode<48 && e.keyCode>57)){
I have made this so far. It's code that will make a json String
I have made this code that makes some visual tiles that fades in and

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.