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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:35:59+00:00 2026-05-22T11:35:59+00:00

I need to upsample(2x) my data using Verilog. I think to use three ports

  • 0

I need to upsample(2x) my data using Verilog. I think to use three ports for input and one port for output. Input ports are filterin, reset and clock. Output port is filterout. Also I need dynamic input size. How can I realize this with Verilog.

Edit1:
My input and output datas are 16 bit long. I just need a Verilog code to do this:

If Input: 1 2 3,
Then Output: 1 0 2 0 3 0.

If Input: 1 2 3 4 5,
Then Output: 1 0 2 0 3 0 4 0 5 0.

Edit2:
I created a verilog file to solve this but it didn’t solve my problem.

US1.v file

`timescale 1ns / 1ps

module US1 (filterin,clk,filterinus);

    input [15:0] filterin;
    input clk;

    output reg [15:0] filterinus;

    integer i=0;

    always @ (posedge clk) begin
        if (i==0) begin
            filterinus <= filterin;
        end
        else begin
            filterinus <= 0;
        end
        i=~i;
    end


endmodule

I tested this code with the following Test bench:

Test.v file

`timescale 1ps/1ps
module Test;

    reg [15:0] filterin;
    reg clk;
    wire [15:0] filterinus;

    US1 uut (
        .filterin(filterin), 
        .clk(clk),
        .filterinus(filterinus)
    );

    initial begin
        clk = 1;

        filterin = 1;
        #2 filterin = 2;
        #2 filterin = 3;
        #2 filterin = 4;
        #2 filterin = 5;

        #30 $finish;
    end

    always #1 clk = ~clk;

endmodule

As is seen, my input is: 1 2 3 4 5.
My output is: 1 0 3 0 5 0 5 0 5 0…
I need to see: 1 0 2 0 3 0 4 0 5 0 0 0 0 0…

  • 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-22T11:36:00+00:00Added an answer on May 22, 2026 at 11:36 am

    Problem solved. I changed filterin input period from my testbench like this:

        filterin = 1;
        #4 filterin = 2;
        #4 filterin = 3;
        #4 filterin = 4;
        #4 filterin = 5;
        #4 filterin = 0;
    

    And I got my output: 1 0 2 0 3 0 4 0 5 0 0 0…

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

Sidebar

Related Questions

need a little help with this one. I have a form that I am
Need some advice to use iframe for widget or not. Will some addons/plugin block
Need to generate some financial report where the formatting is controlled by the data
I'm developing an app that handle sets of financial series data (input as csv
Need something simulat jcrop plucgin (link to example is here: http://publikz.com/one-more-task-rounded-selection-in-jquery/ ) but with
Need advise I am currently using CRM4.0 webservice to create account from reading my
Need help with copying array object to a temp array object using a for
Need to know how to get YQL to return only data that's newer than
Need help with implementing a pure abstract class via inheritance , using namespace to
Need help with the codeigniter, I think file_exists is for server path, not for

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.