# Re: Should return the number of input or the number of output?

**URL:** <https://www.ruby-forum.com/t/re-should-return-the-number-of-input-or-the-number-of-output/240871>\
**Category:** GNU Radio\
**Created:** [May 4, 2014, 12:34pm UTC](https://www.ruby-forum.com/t/re-should-return-the-number-of-input-or-the-number-of-output/240871 "2014-05-04T12:34:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [May 4, 2014, 12:34pm UTC](https://www.ruby-forum.com/t/re-should-return-the-number-of-input-or-the-number-of-output/240871/1 "2014-05-04T12:34:34Z")

</div>

On Sun, May 4, 2014 at 4:39 PM, Marcus Müller  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)wrote:

> Marcus

This sink block needs to produce an 8-bit integer from every 9 elements  
it  
receives.  
The below two commands will be useful, but unfortunately not currently  
being supported on python sink block:

self.set\_min\_ninput\_items(9)  
self.set\_input\_multiple(9)

One workaround, if it works, will be using forecast():

```
def forecast(self, noutput_items, ninput_items_required):
    ninput_items_required[0] = 9 * noutput_items

```

This elaborates why I try to customize the forecast() of a sink block.

---

<div class="post-metadata">

**Author:** ![activecat\_k](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c57346/32.png) [@activecat\_k](https://www.ruby-forum.com/u/activecat_k)\
**Post date:** [May 4, 2014, 9:46pm UTC](https://www.ruby-forum.com/t/re-should-return-the-number-of-input-or-the-number-of-output/240871/2 "2014-05-04T21:46:35Z")

</div>

Hi Activecat,

On 04.05.2014 12:32, Activecat wrote:

> This sink block needs to produce an 8-bit integer from every 9 elements it  
> receives.  
> Ok, this explains where the mutual confusion stems from:  
> A sink block is a block that is a sample sink. Items go in, nothing  
> comes out.

What you’re describing is a decimator. Nothing special about that, just  
use the decimator  
block type, set the decimation to 9 and you’re set.

Greetings,  
Marcus

---

<div class="post-metadata">

**Author:** ![activecat\_k](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c57346/32.png) [@activecat\_k](https://www.ruby-forum.com/u/activecat_k)\
**Post date:** [May 5, 2014, 2:10am UTC](https://www.ruby-forum.com/t/re-should-return-the-number-of-input-or-the-number-of-output/240871/3 "2014-05-05T02:10:54Z")

</div>

On Mon, May 5, 2014 at 3:45 AM, Marcus Müller  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)wrote:

> Hi Activecat,
> 
> On 04.05.2014 12:32, Activecat wrote:
> 
> > This sink block needs to produce an 8-bit integer from every 9 elements  
> > it  
> > receives.  
> > Ok, this explains where the mutual confusion stems from:  
> > A sink block is a block that is a sample sink. Items go in, nothing  
> > comes out.

This block calculates 8-bit integers and show it on console, not to any  
output port.  
There is no output port.  
Hence this is a sink block.
