dataflow operator
TRANSCRIPT
-
8/12/2019 Dataflow Operator
1/14
EXPRESSIONS, OPERANDSAND
OPERATORS
-
8/12/2019 Dataflow Operator
2/14
EXPRESSIONS
-
8/12/2019 Dataflow Operator
3/14
OPERANDS
-
8/12/2019 Dataflow Operator
4/14
OPERATORS
Perform an operation on operands
d1 && d2 // && operates onoperands d1 and d2
!a[0]
B1>>1
-
8/12/2019 Dataflow Operator
5/14
OPERATORTYPESANDSYMBOLS
Operator Type Operator Symbol Operation Performed Number of OperandsArithmetic *
/
+
-
%
**
multiply
divide
add
subtract
modulus
power (exponent)
two
two
two
two
two
twoLogical !
&&
||
logical negation
logical and
logical or
one
two
two
Relational >
=
-
8/12/2019 Dataflow Operator
6/14
Operator Type Operator Symbol Operation Performed Number of Operands
Bitwise ~
&
|
^^~ or ~^
bitwise negation
bitwise and
bitwise or
bitwise xorbitwise xnor
one
two
two
twotwo
Reduction &
~&
|
~|^
^~ or ~^
reduction and
reduction nand
reduction or
reduction norreduction xor
reduction xnor
one
one
one
oneone
one
Shift >>
>>
-
8/12/2019 Dataflow Operator
7/14
LOGICALOPERATORS
-
8/12/2019 Dataflow Operator
8/14
EQUALITYOPERATORS
// A = 4, B = 3
// X = 4'b1010, Y = 4'b1101
// Z = 4'b1xxz, M = 4'b1xxz, N = 4'b1xxx
A == B // Results in logical 0
X != Y // Results in logical 1
X == Z // Results in x
Z === M // Results in logical 1 (all bits match, including x and z)
Z === N // Results in logical 0 (least significant bit does not match)
M !== N // Results in logical 1
-
8/12/2019 Dataflow Operator
9/14
BITWISEOPERATORS
Bitwise operators are negation (~), and(&), or (|),
xor (^), xnor (^~, ~^).
-
8/12/2019 Dataflow Operator
10/14
REDUCTIONOPERATORS
Reduction operators are and (&), nand (~&), or (|),
nor (~|), xor (^), and xnor (~^, ^~).
perform a bitwise operation on a single vector
operand and yield a 1-bit result.
-
8/12/2019 Dataflow Operator
11/14
SHIFTOPERATORS
Shift operators are right shift ( >>), left shift (>), and arithmetic left shift
(
-
8/12/2019 Dataflow Operator
12/14
CONCATENATIONOPERATOR
-
8/12/2019 Dataflow Operator
13/14
REPLICATIONOPERATOR
-
8/12/2019 Dataflow Operator
14/14
OPERATORPRECEDENCE
Operators Operator Symbols Precedence
Unary + - ! ~ Highest precedence
Multiply, Divide,
Modulus
* / %
Add, Subtract + -
Shift >
Relational < >=
Equality == != === !==
Reduction &, ~&
^ ^~
|, ~|Logical &&
||
Conditional ?: Lowest precedence