Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
13 years ago

how to describe same block in Demux in VHDL

I am having problem in describing a 1 to 2**n Demux. I wrote code first for 1 to 2 demux,and use it to buid 1 to 4 demux and then 1 to 8. At the end I want to get a 1 to 2**n demux. they are shows on the images. I would rather appreciate if anyone give me some advice to use generate or others to describe it.

3 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    I would rather appreciate if anyone give me some advice to use generate or others to describe it.

    --- Quote End ---

    Here's a mux. Wrap your head around the logic, and you can figure out how to describe a demux :)

    The comments in the code described it fairly well. The PDF is a figure to help describe the indexing.

    Cheers,

    Dave
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    that's a nice little reference PDF

    --- Quote End ---

    I was getting confused with the indexing, so needed to draw a couple of examples to see what the patterns were.

    The geometric and algebraic series indexing shows up in adder trees and count-ones (bit-error-rate counters) too.

    The indexing is much more obvious if you count from the output back to the input.

    For the original poster's demux application, the indexing order would probably be reversed, to reuse the same scheme.

    Cheers,

    Dave