develooper Front page | perl.perl6.language | Postings from March 2009

decision operator

Thread Next
From:
Ruud H.G. van Tol
Date:
March 24, 2009 16:12
Subject:
decision operator
Message ID:
49C968EC.4060000@isolution.nl
I wonder if there is place for a "decision operator".
(search terms: FPGA, evolvable hardware, Xilinx, PLB, LUT, NESW)


dop:| 0 1 2 3 4 5 6 7 8 9 A B C D E F
----+--------------------------------
0 0 | 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
0 1 | 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1
1 0 | 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1
1 1 | 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1


So for two boolean inputs,
"&" is an alias of dop(1),
"|" is an alias of dop(0x07),
"^" is an alias of dop(0b0110).

(1,0).dop(7) returns 1 because (1 | 0) == 1

(4,3).dop(7) returns 7 because (4 | 3) == 7

("A","F").dop(7) returns "G" because ("A" | "F") eq "G"

(1,1,1).dop(0b01101001) returns 1 because (1^1^1) == 1

-- 
Ruud

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About