Programmer Guide/SPU Reference/SELECTAB: Difference between revisions
From STX Wiki
Jump to navigationJump to search
(initial import) |
No edit summary |
||
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:{{SUBPAGENAME}}}} | {{DISPLAYTITLE:{{SUBPAGENAME}}}} | ||
Two channel multiplexer. | |||
==<code>[SPU SELECTAB <var>A B SEL</var> OUT <var>Y</var>]</code>== | |||
== | {|class="einrahmen" | ||
!input !!description !!data type !!value type!!default value | |||
<code>SELECTAB <var>A B SEL</var></code> | |||
{| | |||
|- | |- | ||
|<var>A, B</var> | |<var>A, B</var>||input data ||number, vector ||variable | ||
|data | |||
|- | |- | ||
|<var>SEL</var> | |<var>SEL</var>||select switch ||number (int.), string||variable ||<code>0</code> | ||
| | |||
| | |||
|- | |- | ||
!output !!description !!data type !!value type!!comment | |||
|- | |- | ||
| | |<var>Y</var>||selected data ||same type as <var>A</var> ||variable | ||
| | |||
|} | |} | ||
;Description: | |||
{|class="einrahmen" | |||
!SEL | |||
! <var>Y<sub>number</sub></var>=f(<var>A<sub>number</sub></var>,<var>B<sub>number</sub></var>) | |||
! <var>Y<sub>vector</sub></var>=f(<var>A<sub>vector</sub></var>,<var>B<sub>number</sub></var>) | |||
! <var>Y<sub>number</sub></var>=f(<var>A<sub>vector</sub></var>,<var>B<sub>vector</sub></var>) | |||
|- | |- | ||
| | |<code>0</code> or <code>A</code> | ||
| | |<var>Y</var> = <var>A</var> | ||
| | |<var>Y</var>[i] = <var>A</var>[i] | ||
| | |<var>Y</var>[i] = <var>A</var>[i] | ||
|- | |- | ||
| | |<code>1</code> or <code>B</code> | ||
| | |<var>Y</var> = <var>B</var> | ||
| | |<var>Y</var>[i] = <var>B</var> | ||
|Y | |<var>Y</var>[i] = <var>B</var>[i] | ||
|- | |- | ||
| | |<code>2</code> or <code>minimum</code> | ||
| | |<var>Y</var> = min(<var>A</var>,<var>B</var>) | ||
| | |<var>Y</var>[i] = min(<var>A</var>[i],<var>B</var>) | ||
|Y[i] | |<var>Y</var>[i] = min(<var>A</var>[i],<var>B</var>[i]) | ||
|- | |- | ||
| | |<code>3</code> or <code>maximum</code> | ||
| | |<var>Y</var> = max(<var>A</var>,<var>B</var>) | ||
| | |<var>Y</var>[i] = max(<var>A</var>[i],<var>B</var>) | ||
|Y[i] | |<var>Y</var>[i] = max(<var>A</var>[i],<var>B</var>[i]) | ||
|} | |} | ||
with: 0 ≤ i < length of <var>A<sub>vector</sub></var> | |||
;See also: | |||
<[[../#Signal Processing Atoms|SP-atoms]]> | |||
<!-- AN, 2.5.2011 --> |
Latest revision as of 13:59, 6 May 2011
Two channel multiplexer.
[SPU SELECTAB A B SEL OUT Y]
input | description | data type | value type | default value |
---|---|---|---|---|
A, B | input data | number, vector | variable | |
SEL | select switch | number (int.), string | variable | 0
|
output | description | data type | value type | comment |
Y | selected data | same type as A | variable |
- Description
SEL | Ynumber=f(Anumber,Bnumber) | Yvector=f(Avector,Bnumber) | Ynumber=f(Avector,Bvector) |
---|---|---|---|
0 or A
|
Y = A | Y[i] = A[i] | Y[i] = A[i] |
1 or B
|
Y = B | Y[i] = B | Y[i] = B[i] |
2 or minimum
|
Y = min(A,B) | Y[i] = min(A[i],B) | Y[i] = min(A[i],B[i]) |
3 or maximum
|
Y = max(A,B) | Y[i] = max(A[i],B) | Y[i] = max(A[i],B[i]) |
with: 0 ≤ i < length of Avector
- See also
<SP-atoms>