File: 2d_modulus.sps

package info (click to toggle)
sitplus 1.0.3-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 23,636 kB
  • sloc: cpp: 34,437; ansic: 7,957; xml: 1,141; yacc: 326; lisp: 235; lex: 167; makefile: 107; sh: 5
file content (43 lines) | stat: -rwxr-xr-x 597 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#
# 2d_modulus_sign 
# 
# Compute 2d modulus with sign
#
# Input pins
#	x (float)
#	y (float)
#
#	For proper operation, first we expect x and then y
#
# Output pins
#	result (float)
#

type 2d_modulus
name "2d modulus"

# Input pins
create forward x
create forward y
export_ipin x in x
export_ipin y in y

# Square each value
create fmul xsq 
connect x out xsq b
connect x out xsq a

create fmul ysq 
connect y out ysq b
connect y out ysq a

# Add
create fadd sum
connect xsq result sum b
connect ysq result sum a

# Square root
create fsqrt sqrt
connect sum result sqrt a

export_opin sqrt result