Programmer Guide/SPU Reference/ADD: Difference between revisions

From STX Wiki
Jump to navigationJump to search
m (1 revision: Initial import)
No edit summary
Line 1: Line 1:
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
====ADD====
Add inputs <var>A</var> and <var>B</var>
;<code>[SPU ABS <var>A</var> OUT <var>Y</var>]</code>:


Add values of inputs <var>a</var> and <var>b</var>.
{|class="einrahmen"
!In !!Out !!Description
|-
|<var>A<sub>number</sub></var>
|<var>Y<sub>number</sub></var>
|<var>Y</var> = <nowiki>|</nowiki><var>A</var><nowiki>|</nowiki>
|-
|<var>A<sub>vector</sub></var>
|<var>Y<sub>vector</sub></var>
|<var>Y</var>[i] = <nowiki>|</nowiki><var>A</var>[i]<nowiki>|</nowiki>
|}


if <var>a</var> and <var>b</var> are numbers: <var>y</var> = <var>a</var>+<var>b</var>
;See also:
 
<[[../#Signal Processing Atoms|SP-atoms]]>
if <var>a</var> is a vector and <var>b</var> a number: <var>y</var>[i] = <var>a</var>[i]+<var>b</var>
<!-- AN, 2.5.2011 -->
 
if <var>a</var> and <var>b</var> are vectors: <var>y</var>[i] = <var>a</var>[i]+<var>b</var>[i]
 
=====Usage:=====
 
<code>ADD <var>a b</var></code>
 
=====Inputs:=====
 
;<var>a</var>
 
:A number or vector.
 
;<var>b</var>
 
:A number or vector.
 
=====Outputs:=====
 
;<var>y</var>
 
:A number or vector (same type as <var>a</var>).

Revision as of 10:48, 2 May 2011

Add inputs A and B

[SPU ABS A OUT Y]
In Out Description
Anumber Ynumber Y = |A|
Avector Yvector Y[i] = |A[i]|
See also

<SP-atoms>

Navigation menu

Personal tools