How to extract a sub-bus from an internal bus?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to extract a sub-bus from an internal bus?

dave
In one of my home-grown projects with this cool educational software, I have a component (Comp1) that outputs a 16-bit signal. I would like to feed the 12 least significant bits of these 16 bits as input to another component (Comp2). The obvious solution:

Comp1(..., out=out1)  // out1 is 16 bits wide
Comp2(in=out1[0..11], ...)  // in is 12 bits wide

does not work because out1 in an internal bus, and internal pins may not be subscripted (as stated on page 286 of the book). What is the most elegant way out of this? Thanks in advance for any hint.
Reply | Threaded
Open this post in threaded view
|

Re: How to extract a sub-bus from an internal bus?

cadet1620
Administrator
dave wrote
In one of my home-grown projects with this cool educational software, I have a component (Comp1) that outputs a 16-bit signal. I would like to feed the 12 least significant bits of these 16 bits as input to another component (Comp2). The obvious solution:

Comp1(..., out=out1)  // out1 is 16 bits wide
Comp2(in=out1[0..11], ...)  // in is 12 bits wide

does not work because out1 in an internal bus, and internal pins may not be subscripted (as stated on page 286 of the book). What is the most elegant way out of this? Thanks in advance for any hint.
Create the 12 bit bus in the Comp1 line by assigning the new bus to a 12-bit sub-bus of Comp1's out.  It's no problem having more than one out= in a part line.

--Mark
Reply | Threaded
Open this post in threaded view
|

Re: How to extract a sub-bus from an internal bus?

dave
Cool! So, I added:

out[0..11]=subbus  (in Comp1)

as well as:

in=subbus  (in Comp2)

and it worked as intended. Thank you so much for the super-fast and
helpful reply!


On Sat, Aug 20, 2011 at 9:29 PM, cadet1620 [via Questions and Answers
Forum] <[hidden email]> wrote:

> dave wrote:
> In one of my home-grown projects with this cool educational software, I have
> a component (Comp1) that outputs a 16-bit signal. I would like to feed the
> 12 least significant bits of these 16 bits as input to another component
> (Comp2). The obvious solution:
>
> Comp1(..., out=out1)  // out1 is 16 bits wide
> Comp2(in=out1[0..11], ...)  // in is 12 bits wide
>
> does not work because out1 in an internal bus, and internal pins may not be
> subscripted (as stated on page 286 of the book). What is the most elegant
> way out of this? Thanks in advance for any hint.
>
> Create the 12 bit bus in the Comp1 line by assigning the new bus to a 12-bit
> sub-bus of Comp1's out.  It's no problem having more than one out= in a part
> line.
>
> --Mark
>
> ________________________________
> If you reply to this email, your message will be added to the discussion
> below:
> http://questions-and-answers-forum.32033.n3.nabble.com/How-to-extract-a-sub-bus-from-an-internal-bus-tp3272035p3272045.html
> To unsubscribe from How to extract a sub-bus from an internal bus?, click
> here.