Title: CSE-308 Digital System Design (DSD)
1CSE-308 Digital System Design (DSD)
N-W.F.P. University of Engineering Technology,
Peshawar
2Dataflow Modeling
- Expressions, operands and operators form the
basis of dataflow modeling.
3Verilog Operators
- Arithmetic , , , /,
- Binary bitwise , , , ,
- Unary reduction , , , , ,
- Logical !, , , , , !, !
- returns x if any of the input bits is x or z
- compares xs and zs
- Relational lt. gt, lt, gt
- Logical shift gtgt, ltlt
- Conditional ?
- Concatenation
4Arithmetic Operators
Operation performed Operator Symbol Operator Type
Arithmetic Multiply
Arithmetic / Divide
Arithmetic Add
Arithmetic - Subtract
Arithmetic Modulus
5Logical Operators
Operation performed Operator Symbol Operator Type
Logical AND
Logical OR
Logical ! NOT
6Conditional Operators
Operation performed Operator Symbol Operator Type
Conditional ? Conditional
7Concatenation and Replication Operators
Operation performed Operator Symbol Operator Type
Concatenation Concatenation
Replication Replication
8Example Concatenation operator
9Replication Operator!
- A 2b01
- B 4 A // 01010101
- Thus B 01010101
10Relational Operators
Operation performed Operator Symbol Operator Type
Shift gtgt Right Shift
Shift ltlt Left Shift
Relational gt Greater than
Relational lt Less than
Relational gt Greater than or equal
Relational lt Less than or equal
11Reduction Operators
Operation performed Operator Symbol Operator Type
Reduction Reduction and
Reduction Reduction nand
Reduction Reduction or
Reduction Reduction nor
Reduction Reduction xor
Reduction or Reduction xnor
12Bitwise Arithmetic Operators
Operation performed Operator Symbol Operator Type
Bitwise Bitwise negation
Bitwise Bitwise and
Bitwise Bitwise Or
Bitwise Bitwise XOR
Bitwise or Bitwise XNOR
13Equality Operators
Operation performed Operator Symbol Operator Type
Equality Equality
Equality ! Inequality
Equality Case Equality
Equality ! Case Inequality
14Data Flow Modeling Continuous Assignment
- Continually drive wire variables
- Used to model combinational logic or make
connections between wires - module adder_4 (a, b, ci, s, co)
- input 30 a, b
- input ci
- output 30 s
- output co
- assign co, s a b ci
- endmodule
15- module mux2_1(in1, in2, sel, out)
- input in1, in2, sel
- output out
- assign out sel ? in2 in1
- endmodule
module stimulus reg IN1, IN2, SEL wire
OUT mux2_1 MUX(IN1, IN2, SEL, OUT) initial begin
IN1 1 IN2 0 SEL 0 5 SEL 1 5 IN1
0 end initial monitor(time, " IN1b,
IN2b, SELb, OUTb\n", IN1, IN2, SEL,
OUT) endmodule